2024-10-01

This release introduces the ability to disable Spring Boot dependency injection (@MockBean) in favor of other dependency injection mechanisms, such as Mockito's @InjectMocks and @Mock. To disable Spring Boot dependency injection, uncheck the 'Use Spring Boot to write tests' option in the plugin settings or pass the --no-spring-boot-tests option to the CLI. This feature can be beneficial when the unit test suite does not require loading a Spring context.

Important Notices

Changes to Default Settings

  • Descriptive Test Naming: In a future release, Cover will default to writing tests which use descriptive Given-When-Then-style names. For more details on Descriptive Test Naming (beta), please refer to the IntelliJ Plugin documentation or the Cover CLI documentation.

Enhancements

  • Cover now supports JUnit Jupiter 5.11.1. [Ref: TG-22087]

  • Cover now writes tests which assert on Iterator objects. [Ref: TG-22079]

  • Cover now supports Maven 3.9.9. [Ref: TG-22039]

  • CLI: Cover now provides the ability to specify which modules to run CLI commands on via the --include-modules option or DIFFBLUE_INCLUDE_MODULES environment variable. [Ref: TG-22019]

  • Cover now provides improved messaging related to interactions with the project's build system. [Ref: TG-21996]

  • Reports: Metric labels have been adjusted to be more consistent and accurate. [Ref: TG-21710]

  • Reports: Improved overview cards, providing new metrics for manual test count, total lines of code, covered and uncovered lines. [Ref: TG-21708]

  • Reports: Updated logo and color scheme. [Ref: TG-21700]

  • Cover now provides an option to disable Spring Boot dependency injection (@MockBean) in favor of other dependency injection mechanisms, such as Mockito's @InjectMocks and @Mock. [Ref: TG-21467]

  • CLI & Reports: Cover now provides improved remediation advice when a JaCoCo report cannot be produced to due non-compiling tests. [Ref: TG-19166]

Resolved Issues

  • Resolved an issue which caused Cover to produce broken Javadoc links to default constructors with Descriptive Test Naming enabled. [Ref: TG-22012]

  • Resolved an issue which, in some circumstances, caused Cover to write tests which assert on an internal PrintWriter object. [Ref: TG-21959]

  • Resolved an issue which caused Cover to report F009 (Internal Error) when it failed to create a Spring context due to missing Spring beans. [Ref: TG-21931]

Known Issues

  • Plugin: Cover incorrectly provides a menu option to write tests for a test file. [Ref: TG-17163]

  • Cover supports Open JDK and Oracle JDK; results with other JDKs may differ due to the variability in their implementations of Java. [Ref: TG-19345]

  • Cover may encounter an F009: Internal error while writing tests using Mockito 5. To avoid this issue use an earlier version of Mockito. [Ref: TG-19610]

  • Reports: Cover only counts Java code towards the total line count metrics. Kotlin code is not currently included. [Ref: TG-22088]

  • Reports: Total lines of code metric can incorrectly count a multi-line comment at the end of a line of code, resulting in fewer than expected lines counted. [Ref: TG-22089]

  • Reports: Following an upgrade, the 'Total Lines of Code' card may show 0 until a new reports bundle has been uploaded. [Ref: TG-22094]

  • In some circumstances, Cover may write more simplistic tests with less meaningful assertions when Spring Boot dependency injection is disabled. [Ref: TG-22102]

  • In some circumstances, Cover will still write Spring Boot tests when Spring Boot dependency injection is disabled. [Ref: TG-22103]

  • Cover may write failing TestNG tests when Spring Boot dependency injection is disabled. [Ref: TG-22107]

Last updated