完整异常:

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的更多相关文章

  1. delphi调试需要管理员权限程序报错“Unable to create process:请求的操作需要提升”

    delphi调试启动需要UAC权限的程序的时候会报错“Unable to create process:请求的操作需要提升”.这是因为delphi没有以管理员身份启动,这样delphi createp ...

  2. AS添加依赖报错Unable to merge dex

    AS添加依赖报错Unable to merge dex 最近在给项目添加依赖的时候,要给项目导入Bmob的SDK,参照Bmob的官方文档,可以直接在app的build.gradle文件中添加 //Bm ...

  3. centos6.5环境wget报错Unable to establish SSL connection

    centos6.5环境wget报错Unable to establish SSL connection [root@centossz008 src]# wget --no-check-certific ...

  4. linux 下通过xhost进入图形界面,经常会出现报错“unable to open display”

    linux 下通过xhost进入图形界面,经常会出现报错“unable to  open display” linux下的操作步骤如下: [root@localhost ~]# vncserver N ...

  5. 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 ...

  6. 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 ...

  7. C# 解决SharpSvn启动窗口报错 Unable to connect to a repository at URL 'svn://....'

    在远程机打开sharpsvn客户端测试,结果报错 Svn启动窗口报错 Unable to connect to a repository at URL 'svn://...' 咋整,我在win10我的 ...

  8. CentOS7图形界面启动报错unable to connect to X server

    以前还可以正常启动图形界面,这次启动失败,报错unable to connect to X server 使用的是oracle用户,因为我是在oracle用户下创建的oracle数据库等 解决办法: ...

  9. 单点登录(十一)-----遇到问题-----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 ...

  10. selenium+phantomjs报错:Unable to find a free port的分析和解决

    selenium+phantomjs报错:Unable to find a free port的分析和解决 Table of Contents 1. 现象 2. 分析 3. 解决办法 1 现象 在做项 ...

随机推荐

  1. 【应急响应】Windows 安全加固

    一.补丁管理 运行cmd,输入systeminfo查看目前补丁信息 二.账户管理 gpedit.msc —>Windows设置—>安全设置—>本地设置—>账户设置 密码策略: ...

  2. flask 前端 分页 显示

    # flask 前端 分页 显示 1.分页原理 web查询大量数据并显示时有有三种方式: 从数据库中查询全部,在view/客户端筛选/分页:不能应对记录大多的情况,一般不使用: 分页查询,每次在数据库 ...

  3. SIM7600CE TCP/IP连接与PPP拨号上网 4G上网

    SIM7600CE联网测试分为两部分: 1.TCP/IP连接 2.PPP拨号上网 实验环境:ubuntu-meta 16.04 硬件:树莓派3B,SIM7600CE 上网卡:移动的NB-IOT物联网卡 ...

  4. 基于Ubuntu和基于Debian的Linux Mint 20新特性一览

    导读 Linux Mint 20 将基于 Ubuntu 20.04 LTS,同时,其 LMDE(Linux Mint Debian Edition,Debian 版本)4 也将到来,LMDE 版本基于 ...

  5. Java连载81-枚举类型,生成五个不重复的随机数,集合简介

    一.枚举类型 1.枚举类型的格式就是enum+枚举类型的名称,可见下面的例子. package com.bjpowernode.java_learning; ​ public class D81_1_ ...

  6. JavaScript - 代码片段,Snippets,Gist

    求n个数字的累加和 递归实现 function getSum(x) { if (x == 1) { return 1; } return x + getSum(x - 1); } var result ...

  7. BeautifulReport底层框架的解析以及html报告页面元素的更改

    利用BeautifulReport 模块生成html报告 import BeautifulReport as br#引入包,之后设置一下别名 br = br.BeautifulReport(test_ ...

  8. OC与JS交互

    https://www.jianshu.com/p/bb666b71e104 一.简述 目前原生与JS交互的方式有以下几种 JavaScriptCore WKWebView 拦截URL WebView ...

  9. Kubernetes的pod控制器及ReplicaSet控制器类型的pod的定义

    为什么需要Pod Kubernetes项目之所以这么做的原因: 因为Kubernetes是谷歌公司基于Borg项目做出来的,谷歌工程师发现,他们部署的应用往往存在这进程与进程组的关系.具体说呢,就是这 ...

  10. webpack-bundle-analyzer插件的使用方式

    第一步: npm install --save-dev webpack-bundle-analyzer 第二步: 在build/webpack.prod.config.js中的module.expor ...