Maven + Cucumber4 + Spring Integration - 无法执行cucumber runner案例。

问题描述 投票:0回答:1

我无法使用mvn测试执行黄瓜春季集成测试。请参考下面的pom.xml

我正在使用cucumber-spring,cucumber-java8,cucumber-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>
spring spring-boot maven junit4
1个回答
0
投票

如果你移除vintage引擎(它负责在新的junit 5平台上运行旧的junit 34测试,你的旧测试将不会被选中。它是junit vintage引擎检测这些测试并在新平台上运行。

不幸的是,黄瓜还在junit 4上,所以这些测试不会被选中。

© www.soinside.com 2019 - 2024. All rights reserved.