leelee.log

(팁-스프링) Junit5 테스트 환경- 기본세팅, Mockmvc, Mock, 본문

읽어볼 자료 아카이빙

(팁-스프링) Junit5 테스트 환경- 기본세팅, Mockmvc, Mock,

leeleelee3264 2020. 2. 9. 12:21

https://effectivesquid.tistory.com/entry/Spring-Boot-starter-test-%EC%99%80-Junit5%EB%A5%BC-%EC%9D%B4%EC%9A%A9%ED%95%9C-%ED%85%8C%EC%8A%A4%ED%8A%B8

 

Spring boot starter test 와 Junit5를 이용한 테스트

Junit 5 & Spring Test을 이용한 TDD 환경 세팅 기본 세팅 @ExtendWith(SpringExtension.class) @SpringBootTest(classes = KkApplication.class) @ActiveProfiles("test") public abstract class SpringTestSuppo..

effectivesquid.tistory.com

 

코드에서 많이들 사용하는 @Runwith(SpringRunner.class)는 Junit4에서 사용되는 형식이었고 Junit5에서 동일하게 테스트를 하고 싶은 경우에는 @ExtendWith(SpringExtension.class)를 사용하면 된다. @SpringBootTest 어노테이션은 계속 동일하게 사용된다.