Could not load TestContextBootstrapper [null]
在对SpringBoot进行单元测试时,报错“Could not load TestContextBootstrapper [null]”
错误原因:
Maven的pom.xml中某些SpringBoot或Spring的依赖的版本有冲突
解决方法:
将冲突的依赖包版本修改为一致即可。
示例如下:
将SpringBoot的测试依赖包改为一致就可以了。
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>1.5.7.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-test</artifactId>
<version>1.5.7.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<version>1.5.7.RELEASE</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-test</artifactId>
<version>1.5.7.RELEASE</version>
<scope>test</scope>
</dependency> <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
</dependency> <dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>4.3.12.RELEASE</version>
</dependency> </dependencies>
Could not load TestContextBootstrapper [null]的更多相关文章
- Spring Boot单元测试报错java.lang.IllegalStateException: Could not load TestContextBootstrapper [null]
1 报错描述 java.lang.IllegalStateException: Could not load TestContextBootstrapper [null]. Specify @Boot ...
- java.lang.IllegalStateException: Could not load TestContextBootstrapper [null]. Specify @BootstrapWith's 'value' attribute or make the default bootstrapper class available.
1.前几天搭建单元测后,今天用其测试,结果报了这个问题.网上搜索后,刚开始以为原因是 Spring的 依赖版本的问题,我现在的依赖是: 因为其他的比如说 spring-content spring ...
- 力扣 报错 runtime error: load of null pointer of type 'const int'
runtime error: load of null pointer of type 'const int' 要求返回的是int* 解决方案 1.指针使用malloc分配空间 用 int * p = ...
- [踩坑记录] runtime error: load of null pointer of type 'const int' (leetcode)
leetcode上面做题遇到的错误 原因: 在调用函数时,如果返回值如果是一个常量则没问题.如果返回值若为指针则可能会出现该错误,假如返回的指针地址指向函数内的局部变量,在函数退出时,该变量的存储空间 ...
- junit4 javaee 5.0 jpa SSH 单元测试问题集锦
本篇文章基于已经实现了ssh集成的demo.项目.具体的ssh项目怎么配置,请参考本文最后 spring环境下的JUnit4测试 1,下载所需jar包: spring-test-3.2.0.RELEA ...
- spring整合redis(jedis)
真是一步一个坑阿,学点新技术,这么难,这个异常: java.lang.IllegalStateException: Could not load TestContextBootstrapper [nu ...
- Ext中Grid重新load设置URL
一.前言 Extjs中grid网格有时候需要重新加载,加载的时候对应不同的URL,什么情况出现:有需要我们在添加附件的时候,添加完成了附件,需要把另一个show添加的数据重新加载到grid中,而 ...
- mysql 变量is null 和 not exists区别
问题: 使用游标遍历时,发现使用 select var into tmp where var=? 然后判断if tmp is null时,不能走完所有的遍历.经debug发现, 当var为空时,则跳出 ...
- MySQL :: MySQL 8.0 Reference Manual :: B.6.4.3 Problems with NULL Values https://dev.mysql.com/doc/refman/8.0/en/problems-with-null.html
MySQL :: MySQL 8.0 Reference Manual :: B.6.4.3 Problems with NULL Values https://dev.mysql.com/doc/r ...
随机推荐
- Maven入门-1.介绍及搭建开发环境
1.介绍1.1 Maven和Ant的比较?2.搭建Maven开发环境2.1 配置环境变量2.2 测试安装是否成功2.3 配置Maven的本地仓库位置3.Maven的约定4.Maven项目类型5.Mav ...
- 使用java.net.URLConnection发送http请求
首先,这个需要一点HTTP基础,可以先看个书了解下,我看的<http权威指南>的前4章,后面道行不够看不下去. 然后我们的是java.net的接口: 几个类的API: package co ...
- 浅谈SQL Server---1
浅谈SQL Server优化要点 https://www.cnblogs.com/wangjiming/p/10123887.html 1.SQL Server 体系结构由哪几部分组成? 2.SQL ...
- Struts2中StrutsRequestWrapper类
该类可获取一些请求地址,在自定义struts2标签时用到 //获取值栈 Map cont= this.getStack().getContext(); StrutsRequestWrapper req ...
- Struts2自定义标签3模仿原有的s:if s:elseif s:else自定义自己的if elsif else
第一步:webroot/web-inf下简历str.tld文件 <?xml version="1.0" encoding="UTF-8"?> < ...
- A*专题训练
POJ2449 Remmarguts' Date UDF's capital consists of N stations. The hall is numbered S, while the sta ...
- python urllib2 error handling
python 2 里面的下载实现. https://stackoverflow.com/questions/666022/what-errors-exceptions-do-i-need-to-han ...
- QLoo graphql engine 学习一 基本试用(docker&&docker-compose)
说明:使用docker-compose 进行安装 代码框架 使用命令行工具创建 qlooctl install docker qloo-docker 运行qloo&&gloo 启动 ...
- sql server 多行合并一行
1. 使用函数 go CREATE FUNCTION dbo.fn_Sumtype(@type varchar(50))RETURNS varchar(8000)ASBEGIN DECLARE @va ...
- 项目管理软件选择:redmine or JIRA
个人理解,这两款软件从本质上说是issue tracking,而不是项目管理. 先说些个人的想法 1)从现阶段情况看,都是够用的,毕竟本来就是小团队 2)从扩展而言,根据现在团队的实际情况(基本都是搞 ...