Search code examples
javamuleanypoint-studiomunit

How to write Java MUnit tests with MUnit 2.1 and Mule 4.1


I have started moving from Mule 3.9 to 4.1, which means moving to Anypoint Studio 7 and MUnit 2.1

Previously, in MUnit 1.3 it was easy to create automated test suites in Java by extending the FunctionalMunitSuite class and following the instructions in the official Mule doco here: https://docs.mulesoft.com/munit/v/1.3/munit-tests-with-java.

I cannot find a similar approach using MUnit 2.1, the documentation only describes writing the test suites using the graphical/xml approach: https://docs.mulesoft.com/munit/v/2.1/

I find writing java MUnit tests much more reliable and extendable, does anyone have any experience doing this with MUnit 2.1? Specifically, how can I write Java based MUnit or JUnit tests in Mule 4 without needing to revert to the graphical test suites.


Solution

  • Java based tests are not currently supported in MUnit 2.x.