2025-04-01
This release of Diffblue Cover focuses on enhancing test generation for modern Java frameworks, improving command-line interface (CLI) efficiency and configuration options, and increasing plugin usability.
Framework Support & Test Generation: Added test generation for Guice
AbstractModules
and uses@MockitoBean
forspring-test
6.2.0 or newer. New fields are now inserted alphabetically.CLI Efficiency & Configuration: The CLI now supports targeted restarts via
--resume-from-module
and allows constant field values (e.g., enums) inDiffblueRules.yml
.Plugin Usability: Resolved an issue causing potential loss of edits during Test Review in the Plugin.
Enhancements
CLI & Plugin: When writing Spring Boot tests, Diffblue Cover now defaults to
@MockitoBean
if spring-test version 6.2.0 or newer is detected in the project. [Ref: TG-22890]CLI: Diffblue Cover now supports targeted restarts with the
--resume-from-module
option. This allows for more efficient test generation by starting from a specific module. [Ref: TG-22889]Plugin: Resolved an issue where Diffblue Cover’s Test Review feature could lose edits. This ensures that changes made to tests are maintained throughout the review process for a given method. [Ref: TG-22844]
CLI & Plugin: Diffblue Cover now inserts new fields alphabetically by name within generated test classes. Previously, new fields were appended to the end. This improves test class organization. [Ref: TG-22761]
CLI: Diffblue Cover now supports constant field values in
DiffblueRules.yml
. This new "field rule type" allows specifying static final fields, including enum constants, as custom inputs. [Ref: TG-22745]CLI & Plugin: Diffblue Cover now generates unit tests for code that utilizes Guice AbstractModules. This enables test writing for projects employing this specific Guice dependency injection pattern. [Ref: TG-22156]
Resolved Issues
CLI & Plugin: Resolved an issue which caused Diffblue Cover to write assertions for Mockito generated classes. This prevents compilation errors and test removal. [Ref: TG-22884]
CLI: Resolved an issue where Cover generated duplicate and non-descriptive tests for Jersey 2 code. The fix restores the generation of informative test names and Javadoc comments, enhancing test understanding and debugging. [Ref: TG-22878]
CLI: Resolved an incorrect recommendation for Cover Annotations on Gradle projects. Cover now recommends
compileOnly
ANDtestImplementation
for the correct dependency configuration. [Ref: TG-22877]
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]
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]
When using Gradle, Junit 5 tests produced with the
@DisplayName
annotation may cause all the Diffblue tests to be removed from the class in validation [Ref: TG-22784]Plugin: On some displays, the Test Review subsection title "Tests for review" can be malformed. [Ref: TG-22805]
Cover does not currently support Java 24. Please switch your JDK version to 21 or lower. [Ref: TG-22920]
Last updated
Was this helpful?