spring - Maven + Cucumber4 + Spring Integration - 无法执行黄瓜跑步者案例
问题描述
我无法使用 mvn test 执行黄瓜弹簧集成测试。请参考下面的 pom.xml -
我正在使用黄瓜-spring、黄瓜-java8、黄瓜-junit。当我尝试运行 mvn test 或 mvn clean install 时,功能没有运行。
//Code
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
<version>4.8.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit</artifactId>
<version>4.8.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-spring</artifactId>
<version>4.8.0</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<parallel>both</parallel>
<threadCount>4</threadCount>
<includes>
<include>**/*RunCucumberTest.java</include>
</includes>
</configuration>
</plugin>
</plugins>
</build>
</project>
解决方案
如果您删除老式引擎(负责在新的 junit 5 平台上运行旧的 junit 3/4 测试,则不会选择您的旧测试。它是检测这些测试并在新平台上运行的 junit 老式引擎。
不幸的是,黄瓜仍在junit 4上,所以没有采摘。
推荐阅读
- javascript - 使 React 与 math.js 库一起工作
- python - 如何在字典中的枚举中添加文档字符串
- c# - 如何使用 DeserializeObject 方法处理空值
- html - ul > li > a 上的键盘交互。焦点不适用于 Firefox,但在 Chrome 中
- javascript - 接口中的 React.ref 属性
- flutter - Flutter 自定义画家和键盘问题
- wordpress - .htaccess 重写规则编辑后的内部服务器错误
- python - 在虚拟环境中安装 find spark
- powershell - Powershell:插入 CSV 时不需要的 DateTime 转换
- c# - RichTextBox 使文本具有多种颜色