关于Unable to find a @SpringBootConfiguration错误解决方法

简介: SpringBoot项目上跑测试类,加上@SpringBootTest运行报错,其中一种错误就是未加载到启动类,导致整个启动类挂了,详情看下方内容

今天在测试程序组时,突然发现测试类跑不起来,报了一大片错误。

屏幕截图 2021-10-30 151916.png

细看整个错误,大概就是缺少启动类或未加载到启动类,导致整个程序跑不动。而且上面已经明确提醒了@SpringBootTest(classes = ...),就是让你配置启动类。既然如此我们就配置好,再跑一跑试试看

屏幕截图 2021-10-30 152408.png

先加上一个启动类,运行之

屏幕截图 2021-10-30 152425.png

成功解决问题了。其实有报错的bug都不难解决,按照错误信息分析和追查就好了。不报错的逻辑业务bug就只能看日志一行一行的分析,略显麻烦。

相关文章
|
Ubuntu Unix Linux
成功解决ERROR: Unable to find the development tool `cc` in your path; please make sure that you have the
成功解决ERROR: Unable to find the development tool `cc` in your path; please make sure that you have the
成功解决ERROR: Unable to find the development tool `cc` in your path; please make sure that you have the
|
6月前
|
Java
Unable to find @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest
Unable to find @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest
87 0
|
9月前
|
C++ Python
python安装HLL报错unable to find vcvarsall.bat
通过上述方法之一,你应该能够解决"unable to find vcvarsall.bat"的错误,并成功安装HLL或其他需要编译的Python扩展。确保在安装之前先安装了Visual C++构建工具。
92 0
|
9月前
|
前端开发 Java 微服务
Unable to find GatewayFilterFactory with name TokenRelay
Unable to find GatewayFilterFactory with name TokenRelay
|
Ubuntu Unix Linux
成功解决ERROR: Unable to find the development tool `make` in your path; please make sure that you have t
成功解决ERROR: Unable to find the development tool `make` in your path; please make sure that you have t
成功解决ERROR: Unable to find the development tool `make` in your path; please make sure that you have t