public FindAllTemplatesResponse findAllBy(
            long memberId,
            String keyword,
            Long categoryId,
            List<Long> tagIds,
            Pageable pageable
    ) {
        keyword = "%" + keyword + "%";
        pageable = PageRequest.of(pageable.getPageNumber() - 1, pageable.getPageSize(), pageable.getSort());

        if (categoryId != null && tagIds != null) {
            return getTemplatesResponseByCategoryAndTag(memberId, keyword, categoryId, tagIds, pageable);
        }
        if (categoryId != null) {
            return getTemplatesResponseCategory(memberId, keyword, categoryId, pageable);
        }
        if (tagIds != null) {
            return getTemplatesResponseByTag(memberId, keyword, tagIds, pageable);
        }
        return getTemplatesResponse(memberId, keyword, pageable);
    }
@Test
    @DisplayName("템플릿 전체 조회 성공")
    void findAllTemplatesSuccess() {
        // given
        MemberDto memberDto = MemberDtoFixture.getFirstMemberDto();
        Member member = memberRepository.fetchById(memberDto.id());
        saveTemplate(makeTemplateRequest("title1"), new Category("category1", member), member);
        saveTemplate(makeTemplateRequest("title2"), new Category("category2", member), member);

        // when
        FindAllTemplatesResponse allTemplates = templateService.findAllBy(
                member.getId(), "", null, null, PageRequest.of(1, 10));

        // then
        assertThat(allTemplates.templates()).hasSize(2);
    }