# 2026-01-01

This release introduces the `@WriteTestsTo` annotation for precise control over test class naming and adds support for Mockito 5.21.0. It also resolves build issues for Gradle 9.x composite projects and simplifies partial test configuration.

***

## Framework & Build System Support

* **Gradle 9.x Support:** Resolved an issue where Diffblue Cover failed to generate tests for Gradle 9.x projects using composite builds. Projects with `includeBuild` logic are now processed correctly.
* **Mockito 5.21.0 Support:** Cover now generates tests for projects that depend on Mockito Core 5.21.0.
* **Scala Support:** Resolved a class loading issue in Scala projects using singleton objects that previously prevented test generation.

## Configuration & Control

* **Target Test Class Naming:** Cover now supports the `@WriteTestsTo` annotation, allowing you to specify the target test class name for individual source classes. This overrides the global `--class-name-template` option and requires upgrading the `cover-annotations` library to version 1.9.0.
* **Simplified Partial Test Configuration:** Cover now replaces multiple partial test options with a unified `--keep-partial-tests` CLI option and "Allow writing partial tests" Plugin setting, streamlining how incomplete tests are handled.

## Spring Support & Stability

* **Resilient Class Loading:** Resolved an issue where missing classes in unused Spring Configuration files caused `R005` errors. Cover also handles optional class dependencies more resiliently to prevent generation failures.

***

## Important Notices

### Upcoming Change: Merge Mode

In the next release, merge mode functionality will become publicly available for all supported test frameworks. This feature, which allows new tests to be merged into existing test classes, will introduce some changes to how Cover operates by default.

**What You Need to Know:**

* A command-line flag will be available to control merge mode behavior
* Users who wish to take advantage of merge mode capabilities should ensure they have upgraded their `cover-annotations` library to at least version 1.4.0, with version 1.9.0 or higher recommended for the best experience
* Documentation and migration guidance will be provided in the next release notes

This change is designed to improve test maintenance workflows, but we recognize it may impact existing automation and processes. We will provide clear guidance on configuration options in the next release.

***

## Enhancements

* Diffblue Cover now rejects the deprecated `--inline-constants` and related inlining CLI options. Additionally, the "Test Style" configuration section has been removed from the IntelliJ Plugin settings to reduce configuration complexity. \[Ref: TG-24100]
* Diffblue Cover now replaces multiple partial test options with a unified `--keep-partial-tests` CLI option and "Allow writing partial tests" Plugin setting, streamlining how incomplete tests are handled. \[Ref: TG-24099]
* CLI: Diffblue Cover now produces cleaner output for the `dcover issues --prompts` command by removing duplicate information, ensuring generated prompts are more concise for use with AI assistants. \[Ref: TG-24090]
* Diffblue Cover now generates tests for projects that depend on Mockito Core 5.21.0, updating the supported version of the popular mocking framework. \[Ref: TG-24079]
* Diffblue Cover now supports the `@WriteTestsTo` annotation, allowing developers to specify the target test class name for individual source classes. This overrides the global `--class-name-template` option and requires upgrading the `cover-annotations` library to version 1.9.0. \[Ref: TG-24058]
* CLI: Diffblue Cover now handles `R005` errors more resiliently regarding optional class dependencies. Additionally, the `dcover issues` command includes improved prompt output to better assist with resolving class loading issues. \[Ref: TG-23854]

## Resolved Issues

* Resolved an issue where Diffblue Cover failed to generate tests for Gradle 9.x projects using composite builds. Diffblue Cover now processes projects with `includeBuild` logic without encountering locking errors. \[Ref: TG-24114]
* CLI: Resolved an issue where Diffblue Cover failed to load classes in Scala projects using singleton objects, preventing test generation. \[Ref: TG-24106]
* Resolved an issue where Diffblue Cover failed to generate tests due to `R005` errors caused by missing classes in unused Spring Configuration files. \[Ref: TG-24086]
* Resolved an issue where Diffblue Cover reported `R005` errors when generating tests for projects using TestNG versions older than 6.14.3. \[Ref: TG-23848]

## Known Issues

* Plugin: Diffblue Cover incorrectly displays a menu option to write tests for existing test files. \[Ref: TG-17163]
* Using JDKs other than the supported Open JDK and Oracle JDK may produce unexpected results due to implementation differences. \[Ref: TG-19345]
* Cover may encounter an `F009` (Internal error) caused by a `ClassCircularityError` involving `org/mockito/configuration/MockitoConfiguration` when writing tests with Mockito 5. The recommended workaround is to downgrade to Mockito 4.x. \[Ref: TG-19610]
* Reports: The total line count metric in Reports only includes Java code. Kotlin code is not 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]
* 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]
* Plugin: On some displays, the Test Review subsection title 'Tests for review' is malformed. \[Ref: TG-22805]
* When test formatting settings are changed, the Test Review feature may incorrectly remove the `@ManagedByDiffblue` annotation from tests, particularly in cases involving static import formatting changes. \[Ref: TG-23750]
* Plugin: Using the Test Review feature may create tests that have incompatible dependency injection systems. \[Ref: TG-23935]


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://cover-docs-preview.diffblue.com/updates-and-upgrades/release-archive/2026-01-01.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
