Test Naming
By default, test classes created by Diffblue Cover are named <CLASS_NAME>DiffblueTest
and test methods are named test<INNER_CLASS_NAME><UNIT_NAME>
. To change the naming, go to Diffblue > Change Settings
in IntelliJ and update the Test Naming
section as needed (using string literals and replacements).
Class name template
Description: Used to define the test class naming convention for tests written by Diffblue Cover. The ${CLASS_NAME}
variable will be substituted with the name of the class under test.
Default: ${CLASS_NAME}DiffblueTest
Example: ${CLASS_NAME}CreatedTest
Method name template
Description: Used to define the test method naming convention for tests written by Diffblue Cover. The following variables can be used:
${INNER_CLASS_NAME}
- substituted with the name of the inner class for the method under test. If there's no inner class this will be an empty string.${UNIT_NAME}
- usually substituted with the name of the method under test. Where the unit under test comprises multiple methods (getters and setters, equals and hash code) the more general unit under test name is used.${METHOD_NAME}
- substituted with the name of the first method under test, typically the only method under test.Use
${UNIT_NAME}
or${METHOD_NAME}
to include the method name in the test name, but to avoid duplication don't use both together.
Default: test${INNER_CLASS_NAME}${UNIT_NAME}
Example: aitest${INNER_CLASS_NAME}${UNIT_NAME}
Disambiguation
Disambiguation between tests of the same name is performed automatically using sequential numbering:
Last updated