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 ...
随机推荐
- 实现react中的自动保存--定时任务
1. 定义和用法 setInterval() 方法可按照指定的周期(以毫秒计)来调用函数或计算表达式. setInterval() 方法会不停地调用函数,直到 clearInterval() 被调用或 ...
- 转 关于nvcc fatal : Value 'sm_20' is not defined for option 'gpu-architecture'的问题
原文地址: https://blog.csdn.net/Mao_Jonah/article/details/78965827 关于nvcc fatal : Value ‘sm_20’ is not d ...
- vue.js中引入图片
vue中引入图片 前言:vue中引入图片时,会显示不出来,除非在css中引入.而在template中或者js动态引入时,会显示不出图片. 解决一 图片通过后端返回引入网络图片路径即可. <div ...
- Spinner的用法
1.先自定义一个数组 2.在new一个ArrayAdapter方法: ArrayAdapter<String> adapter = new ArrayAdapter<String&g ...
- POJ3696 The Luckiest number
题意 Language:Default The Luckiest number Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 7 ...
- django创建第一个项目helloworld
环境:centos 7,已安装python 3.6环境 1.安装django并创建django第一个项目 1.1.使用pip安装django# pip install Django或指定安装版本# p ...
- nginx防盗链配置
Ps:防盗链的意义就是保证自己的版权,不免网站的流量流失,为他人做嫁衣.下面是网上看到的三种方法: 修改 /usr/local/nginx/conf/nginx.conf 这个配置文件.找到locat ...
- 解决yum 不能更新问题 :yum 报错Loaded plugins: fastestmirror, refresh-packagekit, security
2018-07-02 21:43:13 Yum报错 [root@db yum.repos.d]# yum makecache Loaded plugins: fastestmirror, ...
- mysql/oracle ip地址比较
SELECT hub_gid FROM CPP_HUB_IPSEGMENT WHERE IpToLong(#{ip}) BETWEEN IpToLong(ip_begin) AND IpToLong( ...
- 第 0 课 Golang环境搭建
1 下载 https://studygolang.com/dl 2 安装完成后,查看环境变量 GOBIN 存放可执行文件的目录的绝对路径. GOPATH 工作区目录的绝对路径.存放远源码的路径 ...