I know this question is pretty general but I haven\'t found any hints on why this error may show up. What are possible causes of seeing initalizationError in Eclips
For me, it was due to the "return type" of the test method. It should be "void"
For me it was a silly mistake. I inadvertently set the test as private instead of public:
@Test
private void thisTestWasCausingProblems() {
...
}
it should have been
@Test
public void thisTestIsOK() {
...
}
My problem was that my parent class had no @Test
methodes. I used there only some utilities. When I declared it abstract
it works.
If you're using the xtend language (or some other JVM lang with type inference) and haven't explicitly defined the return type then it may be set to a non-void type because of the last expression, which will make JUnit fail.
I had the same problem, the solution for me is the following.
I had only install the junit.jar file from the web, but this library related with the hacrest-core.jar When I downloaded the hacrest-core.jar file and added it in my project everything works fine.
Just if this helps, I was using Junit5 but the @RunWith(SpringRunner.class) was pointing towards import org.springframework.test.context.junit4.SpringRunner, which was messing around with things and hence was giving the initialization error. I fixed this and it worked.