SpringBoot自动创建后,test 中没有 @RunWith(SpringRunner.class)注解。
@SpringBootTest
class Chapter2ApplicationTests {
@Test
void contextLoads() {
}
}
解决方法:在pom.xml中添加 junit 依赖
junit junittest

SpringBoot自动创建后,test 中没有 @RunWith(SpringRunner.class)注解。
@SpringBootTest
class Chapter2ApplicationTests {
@Test
void contextLoads() {
}
}
解决方法:在pom.xml中添加 junit 依赖
junit junittest