Hi How to change this custom matcher (<https://git...
# wiremock-java
k
Hi How to change this custom matcher (https://github.com/kitsemets/wiremock-custom-matcher-test/blob/main/src/test/java/com/github/kitsemets/wiremock/matcher/CustomJsonMatcher.java) so that it would print out the diff message given by AssertJ? It uses the recently added
DiffDescription
class (https://github.com/wiremock/wiremock/pull/2771), but I can't figure out a way to use it correctly with my custom matcher which uses AssertJ to diff the json object in the POST request body. Two test methods attempting to show my goal: https://github.com/kitsemets/wiremock-custom-matcher-test/blob/main/src/test/java/com/github/kitsemets/wiremock/matcher/CustomMatcherTest.java
r
thanks for creating a minimal project show casing your query very clearly. the reason that you're not seeing the expected diff message is because the
DiffDescription
class is only used when rendering near miss responses, not when performing verifications. for verifications,
JUnitStyleDiffRenderer
is used, which is a more simplified renderer that does not take into account the
DiffDescription
k
thank you for the response.