I have two JSON objects represented as Java String
s
Expected:
{
"id" : "1234567"
"balance" : "123"
}
I converted this into JSON object and trying to validate this with output JSON Actual:
{
"id" : "1234567"
"balance" : "123.00"
}
I am using JSONAssert.assertequal("incorrect json",actual,expected,false);
This is failing with expected 123
and got 123.00
.
what to do so that it will treat both the values same.in a nutshell how do I use custom comaparator ,please note that I dont want to exclude/suppress this attribute from my validation