当前位置:网站首页>org.junit.runners.model.InvalidTestClassError: Invalid test class ‘com.zhj.esdemo.MysqlTests‘: 1.
org.junit.runners.model.InvalidTestClassError: Invalid test class ‘com.zhj.esdemo.MysqlTests‘: 1.
2022-07-27 20:52:00 【是七叔呀】
一、错误信息:
org.junit.runners.model.InvalidTestClassError: Invalid test class 'com.zhj.esdemo.MysqlTests':
1. Method mapperUse() should be public

二、排错与常见原因
我的单元测试类写的是这样的,@SpringBootTest注解有,@Test也有,@Autowired也有

而后仔细看这个报错信息,猜测说是MysqlTest这个起名不合法

修改了名称之后还是不行

2.1 一个@Test’方法调用了另一个@Test方法
这个博主报同样错的原因是在一个带@Test方法去调了另一个带@Test关键词的方法 就出现了该异常
解决也很简单,去掉被调用方法的@Test就好了
2.2 导包错误,org.junit.Test 才是正确的
导错包了。。。。
出现这个原因是使用了 org.junit.jupiter.api.Test
应该使用 org.junit.Test 才是正确的

边栏推荐
- Tita 的OKR系统与其他同类型产品,或者是共享文档等相比,有什么优势?
- [CVA valuation training camp] how to quickly read the annual reports of listed companies - Lesson 4
- Software test function test full set of common interview questions [function test] interview summary 4-2
- JUC工具包学习
- How to use xshell Free Edition
- js数组复制速度测试220320
- How do I shut down oracle?
- 进程同步的方式有哪些?
- 评价自动化测试优劣的隐性指标
- Bi Shi - University Logistics Management System Based on SSM
猜你喜欢

C#委托用法--控制台项目,通过委托实现事件
![[soft test software evaluator] 2014 comprehensive knowledge over the years](/img/85/46c8fc696ae5249a9aca22b50493f0.jpg)
[soft test software evaluator] 2014 comprehensive knowledge over the years

面试官:说一下网络数据传输的具体流程

The wechat installation package has expanded 575 times in 11 years, and the up owner: "98% of the documents are garbage"; Apple App store was exposed to a large number of pornographic apps; Four techn

iMeta | 国际标准刊号ISSN印刷版正式确认,双ISSN申请完成

【软考软件评测师】2014综合知识历年真题

用3dmax做折扇的思路方法与步骤

proteus仿真arduino中调用DHT11/22温湿度传感器

Www 2019 | Han: heterograph attention network

Record the errors about formatc in R language
随机推荐
史上最简明的 Tcpdump 入门指南,看这一篇就够了
消息队列常见的几种使用场景介绍
360入选中国安全产业全景图63个领域 ISC2022共话安全服务方向
Redis 哈希Hash底层数据结构
RPA流程自动化机器人是什么技术?如何实现办公自动化?
他山之石 | 蚂蚁超大规模知识图谱构建及应用
See how Gan controls the image generation style step by step? Explain the evolution process of stylegan in detail
Current situation and future of Nb IOT industry: cross the threshold of 100million shipments and rush to 5g connection!
评价自动化测试优劣的隐性指标
Record the errors about formatc in R language
Simple and practical data visualization cases
Test article
Remotely debug idea, configure remote debug, and add JVM startup parameter -xdebug in the program of remote server
【ELM分类】基于核极限学习机和极限学习机实现UCI数据集分类附matlab代码
Redis的分布式锁
2019年全球十大半导体厂商:英特尔重回第一,苹果逆势大涨
采用汇顶屏下光学指纹方案,三星Galaxy A71 5G上市
Application skills of AWS dynamodb
四次挥手的Socket交互流程
Flink怎么使用Savepoint