[Java] Coverage report could not be created with the combination of default method of Cobertura + interface

It's just the title ... I wasted my time and had a disappointing experience, so I would like to share it.

Cobertura's coverage report generation got an error on the way.

While researching various things, ・ Development of Cobertura stopped a long time ago ・ Lambda expression cannot be tracked I found the information.

The source did not use a lambda expression, but it used the default method of interface, so I tried changing it to a different implementation method and it worked.

I spent a few hours noticing this ...


Reference link
Coverage tool Cobertura has stopped development Code not tracked by Cobertura

Today's lesson. ** If you use Cobertura, don't use the features added since Java 8. ** **

Recommended Posts

[Java] Coverage report could not be created with the combination of default method of Cobertura + interface
Are you using the default method of the interface properly?
Traps brought about by the default implementation of the Java 8 interface
Be sure to compare the result of Java compareTo with 0
The story of stopping because the rails test could not be done
The story that the Servlet could not be loaded in the Java Web application
Increment with the third argument of iterate method of Stream class added from Java9
I didn't know that inner classes could be defined in the [Java] interface
The order of Java method modifiers is fixed
[Java] Be careful of the key type of Map
Calculate the similarity score of strings with JAVA
Specify the default value with @Builder of Lombok
Arguments with default values Take the full_title method of the Rails tutorial as an example
Solved the problem that the test could not be executed from the command line with spring-boot-starter-test
The story that the variable initialization method called in the Java constructor should not be overridden