About MUnit Matchers

MUnit matchers are a set of DataWeave functions to define mocks, verifications, and assertions conditions in terms of general values rather than specific hardcoded values.

When defining matchers you need to add the MuniTools:: prefix to the expression.
A matcher does not receive parameters; rather, it’s a parameter itself that you can use to validate the result of an expression.

Table 1. MUnit Matcher Functions
Matcher Name Description Example


Checks that the expression is null



Checks that the expression is null



Checks that the expression is equal to a specific value



Checks if the provided matcher is not successful



Checks that the expression’s media type is the one specified



Checks that the expression’s encoding is the one specified


both(Matcher, Matcher)

Checks that both provided matchers are successful



Checks that at least one of the matchers is successful


Was this article helpful?

💙 Thanks for your feedback!

Edit on GitHub
Give us your feedback!
We want to build the best documentation experience for you!
Help us improve with your feedback.
Take the survey!