有人对编写比较两个 REST 服务的测试有什么建议吗?我们这样做是作为回归测试的一种形式。
我希望能做一些类似的事情:
- 向两个服务发送“/1”的 GET 并比较结果
- 向两个服务发送 POST 并比较结果
- 向两个服务发送 PUT,并比较结果
这个想法是:
REST 服务是用 Java/Jersey 编写的,因此使用它是理想的选择,但是人们发现什么有用呢?
由于这是一个广泛的非编码问题,与 java 并不严格相关,因此以下是一些相关链接:
- Twitter 开源 Diffy 服务器,比较主要、次要和候选端点:https://github.com/twitter/diffy https://github.com/twitter/diffy
- 一个类似的、更简单的 http 代理:https://github.com/xthexder/httptee https://github.com/xthexder/httptee
- 有人使用 JMeter 这样做:https://dzone.com/articles/the-easiest-way-to-compare-rest-api-responses-usin https://dzone.com/articles/the-easiest-way-to-compare-rest-api-responses-usin
- 使用 Postman 响应后挂钩来比较请求的示例:https://documenter.getpostman.com/view/33232/difference- Between-two-responses/2QsCkC https://documenter.getpostman.com/view/33232/difference-between-two-responses/2QsCkC
- Postman 方法,但使用 newman,一个 postman CLI 客户端:https://github.com/indeedeng-alpha/newman-reporter-diff https://github.com/indeedeng-alpha/newman-reporter-diff
任何人都可以随意编辑我的答案以添加更多展示 API 响应比较的替代方案
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)