一般来说
@RunWith (SpringRunner.class)
@SpringBootTest
就可以进行测试了,但有多个启动类的时候就不行了,这时候要用
@RunWith (SpringRunner.class)
@SpringBootTest(classes = LyPageApplication.class) 这样写了
这个classes不是测试类的类,是@SpringBootApplication注解下的类
关于SprignBootTest使用的一些坑
最新推荐文章于 2021-08-16 19:55:09 发布