Eclipse No tests found using JUnit 5 caused by NoClassDefFoundError for LauncherFactory

You ran into Eclipse bug 525948 which has already been fixed and which will be published in the upcoming release Oxygen.3 (4.7.3), March 21, 2018. As workaround, put your test code in a separate project and add the project under test to the modulepath, but do not add a module-info.java to your test project. With your project, class and module naming, … Read more

How do I test a class that has private methods, fields or inner classes?

Update: Some 10 years later perhaps the best way to test a private method, or any inaccessible member, is via @Jailbreak from the Manifold framework. @Jailbreak Foo foo = new Foo(); // Direct, *type-safe* access to *all* foo’s members foo.privateMethod(x, y, z); foo.privateField = value; This way your code remains type-safe and readable. No design compromises, no overexposing methods … Read more

What is the proper annotation since @SpringApplicationConfiguration, @WebIntegration, is deprecated in Spring Boot Framework?

Take a look into JavaDocs of deprecated classes: * @deprecated as of 1.4 in favor of * {@link org.springframework.boot.test.context.SpringBootTest} with * {@code webEnvironment=RANDOM_PORT} or {@code webEnvironment=DEFINED_PORT}. */ … @Deprecated public @interface WebIntegrationTest { * @deprecated as of 1.4 in favor of {@link SpringBootTest} or direct use of * {@link SpringBootContextLoader}. */ … @Deprecated public @interface … Read more