Define, Share and Automate your tests / specifications

Json comparaison

Tmar allows defining values as Json for Json message comparaison.
To define a column as a collection of Json values you have to call the method setJsonComparison('<column name>',<sort list>) in a method with @Before annotation
The <sort list> parameter tells Tmar if list values have to be in the same order or not.
def setupTest() {

Expected value

returned value

As days List is not ordered the same way in both message, and <sort list> is set to true, Tmar raise an error
With <sort list> set to false, Tmar considers both messages equivalent