Introducing MUnit
MUnit is a unit testing framework to test a Mule application. It provides complete unit testing capabilities within Anypoint Studio. MUnit has two modules, MUnit and MUnit Tools.
The MUnit module has the following operations:
- Set Event: To add a payload, variable, or attribute required for testing.
- Set null payload: To add a null value for a payload during testing.
- After Suite: This runs after all the test executions are completed. For example, if a test suite has 10 tests, then it gets executed just once after all 10 test executions are completed.
- After Test: Runs after each test.
- Before Suite: Runs only once before executing all the tests.
- Before Test: Runs before each test.
- Test: Used to create a new test.
The MUnit Tools module has the following operations to validate whether it is working as expected or not:
- Assert equals: To check whether the payload value is equal to a specific value or not.
- Assert expression...