준호씨의 블로그
개인 프로젝트 JUnit4에서 JUnit5로 변경 본문
java 공부용 프로젝트가 JUnit4를 사용하고 있었는데 JUnit5로 바꿨습니다.
github.com/junho85/java-study/commit/b3f41fc3adffff5d751d2c5b50265d60f231bdf0
junit4 -> junit5 · junho85/java-study@b3f41fc
Analytics cookies We use analytics cookies to understand how you use our websites so we can make them better, e.g. they're used to gather information about the pages you visit and how many clicks you need to accomplish a task. Learn more Accept Reject
github.com
관련이 있는지는 모르겠지만 처음에 뭔가 자꾸 오류가 나서 gradle wrapper도 5.2.1 -> 6.5로 올리긴 했는데 관련이 있는지는 잘 모르겠네요.
github.com/junho85/java-study/commit/1d895d663735542681cd49323ee39a1b7e13695c
gradle wrapper 5.2.1 -> 6.5 · junho85/java-study@1d895d6
Analytics cookies We use analytics cookies to understand how you use our websites so we can make them better, e.g. they're used to gather information about the pages you visit and how many clicks you need to accomplish a task. Learn more Accept Reject
github.com
아무튼 주요 변경사항은 build.gradle에서
testImplementation group: 'junit', name: 'junit', version: '4.12'
를
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.3.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.3.1'
로 바꿨고요.
test {
useJUnitPlatform()
}
를 추가해 주었습니다.
import org.junit.Test;
대신
import org.junit.jupiter.api.Test;
로 바꿨고요.
Exception 관련해서는
@Test(expected=JedisDataException.class)
를 그냥 @Test로 바꾸고
Assertions.assertThrows(JedisDataException.class, () -> {
요런 방식으로 바꿨습니다.
여기서는 없지만 다른 프로젝트 할 때는 @Ignore를 @Disabled로 바꾸기도 했었습니다.
'개발이야기' 카테고리의 다른 글
npm install - ELIFECYCLE 에러가 나면? (0) | 2020.10.29 |
---|---|
LocalDate를 Date로 바꾸기. FreeMarker에서는 아직도 Date를 사용함 (0) | 2020.10.21 |
OSX - python3 설치. 소스코드 빌드 해서 설치 하기 (2) | 2020.09.18 |
python2 설치. 소스코드 빌드 해서 설치 하기 (0) | 2020.09.16 |
2020년 1월 1일 python2 지원 종료. 마지막 버전은 2.7.18 2020년 4월 20일 출시? (0) | 2020.09.11 |