Also we will see how to run MUnits using Tags from command line
Execute from Command Line
Using “mvn test” at the terminal will test all MUnit tests, but here we describe how to test only one MUnit file
Run the following command at the project root folder.
In the following example, the MUnit test file is called run-single-munit-test-suite.xml
mvn clean test -Dmunit.test=run-single-munit-test-suite.xml
Running Single MUnit test case
mvn clean test -Dmunit.test=abc.xml#testName
mvn clean test -Dmunit.test=mvn clean test -Dmunit.test=run-single-munit-test-suite.xml#run-single-munit-test-suite-run-single-munitFlowTest
In this case, the “testName” is the name of the test to be executed.
Execute from AnypointStudio
Running Munit using Tags CommandLine
mvn clean test -Dmunit.tags=flow
Above command will run all the munit tests tagged as name “flow“
You can also use combination as below:
mvn clean test -Dmunit.test=run-single-munit-test-suite.xml -Dmunit.tags=flow
Please find sample Mule project in Github run-single-munit-Mule4
Happy learning 🙂