public FindTemplateResponse findByIdAndMember(MemberDto memberDto, Long id) {
        Member member = memberRepository.fetchById(memberDto.id());
        Template template = templateRepository.fetchById(id);
        validateTemplateAuthorizeMember(template, member);

        List<SourceCode> sourceCodes = sourceCodeRepository.findAllByTemplate(template);
        List<Tag> tags = templateTagRepository.findAllByTemplate(template).stream()
                .map(TemplateTag::getTag)
                .toList();
        return FindTemplateResponse.of(template, sourceCodes, tags);
    }
@Test
    @DisplayName("템플릿 단건 조회 실패: 권한 없음")
    void findOneTemplateFailWithUnauthorized() {
        // given
        MemberDto memberDto = MemberDtoFixture.getFirstMemberDto();
        Member member = memberRepository.fetchById(memberDto.id());
        CreateTemplateRequest createdTemplate = makeTemplateRequest("title");
        Template template = saveTemplate(createdTemplate, new Category("category1", member), member);

        // when
        MemberDto otherMemberDto = MemberDtoFixture.getSecondMemberDto();

        // then
        Long templateId = template.getId();
        assertThatThrownBy(() -> templateService.findByIdAndMember(otherMemberDto, templateId))
                .isInstanceOf(CodeZapException.class)
                .hasMessage("해당 템플릿에 대한 권한이 없습니다.");
    }