【问题标题】:"No tests were found" when running individual test in Intellij with Spock and Spring Boot使用 Spock 和 Spring Boot 在 Intellij 中运行单个测试时“未找到测试”
【发布时间】:2021-07-23 13:10:47
【问题描述】:

运行整个测试类就可以了。但是,当我尝试单击测试方法旁边的装订线图标时,出现以下错误:

org.junit.platform.commons.JUnitException:带有 ID 的 TestEngine 'junit-jupiter' 未能发现测试

【问题讨论】:

    标签: spring-boot junit5 spock spring-test


    【解决方案1】:

    问题与 junit 平台的最新变化有关。不确定到底发生了什么变化,但以下步骤为我修复了测试:

    1. 将 junit 平台版本更改为 1.5.2(这是最后一个工作版本):
    org.junit.platformjunit-platform-commons1.5.2版本> 依赖>
    1. 从 spring-boot-starter-test 中排除 junit 老式引擎:
    org.springframework.bootspring-boot-starter-testorg.junit.vintagejunit-vintage-engine排除> 排除> 测试依赖>

    【讨论】:

      猜你喜欢
      • 2016-05-12
      • 2019-01-27
      • 1970-01-01
      • 2014-08-15
      • 1970-01-01
      • 2017-06-28
      • 2020-01-07
      • 1970-01-01
      • 2019-04-22
      相关资源
      最近更新 更多