Spring 测试运行的时候提示 Unable to find a @SpringBootConfiguration 错误
Spring 进行测试的时候提示的错误信息如下:
SEVERE: Caught exception while closing extension context: org.junit.jupiter.engine.descriptor.JupiterEngineExtensionContext@c63c11ed
java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=...) with your test
问题和解决
这个问题的主要原因是测试的包和项目的包的路径可能不一致。
这将会导致测试没有办法找到有关 Spring 有关的配置。
对比上面的图,我们就可以看到这个问题。
解决方法就是确定包的路径是一致的,这样 Spring 的测试类可以找到 Spring 有关的配置。
Spring 测试运行的时候提示 Unable to find a @SpringBootConfiguration 错误 - Spring - OSSEZ
Spring 测试运行的时候提示 Unable to find a @SpringBootConfiguration 错误相关推荐
- java.lang.IllegalStateException Unable to find a @SpringBootConfiguration错误解决方案(亲测)
问题描述: java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @C ...
- Spring Boot——[java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration]解决方案
问题描述 问题分析 没在根目录下写一个Spring Boot的启动类. 解决方案 方案一:Class 在根目录下写一个Spring Boot的启动类. 方案二:注解 需要在注解上加上 @Spring ...
- myeclipse中配置spring xml自己主动提示
版权声明: https://blog.csdn.net/zdp072/article/details/24582173 这是一篇分享技巧的文章:myeclipse中配置spring xml自己主动提示 ...
- Android之Dialog提示Unable to add window -- token is not valid; is your activity running?
1.问题 Dialog奔溃提示Unable to add window -- token android.os.BinderProxy@b251dbc is not valid; is your ac ...
- Spring包名代码提示
Spring包名代码提示 首先添加spring约束(原文https://blog.csdn.net/leisure_life/article/details/68483531) 添加了约束,却还没有绑 ...
- Spring配置XML本地提示:点击eclipse属性——选择XML Catalog
Spring配置XML本地提示:点击eclipse属性-->选择XML Catalog
- Android Studio提示unable to find valid certification的解决办法
此篇总结的解决方案有些过时,请移步我的另一篇博文,将为大家带来最新的解决方案:AndroidStudio构建项目提示"unable to find valid certification&q ...
- 【无法打开ENVI错误提示Unable to license IDL Runtime的解决方法】
打开ENVI提示Unable to license IDL Runtime的解决方法 打开ENVI提示Unable to license IDL Runtime 解决方法 1. 找到Harris Li ...
- [Domino]从嵌入另一个数据库嵌入的Embedded View无法正常显示,提示unable to lauch
发现问题 1. 项目中需要在一个数据库中插入另一个数据库的Embedded View,使用起来十分费劲,在选择数据库的下拉菜单中经常会找不到目标数据库: 2. 在做日文版的时候,从workbench导 ...
最新文章
- 【Swift】 GETPOST请求 网络缓存的简单处理
- 2021 OceanBase 数据库大赛来了!
- jq 读取office插件_800+页麦肯锡经典图示发送!让你不用插件,轻松搞定逻辑图...
- elastic的gc相关
- 纠错--跟我学Java第44页
- 【运筹学】线性规划数学模型 ( 三要素 | 一般形式 | 向量形式 | 矩阵形式 )
- Kafka Connect在MapR上
- Python基础篇:某宝一键秒杀,毫秒级的精准度
- 实用分享-免费录屏工具(无水印)
- activiti 设置候选人_中标 | 河南移动公示无源波分复用设备集采中标候选人名单:3家厂商上榜...
- multisim10元件库介绍
- 银联支付之在线网关支付
- 最大流问题与Ford-Fulkerson算法介绍
- HRESULT:0x80029C4A错误
- 各平均数介绍(算数平均数、几何平均数、加权算术平均数)
- Flutter 项目实战 网络请求MD5+时间戳+验证签名 十一
- MXNet -aws深度学习框架之选择
- SQL查找时间记录最近一条
- A40I工控主板(SBC-X40I)网络接口测试
- Android项目实战——一个简单的记事本程序