Skip to content

Commit

Permalink
test: AuthEmailVerifyServiceTest 통과되도록 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
redcarrot1 committed Jul 2, 2024
1 parent 0d3c52b commit 7c5745a
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,12 @@ void authEmailInvalidate() {
@DisplayName("authEmail이 만료되면 AuthCodeExpiredException 발생")
void authEmailExpired() {
// given
AuthEmail authEmail = AuthEmail.createAuthEmail("target", "code", LocalDateTime.now().minusDays(1));
LocalDateTime now = LocalDateTime.of(2024, 7, 1, 0, 0);
AuthEmail authEmail = AuthEmail.createAuthEmail("target", "code", now.minusDays(1));
when(authEmailRepository.findFirstByTargetOrderByCreatedAtDesc(any(String.class)))
.thenReturn(Optional.of(authEmail));
when(dateTimeService.getLocalDateTimeNow())
.thenReturn(LocalDateTime.of(2024, 7, 1, 0, 0));
.thenReturn(now);

// expected
assertThatThrownBy(() -> authEmailVerifyService.verifyAuthEmail("code", "target"))
Expand Down

0 comments on commit 7c5745a

Please sign in to comment.