Spring 2.4.0 的测试引擎 junit-vintage

从 Spring Boot 2.4.0 的测试引擎已经使用 Junit 5 的测试了。

因此测试引擎不再需要 exclude junit-vintage 到 Spring Boot 的测试依赖了。

2.4.0 的测试实例应该使用下面的依赖配置:

        <!-- TESTS -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <scope>test</scope>
        </dependency>

这个问题在 2.3.3 的版本出现了上面的问题,有关这个问题的描述和解决方法,请参考:JUnit 5 测试 Spring 引擎的时候提示 junit-vintage 错误

中的内容。

 

 

测试引擎 junit-vintage 主要是版本兼容性的问题。

 

https://www.ossez.com/t/spring-2-4-0-junit-vintage/13243

posted @   huyuchengus  阅读(119)  评论(0编辑  收藏  举报
编辑推荐:
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 【杭电多校比赛记录】2025“钉耙编程”中国大学生算法设计春季联赛(1)
点击右上角即可分享
微信分享提示