Skip to content

Commit

Permalink
fix: 다락방 멤버 조회 권한 삭제
Browse files Browse the repository at this point in the history
  • Loading branch information
ay-eonii committed Sep 27, 2024
1 parent c829def commit 57aec94
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,17 @@
import mouda.backend.darakbangmember.presentation.response.DarakbangMemberResponses;
import mouda.backend.darakbangmember.presentation.response.DarakbangMemberRoleResponse;
import mouda.backend.member.domain.Member;
import mouda.backend.member.implement.MemberValidator;

@Service
@Transactional
@RequiredArgsConstructor
public class DarakbangMemberService {

private final MemberValidator memberValidator;
private final DarakbangMemberFinder darakbangMemberFinder;
private final DarakbangFinder darakbangFinder;

@Transactional(readOnly = true)
public DarakbangMemberResponses findAllDarakbangMembers(Long darakbangId, DarakbangMember member) {
memberValidator.validateNotManager(member);
DarakbangMembers darakbangMembers = darakbangMemberFinder.findAllDarakbangMembers(darakbangId);

return DarakbangMemberResponses.toResponse(darakbangMembers);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
import mouda.backend.common.fixture.MemberFixture;
import mouda.backend.darakbang.domain.Darakbang;
import mouda.backend.darakbang.infrastructure.DarakbangRepository;
import mouda.backend.darakbangmember.domain.DarakbangMember;
import mouda.backend.darakbangmember.exception.DarakbangMemberException;
import mouda.backend.darakbangmember.infrastructure.DarakbangMemberRepository;
import mouda.backend.darakbangmember.presentation.response.DarakbangMemberRoleResponse;
import mouda.backend.member.domain.Member;
Expand All @@ -35,23 +33,6 @@ class DarakbangMemberServiceTest {
@Autowired
private DarakbangMemberService darakbangMemberService;

@DisplayName("다락방 멤버 조회 테스트")
@Nested
class DarakbangMemberReadTest {

@DisplayName("다락방 관리자가 아니라면 멤버 조회에 실패한다.")
@Test
void failToReadWithoutDarakbangManager() {
Member hogee = memberRepository.save(MemberFixture.getHogee());
Darakbang darakbang = darakbangRepository.save(DarakbangFixture.getDarakbangWithWooteco());
DarakbangMember darakbangHogee = darakbangMemberRepository.save(
DarakbangMemberFixture.getDarakbangMemberWithWooteco(darakbang, hogee));

assertThatThrownBy(() -> darakbangMemberService.findAllDarakbangMembers(darakbang.getId(), darakbangHogee))
.isInstanceOf(DarakbangMemberException.class);
}
}

@DisplayName("다락방 멤버 권한 조회 테스트")
@Nested
class DarakbangMemberRoleReadTest {
Expand Down

0 comments on commit 57aec94

Please sign in to comment.