I have a Springboot, java, maven project. Here are the version - java - 1.8; Junit- 4; SpringBoot version- 2.1.6-RELEASE
There is this TestClass. PFA the code -
@RunWith(SpringRunner.class)
@SpringBootTest
public class TestClass {
@BeforeMethod
public void setUp() {
// code
}
@Test
public void testMethod() throws ExecutionException {
// Test method
}
static abstract class class1 {
// code
}
static abstract class class2 {
// code
}
}
When I run this as JUnit, I get the following error message -
java.lang.Exception: No runnable methods
at org.junit.runners.BlockJUnit4ClassRunner.validateInstanceMethods(BlockJUnit4ClassRunner.java:191)
at org.junit.runners.BlockJUnit4ClassRunner.collectInitializationErrors(BlockJUnit4ClassRunner.java:128)
at org.junit.runners.ParentRunner.validate(ParentRunner.java:416)
at org.junit.runners.ParentRunner.<init>(ParentRunner.java:84)
at org.junit.runners.BlockJUnit4ClassRunner.<init>(BlockJUnit4ClassRunner.java:65)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.<init>(SpringJUnit4ClassRunner.java:137)
Can someone please suggest what am I doing wrong here?