I have been successfully using JSONAssert to compare two json responses like this:
JSONAssert.assertEquals(response2.getResponseBodyContent(), response1.getResponseBodyContent(), JSONCompareMode.LENIENT)
I now need to ignore certain attributes as described here:
Ignore specific nodes/attributes while comparing two JSONs My new statement is:
JSONAssert.assertEquals(response2, getResponseBodyContent(), new CustomComparator(JSONCompareMode.LENIENT, new Customization("EffectiveEpochDate", (o1, o2) -> true)));
and I am getting the following errors:
java.lang.Error: Unresolved compilation problems:
Groovy:expecting ')', found ',' @ line 51, column 154.
Groovy:expecting ')', found '->' @ line 51, column 160.
Groovy:expecting ')', found '->' @ line 51, column 160.
Groovy:expecting '}', found '->' @ line 51, column 160.
Groovy:expecting '}', found '->' @ line 51, column 160.
I am using a testing tool called Katalon that supports java/groovy. Any input would be appreciated. Thanks