简体   繁体   中英

How do you command IntelliJ to create corresponding JUnit tests in a “Tests” directory that mirrors your project structure?

I moved to JUnit 5 and now IntelliJ only gives me the option to create tests in the same directory as my classes. This is not good. Why this is a readily available option some programmers use eludes me, as choosing such an option would seem to lead to garbled code.

I would like all the tests to be created automatically into a corresponding directory that mirrors my project.

From the comment that helped the OP. Adding it here as an answer as it could help others for various reasons.

Check the following link and see if it helps. The ide allows you to mark the directory you want to be identified as the test folder. Generated Test Sources Root

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM