The MUnit After Suite is a scope. It can contain code that is meant to be executed after the whole suite. The After suite has one execution rule: Run after all the tests, just once.
For instance, let’s suppose you have an MUnit Test Suite File with four tests. The code inside an MUnit After Suite, runs just once, after all your tests.
|
|
You can only use one After Suite scope per MUnit test suite.
|
After Suite example
<munit:before-suite name="before.suite" description="A description">
<!-- some mule code here -->
</munit:before-suite >
<munit:test name="munit.test" description="Test">
<!-- some more mule code here -->
</munit:test>
<munit:after-suite name="after.suite" description="A description">
<!-- some Mule code here -->
</munit:after-suite >
Note that the after-suite is located outside the MUnit test. One instance in which the MUnit After Suite is useful is when you need to tear down a test environment after the whole test runs.
When you place an after-suite in the Anypoint Studio canvas, the scope locates outside the MUnit test.