Failed to load ApplicationContext
来源:3-1 开发环境搭建

闫之有理
2019-08-14
运行单元测试的时候报错如下:
java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=…) with your test
加入 @SpringBootTest(classes = Application.class)之后报错如下:
java.lang.IllegalStateException: Failed to load ApplicationContext
写回答
1回答
-
@SpringBootTest里面是不用加内容的。你可以检查jdk、springboot版本。还可以用我给的源码运行。对比。那我还解决不了。你把项目代码push到git(github, 慕课网git都行),发我链接,我这边运行看看。
042019-08-16
相似问题