Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/spring-boot/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring boot &引用;未发现任何测试”;使用Spock和Spring Boot在Intellij中运行单独测试时_Spring Boot_Junit5_Spock_Spring Test - Fatal编程技术网

Spring boot &引用;未发现任何测试”;使用Spock和Spring Boot在Intellij中运行单独测试时

Spring boot &引用;未发现任何测试”;使用Spock和Spring Boot在Intellij中运行单独测试时,spring-boot,junit5,spock,spring-test,Spring Boot,Junit5,Spock,Spring Test,运行整个测试类工作正常。但是,当我尝试单击测试方法旁边的排水沟图标时,会出现以下错误: org.junit.platform.commons.JUnitException:ID为的测试引擎 “junit jupiter”未能发现测试 这个问题与junit平台的最新变化有关。不确定具体更改了什么,但以下步骤为我修复了测试: 将junit平台版本更改为1.5.2(这是最后一个可用的版本): org.junit.platform junit平台共享 1.5.2 从spring boot starter

运行整个测试类工作正常。但是,当我尝试单击测试方法旁边的排水沟图标时,会出现以下错误:

org.junit.platform.commons.JUnitException:ID为的测试引擎 “junit jupiter”未能发现测试


这个问题与junit平台的最新变化有关。不确定具体更改了什么,但以下步骤为我修复了测试:

  • 将junit平台版本更改为1.5.2(这是最后一个可用的版本):
  • org.junit.platform junit平台共享 1.5.2
  • 从spring boot starter测试中排除junit vintage引擎:
  • org.springframework.boot 弹簧起动试验 org.junit.vintage 朱尼特老式发动机 测试 <dependency> <groupId>org.junit.platform</groupId> <artifactId>junit-platform-commons</artifactId> <version>1.5.2</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <exclusions> <exclusion> <groupId>org.junit.vintage</groupId> <artifactId>junit-vintage-engine</artifactId> </exclusion> </exclusions> <scope>test</scope> </dependency>