Skip to content

Consumer IT: Auto-fix generated wiremock mapping

Ebernhardson requested to merge work/ebernhardson/wiremock-mapping-json into main

The generated wiremock mappings were not correct out of the box, which led to an ineffective mapping being commited. The end result was that the consumer integration test did not fail when the requests changed, it matched all requests.

Since the default matching doesn't work for us define a simple custom matcher that considers the body as a set of unordered lines, and requires that all lines are matching between the spec and the request. This isn't a perfect match to our needs, it doesn't enforce the relationship between the header and body of a 2-line bulk request, but is probably sufficient. Adjust the mappings generation to use this matcher by default.

As long as we are defining a custom matcher, make the commited file a bit easier to look at by allowing the json to be stored directly, instead of encoded into a json-encoded string.

Bug: T353427

Merge request reports