After importing my project into Intellij and getting it to build successfully, I am trying to run some of my project's tests. I navigate to the test file and select Run -> Run. However, this does not run my tests, just opens a small "Edit Configurations" window, as the attached photo shows.
And, when I select Edit Configurations as prompted, JUnit is not to be found. The window is shown below.
What do I need to do to run the tests?
Check in Project settings -> Modules that you test package is marked as Tests. Right click on the test class name either in the code window or in the project panel, and select Run <classname>. If you don't see the run menu in the popup then you haven't selected a test or you don't have junit plugin installed.
Try right-clicking within the file that contains a main method, and click "Run CLASSNAME. main()". That should generate a run configuration for the file that will let you use the green play button.
makre sure you IDEA have installed the Junit plugins and Junit jar in your classpath:
and then just click this place to run test case:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With