Is there a way to exclude code from inclusion into Cobertura coverage reports? We have some methods that should not be included in the coverage report and therefore not driv
Since 2.0 you can write your own @CoverageIgnore
annotation.
It will be recognized by Cobertura, which will avoid considering annotated methods (does not work on classes as far as I know).
public @interface CoverageIgnore {}
public class SomeClass {
@CoverageIgnore
public void foo(String baz) {
// useless stuff
}
}
Source: https://github.com/cobertura/cobertura/wiki/Coverage-Annotations