Skip to content

Commit

Permalink
refactor: 검색시 Pageable에 대한 null 검증 테스트 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
HoeSeong123 committed Sep 20, 2024
1 parent a65a565 commit f14dfe8
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import java.util.List;

import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -183,6 +184,22 @@ void findAllSuccessByMemberId() {
);
}

@Test
@Disabled("Pageable에 대한 null 검증이 필요함")
@DisplayName("검색 기능 실패: Pageable을 전달하지 않은 경우")
void findAllFailureWithNullPageable() {
saveInitialData();
Long memberId = member1.getId();
String keyword = null;
Long categoryId = null;
List<Long> tagIds = null;
Pageable pageable = null;

assertThatThrownBy(() ->sut.findAll(memberId, keyword, categoryId, tagIds, pageable))
.isInstanceOf(CodeZapException.class)
.hasMessage("Pageable을 필수로 작성해야 합니다.");
}

@Test
@DisplayName("검색 기능: 키워드로 템플릿 목록 조회 성공")
void findAllSuccessByKeyword() {
Expand Down

0 comments on commit f14dfe8

Please sign in to comment.