Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=...) with your test
无法找到@SpringBootConfiguration,您需要在测试中使用@ContextConfiguration或@SpringBootTest(classes=…)

问题产生的几种情况:

1.启动类 或者 程序入口类的包名和测试类所在包名不一致
例如:
启动类:com.leyou下的启动类
测试类:com.leyou.test下的测试类,“.test”多余

2.程序入口类忘了添加:SpringBootApplication注解

解决:

包名一致

相关文章:

  • 2021-05-12
  • 2021-05-06
  • 2021-08-14
  • 2021-10-10
  • 2021-10-28
  • 2021-08-16
  • 2021-10-24
猜你喜欢
  • 2021-04-12
  • 2021-08-22
  • 2021-08-12
  • 2021-10-23
  • 2022-12-23
  • 2021-08-18
  • 2022-12-23
相关资源
相似解决方案