You are viewing an older version of this topic. To go to a different version, use the version menu at the upper-right. +

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


In this topic: