[英]Difference between junit-vintage-engine and junit-jupiter-engine?
It's a two-fold question.这是一个双重问题。
junit-vintage-engine
and junit-jupiter-engine
? junit-vintage-engine
和junit-jupiter-engine
什么区别?junit-vintage-engine
. junit-vintage-engine
的排除junit-vintage-engine
。 Is it to enforce the use of junit-jupiter-engine? Below is the dependency of my SpringBoot project generated from Spring Initializr :下面是我从Spring Initializr生成的 SpringBoot 项目的依赖项:
<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>
junit-vintage-engine
is used for running JUnit 4 tests; junit-vintage-engine
用于运行 JUnit 4 测试; junit-jupiter-engine
for JUnit 5 tests. junit-jupiter-engine
用于 JUnit 5 测试。
Presumably since you'll be writing only JUnit 5 tests for a new Spring Boot project, the vintage engine won't be needed, hence the default dependency exclusion in the POM.大概因为您将只为新的 Spring Boot 项目编写 JUnit 5 测试,所以不需要老式引擎,因此 POM 中的默认依赖项排除。
Reference:参考:
https://junit.org/junit5/docs/current/user-guide https://junit.org/junit5/docs/current/user-guide
Answer : 1. Based on reading i found some difference like,答:1.根据阅读,我发现了一些不同之处,例如,
junit-vintage-engine : junit-vintage-engine :
junit-jupiter-engine : junit-木星引擎:
Answer : 2. I'm also amazed they are still providing older vintage library probably there is some reason which i don't know till now but based on current usage we'll see that in next update.回答: 2.我也很惊讶他们仍然提供较旧的老式图书馆,可能有一些我现在还不知道的原因,但根据当前的使用情况,我们将在下一次更新中看到这一点。
Have a nice day!!!祝你今天过得愉快!!! :)
:)
First question is also related with the version of JDK.第一个问题也和JDK的版本有关。 To be able to use jupiter engine, you must have Java 8 or higher.
为了能够使用 jupiter 引擎,你必须有 Java 8 或更高版本。 For second question;
对于第二个问题; since the vintage engine is for JUnit4 and JUnit4 is greater than 10 years old, it is not recommended to be used.
由于老式引擎是针对 JUnit4 的,而 JUnit4 已经有超过 10 年的历史了,所以不建议使用。 As far as I know, it has not been updated along this time although java has been evolved so much.
据我所知,虽然java已经进化了这么多,但这次并没有更新。 I think that is why spring initializers enforce the use of junit-jupiter-engine.
我认为这就是 spring 初始化程序强制使用 junit-jupiter-engine 的原因。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.