SonarQube doesn't recognize Mapper's unit test

Running SonarQube Version 6.7.2 (build 37468) - LGPL v3, Junit 4 and mockito in our project, I noted that SonarQube does not recognize Mapper’s unit test and decrease the project’s percentual. In my local enviroment, the test works well and the coverage is 100% by Eclipse.

Below is the UT code:

public class ClassMapperTest {
    private ClassMapper mapper;
    private ClassDTO dto;
    public void setUp() {
        mapper = Mockito.mock(ClassMapper .class);
        dto = Mockito.mock(ClassDTO.class);
    public void returnResource() {
        Mockito.when(mapper.fromMethod(Mockito.anySet())).thenReturn(new HashSet<>());

        mapper.fromMethod(new HashSet<ClassDTO>());

The statistics:

enter image description here

Then Commit:

enter image description here

Does anyone have any idea?


Welcome to the community!

Your version is past EOL. You should upgrade to either the latest version or the current LTS at your earliest convenience. Your upgrade path is:

6.7.2 → 7.9.6 → 8.9.9 → 9.6 (last step optional)

You may find the Upgrade Guide and the LTS-to-LTS Upgrade Notes helpful. If you have questions about upgrading, feel free to open a new thread for that here.

If your error persists after upgrade, please come back to us.