Principal

JUnit 5 dependency

팅리엔 2021. 3. 19. 10:27
 

JUnit 5 User Guide

Although the JUnit Jupiter programming model and extension model will not support JUnit 4 features such as Rules and Runners natively, it is not expected that source code maintainers will need to update all of their existing tests, test extensions, and cus

junit.org

JUnit5는 3가지 모듈로 구성되어 있다.

JUnit 5 = JUnit Platform + JUnit Jupiter + JUnit Vintage

 

  • JUnit Platform : JVM에서 테스트 프레임워크를 시작하기 위한 기본 토대. TestEngine API 정의.
  • JUnit Jupiter : 확장 기능 포함. Annotation들이 이 모듈에 포함되어 있다.
  • JUnit Vintage : JUnit3, JUnit4 지원

 

출처: https://javacan.tistory.com/entry/JUnit-5-Intro

 

스프링부트 2.2 이상부터 Junit5를 포함하고 있다.

2.2 아래 버전의 스프링부트를 쓰고 있어서 스프링부트에 포함된 JUnit4을 exclude하고 JUnit5 dependency를 추가하기로.

 

참고

javacan.tistory.com/entry/JUnit-5-Intro

maven.apache.org/surefire/maven-surefire-plugin/examples/junit-platform.html