JUnit 5 vintage engine for JUnit 4 error: Unsupported version of junit:junit: 4.11. Please upgrade to version 4.12 or later. How to downgrade?(用于JUnit4的JUnit5老式引擎错误:不支持的版本:JUNIT:JUNIT:4.11。请升级到版本4.12或更高版本。如何降级?) - IT屋-程序员软件开发技术分
问题描述
Internal Error occurred.
org.junit.platform.commons.JUnitException: TestEngine with ID 'junit-vintage' failed to discover tests
at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discoverEngineRoot(EngineDiscoveryOrchestrator.java:111)
at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discover(EngineDiscoveryOrchestrator.java:85)
at org.junit.platform.launcher.core.DefaultLauncher.discover(DefaultLauncher.java:92)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:75)
at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:71)
at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:220)
at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:53)
Caused by: org.junit.platform.commons.JUnitException: Unsupported version of junit:junit: 4.11. Please upgrade to version 4.12 or later.
at org.junit.vintage.engine.JUnit4VersionCheck.checkSupported(JUnit4VersionCheck.java:49)
at org.junit.vintage.engine.JUnit4VersionCheck.checkSupported(JUnit4VersionCheck.java:35)
at org.junit.vintage.engine.VintageTestEngine.discover(VintageTestEngine.java:62)
at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discoverEngineRoot(EngineDiscoveryOrchestrator.java:103)
... 7 more
当我使用带有Vintage Engine的JUnit5时,出现此错误。其目的是:
- 尝试逐步迁移到JUnit5,而不破坏整个大项目的一个模块中现有的JUnit4测试
- 不要触及我的模块中现有的JUnit4依赖项
推荐答案
任何降级版本的JUnit5或JUnitvintage Engine都不会支持JUnit4.11。JUnit Vintage需要JUnit 4.12或更高版本。
(source,其中others)
这篇关于用于JUnit4的JUnit5老式引擎错误:不支持的版本:JUNIT:JUNIT:4.11。请升级到版本4.12或更高版本。如何降级?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:用于JUnit4的JUnit5老式引擎错误:不支持的版本:JUNIT:JUNIT:4.11。请升级到版本4.12或更高版本。如何降级?


基础教程推荐
- 在 Java 中创建日期的正确方法是什么? 2022-01-01
- 多个组件的复杂布局 2022-01-01
- 从 python 访问 JVM 2022-01-01
- Java 实例变量在两个语句中声明和初始化 2022-01-01
- 验证是否调用了所有 getter 方法 2022-01-01
- 如何在 JFrame 中覆盖 windowsClosing 事件 2022-01-01
- 如何在 Spring @Value 注解中正确指定默认值? 2022-01-01
- 大摇大摆的枚举 2022-01-01
- 不推荐使用 Api 注释的描述 2022-01-01
- Java Swing计时器未清除 2022-01-01