HomeAboutMeBlogGuest
© 2025 Sejin Cha. All rights reserved.
Built with Next.js, deployed on Vercel
📝
남득윤 학습 저장소
/
더 자바, 애플리케이션을 테스트하는 다양한 방법
더 자바, 애플리케이션을 테스트하는 다양한 방법
/
1부 - JUnit5
1부 - JUnit5
/
JUnit 5 테스트 이름 표시

JUnit 5 테스트 이름 표시

 
@DisplayNameGeneration
  • 테스트 클래스에 Custom한 display name generator를 등록함
DisplayNameGenerator
Behavior
Standard
Matches the standard display name generation behavior in place since JUnit Jupiter 5.0 was released.
Simple
Removes trailing parentheses for methods with no parameters.
ReplaceUnderscores
Replaces underscores with spaces.
IndicativeSentences
Generates complete sentences by concatenating the names of the test and the enclosing classes.
 
@DisplayName
  • 테스트 클래스 혹은 메소드에 custom한 display name을 등록함
 
 
클래스에 @DisplayNameGeneration을 등록하고 메소드에 @DisplayName을 작성하면 메소드에 작성된 display name이 우선됨