SpringFramework/JUnit Test
JUnit4로 변경
lovineff
2020. 6. 10. 11:40
최신 SpringBoot 버전에서는 JUnit5를 기본으로 사용하도록 설정되어있다.
사용하기에 익숙한 JUnit4 버전으로 변경하는 방법을 설명한다.
build.gradle 파일 변경
// JUnit5
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
// JUnit4
testImplementation('org.springframework.boot:spring-boot-starter-test')