The unit test files generated under the gradle multi-module project are in the wrong location.

The project has two modules,I generate unit tests for HomeService,but in demo-app 's test cases,How to solve it?

Hi @jamie

This could be due to your test resource folders marked incorrectly.
You can either directly mark the desired directory as the test directory by right clicking on the desired test directory > Mark directory > Test Sources Root (see below)

Alternatively, you can set this up for the project in the Project Structure settings, the Test Source Root should be src/test/java - to see this; click File > Project Structure > Modules > Sources

Let us know how this goes, or if you have any further questions don’t hesitate to ask

Kind regards,

Jane @ Diffblue

1 Like


@Jane_Walls Thanks! The method you said is very useful !

  1. First, the original folder is excluded from marking the root of the test resource.
  2. Then mark the right test directory as a test resource

But it is better to mark in the gradle configuration, see

Thanks @jamie for the feedback!
I’m glad you got this working.

Kind regards,
Jane @ Diffblue