问题描述:
java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=…) with your test

问题截图:

java.lang.IllegalStateException Unable to find a @SpringBootConfiguration错误解决方案

出现原因:
在进行单元测试时我太懒了,随便建了个test包就进行测试,导致出现这个问题
解决方案:
将包名改为与其他分支一样的路径。就可以了!
如下图:
java.lang.IllegalStateException Unable to find a @SpringBootConfiguration错误解决方案

然后再执行就可以啦,亲测有效!!
————————————————
版权声明:本文为CSDN博主「陈豆粒」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/qq_28643817/article/details/88063251

相关文章:

  • 2021-08-22
  • 2021-12-03
  • 2021-04-20
猜你喜欢
  • 2021-10-28
  • 2022-01-01
  • 2021-10-19
  • 2021-10-24
  • 2021-08-12
  • 2021-04-09
相关资源
相似解决方案