Overview of the match operations supported by WireMock Cloud
equalTo
binaryEqualTo
equalTo
but compares bytes rather than strings. Useful when you need to match
e.g. an uploaded image.
matches
doesNotMatch
matches
. Will match if the incoming value does not match the regular expression.
contains
doesNotContain
contains
. Will match if the input string does not contain the expected value.
equalToJson
equalTo
when dealing with JSON as it will ignore
differences in whitespace, and it is optionally possible to ignore array orderings
and extra object attributes. It also provides the concept of placeholders, allowing
you to selectively ignore or merely constrain specific JSON elements.
The underlying implementation for equalToJson
is supplied by
JSONUnit.
You can learn more about working with JSON in the Matching JSON article.
matchesJsonPath
equalToXml
matchesJsonPath
this ignores differences in whitespace and supports placeholders
so that specific element values can be ignored.
The underlying implementation for equalToXml
is supplied by
XMLUnit.
You can learn more about working with XML in the Matching XML article.
matchesXPath
before, after and equals(date/time)
before
after
equals (date/time)