Skip to content

Commit

Permalink
🔨 refactor: 이전에 삭제한 테스트코드 다시 삭제
Browse files Browse the repository at this point in the history
  • Loading branch information
SONGS4RI committed Dec 13, 2023
1 parent e5b0955 commit 46c640d
Showing 1 changed file with 0 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,23 +156,6 @@ void conflictedRegistration() {
@Nested
@DisplayName("토너먼트_유저_참가_취소_테스트")
class cancelTournamentUserRegistration {
@Test
@DisplayName("유저_참가_취소_성공")
@Disabled
void success() {
// given
Tournament tournament = createTournament(1L, TournamentStatus.BEFORE,
LocalDateTime.now(), LocalDateTime.now().plusHours(2));
User user = createUser("testUser");
TournamentUser tournamentUser = new TournamentUser(user, tournament, true, LocalDateTime.now());
tournament.addTournamentUser(tournamentUser);
given(tournamentRepository.findById(tournament.getId())).willReturn(Optional.of(tournament));
given(userRepository.findById(user.getId())).willReturn(Optional.of(user));

// when, then
tournamentService.cancelTournamentUserRegistration(tournament.getId(), UserDto.from(user));
}

@Test
@DisplayName("찾을_수_없는_토너먼트")
void tournamentNotFound() {
Expand All @@ -185,22 +168,6 @@ void tournamentNotFound() {
assertThatThrownBy(()->tournamentService.cancelTournamentUserRegistration(tournamentId, UserDto.from(user)))
.isInstanceOf(TournamentNotFoundException.class);
}

@Test
@DisplayName("db에_없는_유저")
@Disabled
void userNotFound() {
// given
UserDto userDto = UserDto.builder().id(1L).intraId("testUser").build();
Tournament tournament = createTournament(1L, TournamentStatus.BEFORE,
LocalDateTime.now(), LocalDateTime.now().plusHours(2));
given(tournamentRepository.findById(tournament.getId())).willReturn(Optional.of(tournament));
given(userRepository.findById(userDto.getId())).willReturn(Optional.empty());

// when, then
assertThatThrownBy(()->tournamentService.cancelTournamentUserRegistration(tournament.getId(), userDto))
.isInstanceOf(UserNotFoundException.class);
}
}

/**
Expand Down

0 comments on commit 46c640d

Please sign in to comment.