相互比较两个REST服务 [英] comparing two REST services to each other

查看:116
本文介绍了相互比较两个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. 向两个服务发送"/1"的GET并比较结果
  2. 向这两个服务发送POST,然后比较结果
  3. 将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:

  • 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆