Skip to content

Commit

Permalink
fix: 실패 테스트 수정
Browse files Browse the repository at this point in the history
- 테스트 시 createParticipant 호출로 인해 studyRole이 2번 저장되어 unique한 결과를 불러오지 못해 나타난 오류를 해결하였습니다.
  • Loading branch information
JJimini committed Dec 1, 2024
1 parent 4de5721 commit d91c09d
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@

import doore.helper.IntegrationTest;
import doore.member.domain.Member;
import doore.member.domain.Participant;
import doore.member.domain.StudyRole;
import doore.member.domain.StudyRoleType;
import doore.member.domain.repository.MemberRepository;
import doore.member.domain.repository.ParticipantRepository;
import doore.member.domain.repository.StudyRoleRepository;
import doore.member.exception.MemberException;
import doore.study.application.dto.response.ParticipantResponse;
Expand All @@ -32,6 +34,8 @@ public class ParticipantQueryTest extends IntegrationTest {
@Autowired
private StudyRepository studyRepository;
@Autowired
private ParticipantRepository participantRepository;
@Autowired
private ParticipantCommandService participantCommandService;
@Autowired
private ParticipantQueryService participantQueryService;
Expand Down Expand Up @@ -90,8 +94,9 @@ void setUp() {
@Test
@DisplayName("[성공] 참여자를 삭제하면 참여자 목록 조회에 삭제된 참여자가 조회되지 않는다.")
void getParticipants_참여자를_삭제하면_참여자_목록_조회에_삭제된_참여자가_조회되지_않는다_성공() {
participantCommandService.createParticipant(study.getId(), member.getId(), member.getId());
participantCommandService.createParticipant(study.getId(), otherMember.getId(), member.getId());
participantRepository.save(Participant.builder().member(member).studyId(study.getId()).build());
participantRepository.save(Participant.builder().member(otherMember).studyId(study.getId()).build());

final List<ParticipantResponse> beforeParticipantResponses = participantQueryService.getParticipants(
study.getId(), member.getId());

Expand Down

0 comments on commit d91c09d

Please sign in to comment.