comparing two REST services to each other

前端 未结 3 1646
礼貌的吻别
礼貌的吻别 2021-01-16 22:04

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

3条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-16 22:28

    I would use jUnit and some of the example test cases from the Jersey source as a starting point. Without knowing specifically how you want to determine "identical" responses, you can make a request to each in your test case and iterate through the response, convert it to a string and test for equals(), etc. Here is an example of a JSONP from JAXB test.

提交回复
热议问题