It's a two-fold question.
junit-vintage-engine
and junit-jupiter-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 :
<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-jupiter-engine
for JUnit 5 tests.
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.
Reference:
Answer : 1. Based on reading i found some difference like,
junit-vintage-engine :
junit-jupiter-engine :
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.
Have a nice day!!! :)
First question is also related with the version of JDK. To be able to use jupiter engine, you must have Java 8 or higher. 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. As far as I know, it has not been updated along this time although java has been evolved so much. I think that is why spring initializers enforce the use of junit-jupiter-engine.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.