When running several tests, the build output can get very complex to read. MUnit allows you to redirect the output of each test suite to a file. This way, only the test results will remain in the build output and to you can check the respective file to check the standard output of each test suite.
These files are located in the testOutputDirectory folder following the naming convention: munit.${suiteName}-output.txt, where the suiteName represents the name of the XML file relative to the MUnit test folder.
The test’s output that doesn’t belong to a particular suite won’t be printed to keep the build output clean, but it can be enabled by running maven in debug mode.
To redirect the output of each test suite to a file:
Redirect test output to file
<plugins>
<plugin>
<groupId>com.mulesoft.munit.tools</groupId>
<artifactId>munit-maven-plugin</artifactId>
<configuration>
...
<redirectTestOutputToFile>true</redirectTestOutputToFile>
...
</configuration>
</plugin>
</plugins>
By default, it is set to false
Test Output Directory
You may want to choose the location where the test output files will be created. The path specified can be absolute or written as a Maven placeholder:
Test output directory with absolute path
<plugins>
<plugin>
<groupId>com.mulesoft.munit.tools</groupId>
<artifactId>munit-maven-plugin</artifactId>
<configuration>
...
<testOutputDirectory>/my/absolute/path</testOutputDirectory>
...
</configuration>
</plugin>
</plugins>
Test output directory using maven placeholders
<testOutputDirectory>${project.build.directory}/my/output/folder</testOutputDirectory>
By default, the files are created in ${project.build.directory}/munit-reports/output/.