【问题标题】:Junit 5 test cases are not executing in gradle 4.4Junit 5 测试用例未在 gradle 4.4 中执行
【发布时间】:2021-01-22 10:48:15
【问题描述】:

我的 junit 5 测试用例没有执行。 任何人都可以提出一些解决方案吗? Gradle 版本是 4.4

【问题讨论】:

    标签: gradle junit


    【解决方案1】:

    您需要Gradle 4.6 or later 才能获得对 JUnit 5 的支持。

    升级 Gradle 后,请务必为 JUnit 5 进行配置。有关详细信息,请参阅user guide。例如:

    // build.gradle (Groovy DSL)
    test {
        useJUnitPlatform()
    }
    dependencies {
        testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0'
        testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-11-12
      • 2018-12-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-10-18
      • 1970-01-01
      相关资源
      最近更新 更多