This article describes ** "Spring boot 2.2 or higher, compatible with JUnit 5" **. I hope it will be useful for the following purposes!
--Java 8 ~ (Spring boot 2.2 and above support Java 8 and 11)
--JUnit5 is the default from Spring boot 2.2 and above --JUnit4 and JUnit5 are basically incompatible -** Currently JUnit 4 and 5 can coexist (will eventually disappear) **
<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>
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
--@RunWith
has been abolished
--Correspondence ... Deleted or changed to @ExtendWith
--The import source of @Test
has changed
--Before support ... ʻimport org.junit.Test; --After support ... ʻimport org.junit.jupiter.api.Test;
--@Before
has been abolished
--Correspondence ... Changed to @BeforeEach
or @BeforeAll
↓ This is a reference site
Recommended Posts