Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public EntryResponse createParticipant(Long userId, Long festivalId, ProfileRequ
throw new FestimateException(ResponseError.PARTICIPANT_ALREADY_EXISTS);
}
Participant participant = participantService.createParticipant(user, festival, request);
pointService.rechargePoint(participant, 10);
matchingService.matchPendingParticipants(participant);

return EntryResponse.of(participant);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,24 @@ void createParticipant_success() {
verify(matchingService).matchPendingParticipants(participant);
}

@Test
@DisplayName("참가자 생성 시 10포인트가 충전된다")
void createParticipant_success_point() {
when(userService.getUserByIdOrThrow(1L)).thenReturn(user);
when(festivalService.getFestivalByIdOrThrow(1L)).thenReturn(festival);
when(participantService.getParticipant(user, festival)).thenReturn(null);
when(participantService.createParticipant(any(), any(), any())).thenReturn(participant);

var response = participantFacade.createParticipant(1L, 1L, null);

// then
assertThat(response.participantId()).isNotNull();
// 포인트 충전 메서드 호출 여부 검증
verify(pointService).rechargePoint(participant, 10);
// 매칭 메서드 호출 여부 검증
verify(matchingService).matchPendingParticipants(participant);
}

@Test
@DisplayName("내 프로필 조회 성공")
void getParticipantProfile_success() {
Expand Down
Loading