错误再现
在SpringBoot项目手写测试类时报错:java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=...) with your test,如下所示:
解决方案
-
1、编写启动类
-
2、启动类和测试类所在的包名要相同
java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @Context
阅读 71
2022-10-25
在SpringBoot项目手写测试类时报错:java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=...) with your test,如下所示:
1、编写启动类
2、启动类和测试类所在的包名要相同
相关推荐
精彩评论(0)