【无法加载TestContextBootstrapper [null]。 】 | IT修真院·坑乎
咨询电话 : 010-59478634
切换导航
首页
我的提问
我的回答
我的点赞
消息通知
个人主页
×
提示
尚未登陆,前往官网登陆?
×
提示
尚未登陆,前往官网登陆?
无法加载TestContextBootstrapper [null]。
我也踩过这个坑(
1
)
已统计您的踩坑,无需重复点击
回答(1)
详细描述
创建服务层测试类时使用到了以下代码,运行时报错无法加载TestContextBootstrapper [null]。指定@BootstrapWith的'value'属性,或者使默认的bootstrapper类可用。
@RunWith(SpringJUnit4ClassRunner.class)//让测试运行于Spring运行环境中 @ContextConfiguration("classpath:applicationContext.xml")//用来指定加载的Spring配置文件的位置,再默认的配置文件 public class TestService { @Autowired private StudentMapper studentMapper;//注解注入接口 Student s=new Student(); @Test public void add(){
错误截图
错误截图
编辑于2025-04-19
时间排序
热门排序
[无名弟子]JAVA-程政皓
0
怀疑是依赖的问题,更换为之前练习的Mybatis依赖。
依赖包太多,没能排查到哪个依赖是解决配置文件的这个问题
查看全部>
编辑于2019-06-21
首页
1
末页
去第
页
确定
Copyright ©2015 北京葡萄藤信息技术有限公司 All Rights Reserved | 京ICP备15035574号-1
复制链接
新浪微博
微信扫一扫
3521
0
10
无法加载TestContextBootstrapper [null]。
1
1