Question

I'm using Eclipse-STS + EclEmma plugin to see coverage of my code. In all my abstract util classes (with only static methods) I see 3 missed instructions (Instructions Counter report) at the class definition line:

enter image description here

No marker available at the left of the red line, so I do not know exactly what are these instructions. Maybe some constructors? What can I do to cover them?

Was it helpful?

Solution

One way I found to achieve 100% covering is to write a test method like this:

@Test
public void coverage(){
    KeyEscaper a = new KeyEscaper() {
    };
}

As soon as the issue touches only utils classes with all static methods, it's not a problem to instantiate them anonimously in such way.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top