Skip to content

Commit

Permalink
fix: 리팩터링에 따른 실패하는 mock 테스트 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
coli-geonwoo committed Dec 28, 2024
1 parent f10288e commit 9b999e1
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,11 @@ class DepartureReminderTest {
@DisplayName("출발 알림 생성 시점이 알림 전송 시점보다 늦은 경우 즉시 전송된다")
@Test
void sendImmediatelyIfDepartureTimeIsPast() {
LocalDateTime now = TimeUtil.nowWithTrim();
Meeting meeting = new Meeting("과거 약속", now.toLocalDate(), now.toLocalTime(), Fixture.TARGET_LOCATION, "초대코드");
Mate mate = Mockito.mock(Mate.class);
FcmTopic fcmTopic = Mockito.mock(FcmTopic.class);
DepartureTime departureTime = Mockito.mock(DepartureTime.class);
LocalDateTime now = TimeUtil.nowWithTrim();

Mockito.when(departureTime.isBefore(any()))
.thenReturn(true);
DepartureTime departureTime = new DepartureTime(meeting, 10L);

DepartureReminder departureReminder = new DepartureReminder(mate, departureTime, fcmTopic);
Notification departureReminderNotification = departureReminder.toNotification();
Expand Down

0 comments on commit 9b999e1

Please sign in to comment.