Seongyun Kim
05/08/2024, 7:50 AM// expectedRequestBody : {"number": 1.00}
// actualRequestBody : {"number": 1}
verify(postRequestedFor(urlEqualTo("/verify/this"))
.withRequestBody(equalToJson(expectedReqestBody)));
For now, above test result is success.
I checked wiremock’s code and I found that number comparator used by EqualToJsonPattern
is NormalisedNumberComparator
which is remove trailing zeros before compare.
Is there any way to compare number without trailing zeros or using custom number comparator?
Thank you for your answer in advance.Lee Turner
05/08/2024, 9:01 AMNumberComparator
. You could use the find(…)
method instead to retrieve the events, then perform your own assertion(s) on these events.