gpt4 book ai didi

java - Junit 5.5.1 和 5.5.2 突然无法运行测试 : "Process finished with exit code -1"; 5. 6.0-RC1 缺少类

转载 作者:行者123 更新时间:2023-12-04 02:40:12 26 4
gpt4 key购买 nike

我将 Junit 5.5.1 添加到一个使用 4.11 的项目中。我编写的测试直到今天都运行良好。今天,甚至在执行任何测试类之前,所有测试都以退出代码 -1 失败。我不知道会导致这种情况的任何依赖项更改。

我切换到 5.6.0-RC1,它似乎缺少一个扩展类 (TestInstancePreDestroyCallback)。

然后我尝试注意到 5.5.2 并切换到它:它与 5.5.1 有同样的问题。

我又试了一次 5.6.0-RC1 - 这次我注意到这个 jar 被命名为 5.6.0-M1。这个版本有效,所以我似乎还好,但那是一系列令人不安且没有信心的事件。

我的问题是:这件事发生在其他人身上吗?到底是怎么回事?

更新:原来 5.6.0-M1 中缺少的类在 5.6.0-RC1 中存在,所以我已经切换到它。我不再追究 5.5.* 问题。

最佳答案

在我的例子中,我收到了这个错误,因为我在我的 Spring Boot 应用程序中包含了这两个

        <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>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.6.0</version>
<scope>test</scope>
</dependency>

我删除了后者,它对我来说效果很好。

关于java - Junit 5.5.1 和 5.5.2 突然无法运行测试 : "Process finished with exit code -1"; 5. 6.0-RC1 缺少类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59760938/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com