
1、问题
使用spring-boot执行测试时报错:
java.lang.IllegalStateException: Unable to find a
@SpringBootConfiguration, you need to use @ContextConfiguration or
@SpringBootTest(classes=…) with your test
**>
2、解决方案**
将测试类的包名修改与启动类的包名相同
例如:
测试类
springboot启动类
2.1 检查是否缺少启动类
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)