Contact Us 1-800-596-4880

MUnit Assert Equals Processor

logo acb active Anypoint Code Builder

logo studio active 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.