相互比较两个REST服务 [英] comparing two REST services to each other
本文介绍了相互比较两个REST服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有人在编写比较两个REST服务的测试方面有任何技巧吗?我们将其作为回归测试的一种形式.
Does anyone have any tips on writing tests that compare two REST services? We are doing this as a form of regression testing.
我希望按照以下方式做些事情:
I was hoping to do something along the lines of:
- 向两个服务发送"/1"的GET并比较结果
- 向这两个服务发送POST,然后比较结果
- 将PUT发送到这两种服务,然后比较结果
想法是:
- 每个操作都发送到两个服务
- 结果应该相同
REST服务是用Java/Jersey编写的,因此使用它是理想的选择,但是人们发现有什么用呢?
The REST services are written in Java/Jersey, so using that would be ideal, but what have people found to be useful?
推荐答案
由于这是一个与Java严格无关的广泛的非编码问题,因此以下是一些相关链接:
Since this is a broad, non-coding question not strictly related to java, here are some related links:
- twitter开源Diffy服务器,比较主要,次要和候选端点: https://github.com /twitter/diffy
- 类似的,更简单的http代理: https://github.com/xthexder/httptee
- 有人使用JMeter执行此操作: https://dzone.com/articles/比较REST API响应的最简单方法
- 使用Postman后响应挂钩比较请求的示例: https://documenter.getpostman.com/view/33232/difference-between-two-responses/2QsCkC
- 邮递员方法,但使用邮递员CLI客户端纽曼: https://github .com/indeedeng-alpha/newman-reporter-diff
- The twitter open-source Diffy server, comparing primary, secondary and candidate endpoints: https://github.com/twitter/diffy
- a similar, simpler http proxy: https://github.com/xthexder/httptee
- Someone doing this using JMeter: https://dzone.com/articles/the-easiest-way-to-compare-rest-api-responses-usin
- An Example using Postman post-response hooks to compare requests: https://documenter.getpostman.com/view/33232/difference-between-two-responses/2QsCkC
- The Postman approach but using newman, a postman CLI client: https://github.com/indeedeng-alpha/newman-reporter-diff
任何人都可以随意编辑我的答案以添加更多替代方法,以展示API响应比较
Anyone feel free to edit my answer to add more alternatives demonstrating API response comparison
这篇关于相互比较两个REST服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文