org.mule.munit

assert

1.0.1
Namespacehttp://www.mulesoft.org/schema/mule/munit
Schema Locationhttp://www.mulesoft.org/schema/mule/munit/1.0/mule-munit.xsd
Version1.0
Minimum Mule Version3.2

Module Overview

Module for asserting in Munit tests.

Summary

Message Processors
<munit:add-expected>

Assert module keeps a queue of expected payloads, so you can call assertNotSame and assertOnEquals

inside a inbound flow you created for your tests.

<munit:assert-false>

Check if an expression is false.

<munit:assert-not-null>

Assert for a Not Null payload.

<munit:assert-not-same>
Assert two objects are not equal
<munit:assert-null>

Assert Null Payload.

<munit:assert-on-equals>

Check that two objects are equal.

<munit:assert-that>

Assert that the payload is equal to an expected value.

<munit:assert-true>

Assert for a true expression.

<munit:fail>

Fail assertion.

<munit:reset-calls>

Resets the module



<munit:set>

Defines the payload for testing.

<munit:set-null-payload>

Defines a Null payload for testing.

<munit:validate-calls>

Checks that all the expected calls to assert has been done



Message Processors

<munit:add-expected>

Assert module keeps a queue of expected payloads, so you can call assertNotSame and assertOnEquals

inside a inbound flow you created for your tests. The expected payload is taken from the peek of the queue

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescription
config-ref Optional. Specify which configuration to use.
value Description message to be shown in case of failure.
Child Elements

<munit:assert-false>

Check if an expression is false.

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescription
config-ref Optional. Specify which configuration to use.
message Optional. Description message to be shown in case of failure.
condition Boolean expression
Child Elements

<munit:assert-not-null>

Assert for a Not Null payload.

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescription
config-ref Optional. Specify which configuration to use.
message Optional. Description message to be shown in case of failure.
payload Payload
Child Elements

<munit:assert-not-same>

Assert two objects are not equal

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescription
config-ref Optional. Specify which configuration to use.
message Optional. Description message
expected Optional. Expected value. If not provided the expected value is taken from the expected value Queue.
value Real value
Child Elements

<munit:assert-null>

Assert Null Payload.

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescription
config-ref Optional. Specify which configuration to use.
message Optional. Description message to be shown in case of failure.
payload Payload
Child Elements

<munit:assert-on-equals>

Check that two objects are equal.

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescription
config-ref Optional. Specify which configuration to use.
message Optional. Description message to be shown in case of failure.
expected Optional. Expected value. If not provided the expected value is taken from the expected value Queue.
value Real value
Child Elements

<munit:assert-that>

Assert that the payload is equal to an expected value.

The payloadIs-ref can be any Object/expression.

The assertion Fails if the payload is not equal to the payloadIs-ref

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescription
config-ref Optional. Specify which configuration to use.
message Optional. Description message to be shown in case of failure.
payloadIs Expected Value
payload Payload
Child Elements

<munit:assert-true>

Assert for a true expression.

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescription
config-ref Optional. Specify which configuration to use.
message Optional. Description message to be shown in case of failure.
condition Boolean expression
Child Elements

<munit:fail>

Fail assertion.

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescription
config-ref Optional. Specify which configuration to use.
message Optional. Description message to be shown in case of failure.
Child Elements

<munit:reset-calls>

Resets the module

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescription
config-ref Optional. Specify which configuration to use.
Child Elements

<munit:set>

Defines the payload for testing.

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescription
config-ref Optional. Specify which configuration to use.
payload Payload
Child Elements
Return Payload
  • The testing payload

<munit:set-null-payload>

Defines a Null payload for testing.

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescription
config-ref Optional. Specify which configuration to use.
Child Elements
Return Payload
  • Null payload

<munit:validate-calls>

Checks that all the expected calls to assert has been done

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescription
config-ref Optional. Specify which configuration to use.
Child Elements