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 检查是否缺少启动类