How to configure Intellij test coverage to work with lombok

Viewed 999

We recently added lombok to our project, however it has tanked the test coverage in Intellij, as it detects the getters/setters as not tested.

We have added the lombok.config to add the @Generated annotation, however only JaCoCo ignores them. This works for SonarQube, but using JaCoCo as the coverage runner in Intellij doesn't work as it doesn't work with powermock. The only workaround we have found so far is to modify our pom.xml to use JaCoCo offline instruments, run maven test and then import the test coverage manually, however this isn't a very clean solution.

Is there a way to get the Intellij coverage runner to ignore the @Generated annotated methods? Failing that how can we setup JaCoCo so that we can run the tests from intellij instead of having to do the maven test workaround?

0 Answers
Related