diff --git a/src/main/java/com/dnd/runus/application/running/RunningRecordService.java b/src/main/java/com/dnd/runus/application/running/RunningRecordService.java index a680aa7a..2680c133 100644 --- a/src/main/java/com/dnd/runus/application/running/RunningRecordService.java +++ b/src/main/java/com/dnd/runus/application/running/RunningRecordService.java @@ -144,13 +144,13 @@ public RunningRecordWeeklySummaryResponse getWeeklySummary( weekSummaries = runningRecordRepository.findDailyDistancesMeterByDateRange( memberId, startWeekDate, nextOfEndWeekDate); avgValue = runningRecordRepository.findAvgDistanceMeterByMemberIdAndDateRange( - memberId, startWeekDate, nextOfEndWeekDate); + memberId, startWeekDate.minusDays(7), nextOfEndWeekDate.minusDays(7)); conversionFactor = METERS_IN_A_KILOMETER; } else { weekSummaries = runningRecordRepository.findDailyDurationsSecByDateRange( memberId, startWeekDate, nextOfEndWeekDate); avgValue = runningRecordRepository.findAvgDurationSecByMemberIdAndDateRange( - memberId, startWeekDate, nextOfEndWeekDate); + memberId, startWeekDate.minusDays(7), nextOfEndWeekDate.minusDays(7)); conversionFactor = SECONDS_PER_HOUR; } diff --git a/src/test/java/com/dnd/runus/application/running/RunningRecordServiceTest.java b/src/test/java/com/dnd/runus/application/running/RunningRecordServiceTest.java index 73d957de..8296f3e4 100644 --- a/src/test/java/com/dnd/runus/application/running/RunningRecordServiceTest.java +++ b/src/test/java/com/dnd/runus/application/running/RunningRecordServiceTest.java @@ -470,7 +470,7 @@ void getWeeklySummary_Distance() { .willReturn(List.of(new DailyRunningRecordSummary(runningDate.toLocalDate(), 3567))); given(runningRecordRepository.findAvgDistanceMeterByMemberIdAndDateRange( - memberId, startWeekDate, nextOfEndWeekDate)) + memberId, startWeekDate.minusDays(7), nextOfEndWeekDate.minusDays(7))) .willReturn(800); // when @@ -505,7 +505,7 @@ void getWeeklySummary_Duration() { .willReturn(List.of(new DailyRunningRecordSummary(runningDate.toLocalDate(), runningDurationSec))); given(runningRecordRepository.findAvgDurationSecByMemberIdAndDateRange( - memberId, startWeekDate, nextOfEndWeekDate)) + memberId, startWeekDate.minusDays(7), nextOfEndWeekDate.minusDays(7))) .willReturn(runningDurationSec); // when