Python 官方文档:入门教程 => 点击学习
目录springRunner和SpringJUnit4ClassRunner有什么区别?这两个有什么区别?SpringRunner无法映射到SpringJUnit4ClassRunn
@RunWith(SpringRunner.class)
@RunWith(SpringJUnit4ClassRunner.class)
SpringRunner 继承了SpringJUnit4ClassRunner,没有扩展任何功能;使用前者,名字简短而已。
如果在Maven依赖中可以看到该库已经载入,必须去掉<scope>test</scope>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
</dependency>
compile(编译范围)
test(测试范围)
runntime(运行时范围)
provided(已提供范围)
system(系统范围)
scope的依赖传递
A–>B–>C。当前项目为A,A依赖于B,B依赖于C。知道B在A项目中的scope,那么怎么知道C在A中的scope呢?
答案是:
以上为个人经验,希望能给大家一个参考,也希望大家多多支持编程网。
--结束END--
本文标题: SpringRunner和SpringJUnit4ClassRunner的区别及说明
本文链接: https://www.lsjlt.com/news/211210.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-03-01
2024-03-01
2024-03-01
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0