From 9b999e1357f8474476dbed94515d62f2090828a2 Mon Sep 17 00:00:00 2001 From: coli-geonwoo Date: Sun, 29 Dec 2024 03:18:07 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EB=A6=AC=ED=8C=A9=ED=84=B0=EB=A7=81?= =?UTF-8?q?=EC=97=90=20=EB=94=B0=EB=A5=B8=20=EC=8B=A4=ED=8C=A8=ED=95=98?= =?UTF-8?q?=EB=8A=94=20mock=20=ED=85=8C=EC=8A=A4=ED=8A=B8=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../notification/domain/types/DepartureReminderTest.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/backend/src/test/java/com/ody/notification/domain/types/DepartureReminderTest.java b/backend/src/test/java/com/ody/notification/domain/types/DepartureReminderTest.java index 595f925c3..655e30da7 100644 --- a/backend/src/test/java/com/ody/notification/domain/types/DepartureReminderTest.java +++ b/backend/src/test/java/com/ody/notification/domain/types/DepartureReminderTest.java @@ -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();