Skip to content

Commit

Permalink
test: #24 불필요한 테스트 삭제
Browse files Browse the repository at this point in the history
  • Loading branch information
tinon1004 committed Mar 27, 2024
1 parent ac400aa commit 9821467
Showing 1 changed file with 0 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -258,22 +258,6 @@ static Stream<Arguments> testDataForCreateNewUserWithKakao() throws Exception {
assertThat(updatedUserDto.getPassword()).isEqualTo(newPassword);
}

@Test
void 주어진_유저_ID와_새로운_비밀번호로_유저의_비밀번호를_변경한다_존재하지_않는_유저라면_예외가_발생한다() throws Exception {
// given
Long userId = 1L;
String newPassword = "newPwd1234!!";
given(userQueryService.getById(userId)).willThrow(UserNotFoundByIdException.class);

// when
Throwable t = catchThrowable(() -> sut.updatePassword(userId, newPassword));

// then
then(userQueryService).should().getById(userId);
verifyEveryMocksShouldHaveNoMoreInteractions();
assertThat(t).isInstanceOf(UserNotFoundByIdException.class);
}

private void verifyEveryMocksShouldHaveNoMoreInteractions() {
then(userQueryService).shouldHaveNoMoreInteractions();
then(userRepository).shouldHaveNoMoreInteractions();
Expand Down

0 comments on commit 9821467

Please sign in to comment.