SQ Version - 8.9.6
So, I am trying to run code coverage for our maven multi module project and we have written integration test in a separate module.
We have “mvn verify sonar:sonar -Pcoverage” as part of buildkite pipeline step and it successfully generates the sonarqube report in cloud.
But the report says some of the service layer classes were uncovered with tests even though they are part of the integration test flow.
In the buildkite logs, I can see integration tests being executed.
Is this a normal behavior and does it expect me to write unit tests for the service layer classes as well. We do not have it as of now.
The structure of code is something like this and Integration test class the resource class.
Resource class>Service class
The resource class is showing 100% coverage but service class shows 0%.
I am using Jacoco plugin in the parent pom
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
<executions>
<execution>
<id>prepare-agent</id>
<phase>initialize</phase>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<goals>
<goal>report-aggregate</goal>
</goals>
<phase>verify</phase>
</execution>
</executions>
</plugin>