Test Coverage Reports
When you scan a Mule application, the scanner also picks up the MUnit coverage report your build produced and records it with the assessment: the overall coverage, the coverage of each file and flow, and which lines were covered.
Produce the report
Configure the MUnit Maven plugin in the Mule application's
pom.xmlto measure coverage and write the coverage report in JSON format.In your pipeline, run the MUnit tests before the scan step, in the same workspace, so the report is on disk when the scanner runs.
Check that the build leaves the report at
target/site/munit/coverage/munit-coverage.json, under the project folder.
Send it with the scan
No extra option is needed. When the scanner analyzes a Mule application, it looks for target/site/munit/coverage/munit-coverage.json under the folder given by -source (the current folder by default) and uploads:
Overall coverage
The coverage percentage of the whole application.
File coverage
The coverage percentage of each Mule configuration file.
Flow coverage
The coverage percentage of each flow, within its file.
Line coverage
The covered and uncovered lines of each flow.
This works the same with the command-line scanner and the Maven plugin.
The report is missing
The log says Mule Coverage report not found and the assessment records 0% coverage.
The report cannot be read
The log says Error parsing coverage report with the reason. The scan and its findings are still recorded.
Review the coverage

Open the branch from Workspaces → Code Analysis → Branches & baselines.
In the branch dossier, open Assessments.
Under Assessment history, click Code coverage on the assessment's row. The action is shown for Mule applications only.
The Application Code Coverage page shows the Overall Coverage and the coverage of each file. Expand a file to see its flows, and click View Line Coverage on a flow to see its covered and uncovered lines.
Next steps
Maven Plugin: scan the Mule project as a Maven goal.
Pipeline Examples: add the scan step after your tests.
Branches & Baselines: open the branch dossier.
CI/CD Integration: how a pipeline scan works.
Last updated
Was this helpful?

