单元测试报错:unable to find a @SpringBootConfiguration
完整异常:
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注解
解决:
包名一致
单元测试报错:unable to find a @SpringBootConfiguration的更多相关文章
- delphi调试需要管理员权限程序报错“Unable to create process:请求的操作需要提升”
delphi调试启动需要UAC权限的程序的时候会报错“Unable to create process:请求的操作需要提升”.这是因为delphi没有以管理员身份启动,这样delphi createp ...
- AS添加依赖报错Unable to merge dex
AS添加依赖报错Unable to merge dex 最近在给项目添加依赖的时候,要给项目导入Bmob的SDK,参照Bmob的官方文档,可以直接在app的build.gradle文件中添加 //Bm ...
- centos6.5环境wget报错Unable to establish SSL connection
centos6.5环境wget报错Unable to establish SSL connection [root@centossz008 src]# wget --no-check-certific ...
- linux 下通过xhost进入图形界面,经常会出现报错“unable to open display”
linux 下通过xhost进入图形界面,经常会出现报错“unable to open display” linux下的操作步骤如下: [root@localhost ~]# vncserver N ...
- git clone 报错Unable to negotiate with xxx.xxx.xxx.xxx port 12345: no matching key exchange method found. Their offer: diffie-hellman-group1-sha1
在执行git clone命令报错 Unable to negotiate with xxx.xxx.xxx.xxx port 12345: no matching key exchange metho ...
- Git clone 报错 Unable to negotiate with xxx.xxx.xxx.xxx port 12345: no matching cipher found. Their offer: aes128-cbc,3des-cbc,blowfish-cbc
git clone 报错 Unable to negotiate with xxx.xxx.xxx.xxx. port 12345: no matching cipher found. Their o ...
- C# 解决SharpSvn启动窗口报错 Unable to connect to a repository at URL 'svn://....'
在远程机打开sharpsvn客户端测试,结果报错 Svn启动窗口报错 Unable to connect to a repository at URL 'svn://...' 咋整,我在win10我的 ...
- CentOS7图形界面启动报错unable to connect to X server
以前还可以正常启动图形界面,这次启动失败,报错unable to connect to X server 使用的是oracle用户,因为我是在oracle用户下创建的oracle数据库等 解决办法: ...
- 单点登录(十一)-----遇到问题-----cas启用mongodb验证方式报错--Unable to locate Spring NamespaceHandler for XML schema na
cas启用mongodb验证方式报错--Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.sp ...
- selenium+phantomjs报错:Unable to find a free port的分析和解决
selenium+phantomjs报错:Unable to find a free port的分析和解决 Table of Contents 1. 现象 2. 分析 3. 解决办法 1 现象 在做项 ...
随机推荐
- C#面向对象三大特性:多态
什么是多态 公司最近为了陶冶情操,养了几种动物(Animal),有猫(Cat).狗(Dog).羊(Sheep),这些动物都有共同的特性,会吃(Eat).会叫(Shout),但是它们吃的不同,叫的也不同 ...
- springMVC框架在项目中的搭建
第一步:构建Web项目 第二步:导入所需jar包 第三步:配置前端控制器DispatcherServlet 第四步:编写Controller控制器(也称为Handler处理器) ...
- 查看并下载MySQL对应jar包
打开已经安装的mysql文件位置 2.查看对应connector版本并下载jar包 3.下载对应jar包:http://central.maven.org/maven2/mysql/mysql-con ...
- Java读文件夹
使用JAVA读取文件夹中的多个文件 package hx.ReadFile; import java.io.FileNotFoundException; import java.io.IOExcept ...
- 黑帽JS跳转
一.常规的JS页面跳转代码 .在原来的窗体中直接跳转用 <script type=”text/javascript”> window.location.href=”http://www.g ...
- rf 环境
googlechrome webdriver驱动下载 addrhttps://sites.google.com/a/chromium.org/chromedriver/downloads谷歌浏览器ap ...
- Message Queue的使用目的
为什么要用Message Queue 摘录自博客:http://dataunion.org/9307.html?utm_source=tuicool&utm_medium=referral ...
- php7 Memcached
PHP7 Memcached 扩展 wget https://codeload.github.com/websupport-sk/pecl-memcache/zip/php7/pecl-memcach ...
- ETCD的常用命令
Note that any key that was created using the v2 API will not be able to be queried via the v3 API. A ...
- Python结合Pywinauto 进行 Windows UI 自动化
转:Python结合Pywinauto 进行 Windows UI 自动化 https://blog.csdn.net/z_johnny/article/details/52778064 说明:Pyw ...