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
You're viewing an older version of the documentation. You can switch to the latest version or use the version selector in the left navigation.
The Assert Equals processor allows you to run assertions in order to validate the state of a Mule Event’s content. This processor can be used to validate the Mule Event after the 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 java.lang.AssertionError.