My project - Java, Spring boot, Maven, Junit, Jacoco
I am starting the spring application context and running the integration tests against REST API endpoints. And I want to see the report with integration test coverage, like this:
List of endpoints (4):
api/status --->>> not covered
api/users --->>> not covered
api/countries --->>> covered
api/offices --->>> covered
CodePudding user response:
As far as I know, that cannot be done. JaCoCo does not see endpoints, JaCoCo sees code and methods.
CodePudding user response:
Running the test using JUnit will automatically set in motion the JaCoCo agent. It will create a coverage report in binary format in the target directory, target/jacoco.exec.
In order to interpret the output you can use plugins like Sonar Qube.
The conventional way is to use the jacoco:report goal in order to generate readable code coverage reports in formats like HTML, CSV, and XML.