Hi, I have a Q regards validating response. | Rest Assured Forum
S
Santhosh Kumar T Posted on 13/06/2019

In Module 15, we are validating entire response using JSONAssert as a string right, so what is the need of validating specific fields again using Hamcrest or some other way?

 

In general, we need to validate actual response is valid against expected response which can be done using JSONAssert. 


A
Ashish Thakur Replied on 17/06/2019

Hi Santhosh,

Its good that you asked this quetion. See, Hamcrest has several benefits. It allows to specify the validations in a more fluent & flexible manner.

And well you do encounter certain situations where specific JSON values have to be compared and Hamcrest having rich library of multiple methods makes the process much easier.