티스토리 뷰

빠르게 알아보자. 포스팅은 gradle 기준으로 설명한다.

 

build.gradle에 아래 설정을 추가해준다.

 

test {
    useJUnitPlatform()
}

 

spring starter test 에서 기존 junit을 제외해준다. dependencies에서 아래처럼 설정해준다.

 

testImplementation('org.springframework.boot:spring-boot-starter-test') { 
    exclude module: 'junit'                                              
}                                                                        

 

이제 junit5 의존성을 추가해줄차례다.

 

testImplementation('org.junit.jupiter:junit-jupiter-api')
testRuntimeOnly('org.junit.jupiter:junit-jupiter-engine')

 

위 의존성까지 추가해주면 테스트작성시 junit5를 이용해서 작성할 수 있다.

'Java > spring' 카테고리의 다른 글

상속관계에서 Spring Transactional 애노테이션 동작  (0) 2020.07.29
spring bean lite mode  (0) 2019.08.03
RestTemplate connection pool 설정하기  (7) 2019.05.15
Netflix Hystrix  (4) 2018.12.23
Spring Cloud Config 2  (1) 2018.12.08
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/04   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
글 보관함