I recently ran into the "empty test suite" problem. After checking several similar questions and answers and my problem, I can conclude that the problem arises due to an error preventing the addition of tests to the test package, for example, to an error during static initialization.
For example, I use the popular approach to add all tests, as shown below, but this is the same scenario with different approaches for adding test cases to the package:
public class FullTestSuite extends TestSuite { public static Test suite() { return new TestSuiteBuilder(FullTestSuite.class) .includeAllPackagesUnderHere().build(); } public FullTestSuite() { super(); } }
And, apparently, my test file had a problem in the static block {}, which prevented the successful execution of .includeAllPackagesUnderHere ().
So, I suggest to everyone who encounters this error, first check the application logs to see if your test is running in a problem that prevents adding test cases to the test suite (for example, similar examples of incorrect constructor, called, or static initialization problems) .
source share