首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >JUnit 5用于JUnit 4错误的老式引擎:不支持的junit版本:junit: 4.11。请升级到4.12或更高版本。如何降级?

JUnit 5用于JUnit 4错误的老式引擎:不支持的junit版本:junit: 4.11。请升级到4.12或更高版本。如何降级?
EN

Stack Overflow用户
提问于 2021-05-07 09:57:40
回答 1查看 2.7K关注 0票数 0
代码语言:javascript
复制
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

当我在老式引擎中使用JUnit 5时,会出现此错误。目的是:

  • 尝试逐步迁移到JUnit 5,而不破坏整个大项目的一个模块中现有的JUnit 4测试。
  • 不要触及我的模块中现有的JUnit 4依赖项

那么,为了与JUnit 4.11兼容,我如何知道应该将JUnit 5降级到哪个版本呢?我现在有5.7.0。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-05-07 10:30:17

对于任何降级版本的JUnit 5或JUnit老式引擎,您都不会得到JUnit 4.11的支持。JUnit年份需要JUnit 4.12或更高版本。

(来源其他)

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/67432749

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档