Skip to content
Advertisement

Rest-Assured – How to validate response body with POJO

I’m freshman in Rest-Assured. I have a simple test which gets response body and I want to validate whether the response body matches with my POJO class.

Here is my test:

JavaScript

Here is my POJO class:

JavaScript

So how to validate that the response body structure is equal to my POJO class?

Thanks in advance

Advertisement

Answer

Try the approach like this:

JavaScript

And then compare the object to your golden one as usual.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement