Getting started Community Training Tutorials Documentation APIs, AI & Tools
<munit-tools:assert-equals
actual="#[payload]"
expected="#[2]"
message="The payload should be 2"/>
Assert Equals
Assert Equals
Anypoint Code Builder
Anypoint Studio
The MUnit Assert Equals processor validates that two values are equal during a MUnit test. Use it to check the state of a Mule Event’s payload or variables after production code runs.
For example, to assert that a payload is equal to a certain value, you can configure the Assert-Equals processor the following way:
<munit-tools:assert-equals
actual="#[payload]"
expected="#[2]"
message="The payload should be 2"/>
If the expected attribute is a String, you can specify the literal value without requiring an expression.
<munit-tools:assert-equals
actual="#[payload]"
expected="Example"
message="The payload should be 'Example'"/>
If this assertion fails, the processor throws a MUNIT-TOOLS:ASSERTION_ERROR.