Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=…) with your test 错误信息如下 当我们用SpringBoot整合junit时候注意test中的包名和启动入口报名一致 这是测试类 这是启动类 注意两者报名应该一致 都应该改成一样的包名,程序就可以正常运行了