My api has a response payload that is inside an array and the size of the array can change between test runs. Array is big hence not posting the expected / actual values here.
I have assert code that can compare two payload and ignore values that i'm expecting to be different. but if the response array is bigger than expected (which is likely in my case) it fails. is there a way to ignore the size of the array validation in JSONAssert.assertequals()method? JSONCompareMode.LENIENT is not cutting it.
i can ignore any key/value pairs in the payload with this and the assertion still passes. but if i have a response array that's bigger than the expected, then it fails.
java.lang.AssertionError: []: Expected 55 values but got 57
My assertion code:
JSONAssert.assertEquals(expResponseBody.toString(), actualResponseBody.toString(), new CustomComparator(JSONCompareMode.LENIENT, new Customization("ignoreKey", (o1, o2) -> {return true;})));