Cover Annotations

Cover Annotations allow users to annotate their Java codebase with advice on how best to test it. In turn this can be used by Diffblue Cover to tune the tests it writes.

Installation

Cover Annotations are available as a simple dependency available via Maven Central and are licensed under Apache License 2.0.

In order to use the annotations in your Maven project then the Diffblue repository and cover-annotations dependency will need to be added into your pom.xml:

<dependencies>
    <dependency>
        <groupId>com.diffblue.cover</groupId>
        <artifactId>cover-annotations</artifactId>
        <version>1.1.0</version>
    </dependency>
</dependencies>

Annotations placed on packages affect tests for all classes and methods under test in that package. Annotations placed on classes affect tests for that class and all its methods under test, overriding package level annotations. Annotations placed on methods affect just that method under test, overriding package and class level annotations.

The annotations will be respected by Diffblue Cover via both command line and IntelliJ Plugin. When used from the command line in conjunction with equivalent options then the command line options take priority over the annotations found.

Last updated