【问题标题】:Test Case pass while running in eclipse with Junit but fails with mvn install使用 Junit 在 Eclipse 中运行时测试用例通过,但使用 mvn install 失败
【发布时间】:2020-12-23 18:18:02
【问题描述】:

当我使用 Junit 运行测试用例时,它通过但使用 mvn install 失败。

assertEquals(2, flight.getDelayCodes().getLocal().size());

[错误] 失败: [错误] FlightEventHandlerTest.testDelayCodesUpdateFields:302 预期: 但是:

我尝试通过添加junit依赖,仍然是同样的错误 尝试使用surefire插件仍然是同样的错误

<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <forkMode>always</forkMode>
                    <forkCount>4</forkCount>
                    <argLine>${argLine}</argLine>
                    <redirectTestOutputToFile>true</redirectTestOutputToFile>
                    <includes>
                        <include>**/*Test.java</include>
                    </includes>
                    <runOrder>failedfirst</runOrder>
                </configuration>
            </plugin>

【问题讨论】:

    标签: spring junit junit-jupiter


    【解决方案1】:

    经过几个小时的调试,再次构建依赖项目成功了。为我工作。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-08-05
      • 2019-02-28
      • 1970-01-01
      • 2020-03-15
      • 2019-12-18
      • 2013-11-08
      相关资源
      最近更新 更多