개요
테스트 메서드 이름 표시
@DisplayNameGeneration(DisplayNameGenerator.ReplaceUnderscores.class)
class StudyTest {
@Test
@DisplayName("스터디 만들기 첫 번째")
void create() throws Exception {
//given
Study study = new Study();
//when
//then
assertNotNull(study);
System.out.println("create");
}
@Test
@DisplayName("스터디 만들기 두 번째")
void createTwo() throws Exception {
//given
Study study = new Study();
//when
//then
assertNotNull(study);
System.out.println("create Two");
}
}
- @DisplayNameGeneration
- Method와 Class 레퍼런스를 사용해서 테스트 이름을 표기하는 방법 설정
- 기본 구현체로 ReplaceUnderscores 제공
- @DisplayName
- 어떤 테스트인지 테스트 이름을 보다 쉽게 표현할 수 있는 방법을 제공
- @DisplayNameGeneration 보다 우선 순위가 높음