-
Notifications
You must be signed in to change notification settings - Fork 40.2k
Spring Boot 2.4.0 M1 Release Notes
Phillip Webb edited this page Jun 8, 2020
·
17 revisions
If you upgrade to Spring Boot 2.4 and see test compilation errors for JUnit classes such as org.junit.Test
, this may be because JUnit 5’s vintage engine has been removed from spring-boot-starter-test
. The vintage engine allows tests written with JUnit 4 to be run by JUnit 5.
If you do not want to migrate your tests to JUnit 5 and wish to continue using JUnit 4, add a dependency on the Vintage Engine, as shown in the following example for Maven:
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
</exclusion>
</exclusions>
</dependency>
If you are using Gradle, the equivalent configuration is shown in the following example:
testImplementation("org.junit.vintage:junit-vintage-engine") {
exclude group: "org.hamcrest", module: "hamcrest-core"
}
Tip
|
Check the configuration changelog for a complete overview of the changes in configuration. |