SpringBoot自动创建后没有@RunWith(SpringRunner.class)注解

SpringBoot自动创建后,test 中没有 @RunWith(SpringRunner.class)注解。

@SpringBootTest
class Chapter2ApplicationTests {
    @Test
    void contextLoads() {
    }
}

解决方法:在pom.xml中添加 junit 依赖


           junit
           junit
           test

你可能感兴趣的:(spring,boot,spring,java)