Stack/대환장 오류 모음집
@RunWith가 import안될 때
Emmababy
2021. 2. 2. 22:54
728x90
스프링부트에서 test할때, @RunWith가 import안되는 경우
사용중인 junit버전이 junit4인지, junit5인지 확인을 먼저 해야한다.
아래의 내용은 junit4일때 @RunWith가 import 안되는 경우 해결법이다.
[해결법]
build.gradle에서 의존성(dependencies)에 아래의 코드를 추가한다.
testImplementation("org.junit.vintage:junit-vintage-engine") {
exclude group: "org.hamcrest", module: "hamcrest-core"
}
728x90