Class Not Found: Empty Test Suite in IntelliJ

I had the same issue. I rebuilded project, and it helped me.

Go to Build --> Rebuild Project

After then, if you are using Maven tool, I recommend use option Reimport All Maven Projects


If it not help, try another possible solutions:

  • Go to File-->Invalidate Caches/Restart--> Invalidate and Restart

or:

  • In your Maven project structure src/main/java right click on java directory and select option Mark directory as --> Sources Root

    Similarly do the same with test directory so: src/test/java right click on java directory and select option Mark directory as --> Test Sources Root

or:

  • Go to Run --> Edit Configurations and in section JUnit remove test configurations. Apply changes. After then try to run your tests. New configuration should be created automatically.

or:

  • Go to File --> Project Structure, select Modules, then select your proper module and go to the Paths tab.
    Check options:
    Radio button Use module compile output path should be selected.

    Output path should be inside your project. Also Test output path should be directory inside your project. For example it can look similarly:
    Output path: C:\path\to\your\module\yourModule \target\classes
    Test Output path: C:\path\to\your\module\yourModule \target\test-classes

    Exclude output paths should be deselected.

Had the same message. I had to remove the Run/Debug configuration.

In my case, I ran the unit test as a local test before. After that I moved my test to the androidTest package and tried to run it again. Android Studio remembered the last run configuration so it tried to run it again as a local unit test which produced the same error.

After removing the config and running the test again it generated a new configuration and worked.

enter image description here


I went to

File -> Invalidate Caches/Restart...

and then it worked for me.