Test classes location

If a test source directory exists in the current IntelliJ module, Diffblue Cover will insert it there. Otherwise it will explore the modules in the project which depend on the module for which a test is generated. If any dependent module contains a test source directory, Cover will put the generated test class there. If no existing test source directory could be found in any dependent project, Cover will generate a new test sources directory. It will be created in the path src/test/java in the same module as the class for which tests are generated. The only exception to this case is if the module is named in a fashion that suggests a different project hierarchy (e.g. main), in which case the test source directory is created in the project root as src/test/java.

Please note that in the final case described above the created test class may not compile, as Diffblue Cover does not create new modules and the existing root module may not have a dependency on the module in which the class under test is located. We recommend to always explicitly create a test source directory in the module or one of its dependent modules such that Cover knows where to put new test classes.

results matching ""

    No results matching ""