🤖 생산성 Up & Tips
IntelliJ + Gradle + Junit5 환경에서 테스트 실행 시 @DisplayName 이 테스트 결과에 나오지 않는 경우, 해결 방법 🛠
kukim
2022. 2. 23. 19:57
상황
IntelliJ + Gradle + Junit5 환경에서 @DisplayName() 등록되어있는 테스트 코드를 실행한다.
@DisplayName("테스트 코드 설명") 을 사용했지만 실행 결과에 "테스트 코드 설명" 내용이 아닌 domain.lotto.LottoTicketTest 의 패키지.클래스명 형태로 출력되었다.
문제
문제점 : 테스트 실행 환경(Run tests using)이 Gradle로 되어있었다.
해결
해결 : IntelliJ - Preferences - Build, Execution, Depolyment - Gradle - Run tests using - IntelliJ IDEA로 변경하여 테스트를 실행한다.
결과