티스토리 뷰
개요
- 2025년 9월 30일 JUnit 6(세부버전 6.0.0)이 발표되었다.
- 발표되었는지도 몰랐는데 JUnit을 5에서 6으로 버전업해달라는 의뢰가 들어옴.
상황
시스템
- Spring boot 3.5.3을 사용중
- Spring boot 3.5.3의 JUnit은 Ver.5.12.2이다.
대응 방법
A. JUnit만 버전업
- 변경되는 라이브러리인 JUnit에 대해서만 검증하면 됨
B. Spring boot를 4로 버전업
- 전체적으로 버전업이 되어 취약성 해소와 성능 개선이 기대됨
- 변경된 라이브러리에 대한 검증이 필요
실제 대응
큰 문제가 없다면 더 나을 것 같아서 Spring boot의 버전업을 먼저 실행해 봄.
버전 확인
- 4의 세부버전은 4.0.0이 최종버전인데 아직 정식버전은 아닌 듯 함.

- 4.0.0은 초기 버전이라 LTS가 아닌 듯 함. 어차피 다시 버전업할 필요가 있음.

Spring boot를 버전업 시도함.
4.0.0-RC1으로 버전업하니 다음의 클래스를 찾지 못하는 에러가 발생.
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import org.springframework.http.codec.json.Jackson2JsonDecoder;
import org.springframework.http.codec.json.Jackson2JsonEncoder;
- jsr310은 그룹ID가 com.fasterxml.jackson.datatype에서 tools.jackson.datatype으로 변한 듯 하고
- Jackson2JsonDecoder, Jackson2JsonEncoder는 Spring framework 7부터 Deprecated되었음
게다가 사용중인 spring-boot-starter-jersey은 4.0.0-M2에서 멈춰있는 상태.

JUnit만 버전업하기로 하였다.
기존 라이브러리 버전.(인텔리제이의 부분화면)
- junit-jupiter는 5.12.2, junit-platform은 1.12.2이다.

pom.xml에서 JUnit의 버전을 지정
- 다음에 또 바꾸기 쉽게 property로 지정
- 전체를 쉽게 바꾸는 방법은 찾지 못해서 각 artifact별로 다 지정해 주었다.
- dependencyManagement에서 각 버전을 지정해주었다.


바뀐 라이브러리 버전.(Ver.6.0.1)

결론
- junit-jupiter와 junit-platform의 버전이 같아짐
- junit-jupiter Ver.5.12.2의 경우 junit-platform은 Ver.1.12.2
- junit-jupiter Ver.6.0.1의 경우 junit-platform도 Ver.6.0.1
- JUnit6의 새로운 기능을 사용하지 않고 기존 테스트 코드에 버전업만 한거라 특별히 바뀐 것은 없음.
- JUnit4의 경우 마이그레이션 안내 페이지도 있지만 JUnit5 -> JUnit6은 큰 변화가 없는 듯.
참고자료
https://docs.junit.org/current/user-guide/
JUnit User Guide
Although the JUnit Jupiter programming model and extension model do 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 custo
docs.junit.org
https://spring.io/projects/spring-boot#support
Spring Boot
spring.io
'today'work' 카테고리의 다른 글
| PDF.js Webjar를 이용해 PDF표시하기 (1) | 2025.06.26 |
|---|---|
| MyBatis @Insert의 결과 레코드를 직접 가져오기(PostgreSQL) (0) | 2024.10.24 |
| TransferManager를 이용한 디렉토리(복사 작업중인)를 S3에 업로드시 주의점 (0) | 2024.05.17 |
| Spring Integration을 사용하여 파일(디렉토리)을 감시할 때 주의점(복사 완료 체크) (0) | 2024.05.17 |
| PostgreSQL Table명과 Sequence 함께 찾기 (0) | 2023.12.24 |
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- Maven LF #메이븐 개행문자
- PostgreSQL #sequnceName
- PostgreSQL #FOR UPDATE #SKIP LOCKED
- spring-integration
- multipleIntegrationFlow
- springintegration #파일감시 #디렉토리감시 #파일완료검사
- AWS #X-Ray
- Postgresql #MultiTruncate
- add two numbers
- logback #logstash #LoggingEventCompositeJsonEncoder #로그JSON
- leetcode
- excel table
- lombok #maven build #sym
- palindrome number
- Python #Powertools
- 로그테스트 #콘솔로그테스트 #System.out
- spring #redis #redis-cluster
- SnakeYAML
- mybatis @insert값 @update값
- reverse integer
- cannotResolveSymbol
- 로그파일인덱스
- webjar
- pdf.js
- Two Sum
- JUnit6
- aws #aws region #aws credential #aws region provider #aws credential provier
- opencv로qr코드인식
- QR코드읽기 #ReadQRCode
- excel to markdown
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
글 보관함
