Q: The code coverage, in our sonarlint server, for my microservice is very low. In some classes the code coverage is kept to 0% even if I am 100% sure my test cases have covered all the code(when I run it locally in IntelliJ it is 100% code coverage, it should not have such a big gap.)
A: According to https://github.com/powermock/powermock/issues/422 it seems like Jacoco is not very friend with PowerMock. Unfortunately my test cases are using PowerMock (since I can test private method through Powermock)
After switch from Powermock to Mockito, my problem fixed.
Advertisements