How to properly unit test RestEasy responses?
I think the question is much subjective and my answer will be also IMO:
I would go such way as well. as for me I saw a lot of times when bug/issue is caught on the implementation level or after server/client REST API migration
There are some duplication -
RequestDescriptor, RequestCreator, ClientRequest, ClientResponse
. So you could extract some classes to reduce this boilerplate code. Take look to SquareRetrofit
example https://github.com/square/retrofit/blob/master/retrofit-samples/github-client/src/main/java/com/example/retrofit/GitHubClient.javaSomeone could say, that integration tests are more valuable and could be used not as addition but instead of unit tests for REST. But I don't think so. And yes, we are exposing a lot details of the implementation here, it means every change you have to change tests as well
I would probably also convert requests to url and bodies. And use string or JSON comparison for asserts. That would be much less code
For integration tests and to test the resteasy service deployed in a server restassured is the good one.