报错信息: java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=...) with your test 解决办法:将测试类所在包路径 改成 项目启动类(springboot main方法所在类)的包路径