From 2003df7a63eeebc3b2911be1f5e85942190a39e8 Mon Sep 17 00:00:00 2001 From: MJJ Date: Thu, 22 Aug 2024 22:43:32 +0900 Subject: [PATCH] =?UTF-8?q?[refactor]=20=EC=9D=B4=EB=B2=88=20=EC=A3=BC=20?= =?UTF-8?q?=EC=86=8C=EB=B9=84=20=EA=B8=88=EC=95=A1=20=EC=A1=B0=ED=9A=8C=20?= =?UTF-8?q?api=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/ConsumptionGoalServiceTest.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/test/java/com/bbteam/budgetbuddies/domain/consumptiongoal/service/ConsumptionGoalServiceTest.java b/src/test/java/com/bbteam/budgetbuddies/domain/consumptiongoal/service/ConsumptionGoalServiceTest.java index e7ede59f..07b42d1c 100644 --- a/src/test/java/com/bbteam/budgetbuddies/domain/consumptiongoal/service/ConsumptionGoalServiceTest.java +++ b/src/test/java/com/bbteam/budgetbuddies/domain/consumptiongoal/service/ConsumptionGoalServiceTest.java @@ -6,6 +6,8 @@ import java.time.DayOfWeek; import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.LocalTime; import java.time.temporal.TemporalAdjusters; import java.util.List; import java.util.NoSuchElementException; @@ -308,6 +310,9 @@ void getTopCategoryAndConsumptionAmount_Success() { LocalDate startOfWeek = goalMonthRandomDay.with(TemporalAdjusters.previousOrSame(DayOfWeek.MONDAY)); LocalDate endOfWeek = goalMonthRandomDay.with(TemporalAdjusters.nextOrSame(DayOfWeek.SUNDAY)); + LocalDateTime startOfWeekDateTime = startOfWeek.atStartOfDay(); + LocalDateTime endOfWeekDateTime = endOfWeek.atTime(LocalTime.MAX); + ConsumptionGoal topConsumptionGoal = ConsumptionGoal.builder() .goalAmount(5000L) .consumeAmount(3000L) @@ -338,7 +343,7 @@ void getTopCategoryAndConsumptionAmount_Success() { .willReturn(avgConsumptionGoalList); given(consumptionGoalRepository.findAvgConsumptionByCategoryIdAndCurrentWeek( - defaultCategory.getId(), startOfWeek, endOfWeek, + defaultCategory.getId(), startOfWeekDateTime, endOfWeekDateTime, peerAgeStart, peerAgeEnd, peerGender)) .willReturn(Optional.of(currentWeekConsumptionGoal.getConsumeAmount()));