I am experiencing a strange behavior of Intellij IDEA 2016.3. Having a class with method foo
and a JUnit test for the method when I get java.lang.Exceptio
Since you got your answer and for others searching for solution,
Look if your test class is extending TestCase abstract class which is a JUnit 3 related. In order to fix this you have to start your method name with "test".
For example public void testFoo()
.
If JUnit 3 is not the case, you're missing @Test
annotation from your JUnit 4 test method.
Note: If you're extending from TestCase and test methods are annotated with @Test
and also your methods' names start with "test", then probably you're mixing JUnit 3 with JUnit 4. Don't do that. It will lead to other errors such as methods that annotated with @Ignore
will not be ignored if those methods' names start with "test".