diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/v2/content/recommendation/application/AudioRecommendationSnapshotRefreshService.kt b/src/main/kotlin/kr/co/vividnext/sodalive/v2/content/recommendation/application/AudioRecommendationSnapshotRefreshService.kt index c6c7ece9..56ced142 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/v2/content/recommendation/application/AudioRecommendationSnapshotRefreshService.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/v2/content/recommendation/application/AudioRecommendationSnapshotRefreshService.kt @@ -68,7 +68,7 @@ class AudioRecommendationSnapshotRefreshService( visibility: AudioRecommendationVisibility ) { val sectionType = visibility.newAndHotSectionType() - val snapshots = queryPort.findNewAndHotSnapshots(windowStart, snapshotAt, visibility, NEW_AND_HOT_LIMIT) + val snapshots = queryPort.findNewAndHotSnapshots(windowStart, snapshotAt, visibility, NEW_AND_HOT_SNAPSHOT_LIMIT) snapshotPort.replaceSnapshots(sectionType, snapshotAt, snapshots) } @@ -128,7 +128,7 @@ class AudioRecommendationSnapshotRefreshService( } companion object { - const val NEW_AND_HOT_LIMIT = 12 + const val NEW_AND_HOT_SNAPSHOT_LIMIT = 100 const val MOST_COMMENTED_LIMIT = 5 const val RECOMMENDED_AUDIO_LIMIT = 10 private val KST_ZONE: ZoneId = ZoneId.of("Asia/Seoul") diff --git a/src/test/kotlin/kr/co/vividnext/sodalive/v2/content/recommendation/application/AudioRecommendationSnapshotRefreshServiceTest.kt b/src/test/kotlin/kr/co/vividnext/sodalive/v2/content/recommendation/application/AudioRecommendationSnapshotRefreshServiceTest.kt index 05718366..ddee8e35 100644 --- a/src/test/kotlin/kr/co/vividnext/sodalive/v2/content/recommendation/application/AudioRecommendationSnapshotRefreshServiceTest.kt +++ b/src/test/kotlin/kr/co/vividnext/sodalive/v2/content/recommendation/application/AudioRecommendationSnapshotRefreshServiceTest.kt @@ -30,7 +30,7 @@ class AudioRecommendationSnapshotRefreshServiceTest { newAndHotWindowStart, snapshotAt, AudioRecommendationVisibility.SAFE, - AudioRecommendationSnapshotRefreshService.NEW_AND_HOT_LIMIT + AudioRecommendationSnapshotRefreshService.NEW_AND_HOT_SNAPSHOT_LIMIT ) Mockito.verify(queryPort).findMostCommentedSnapshots( mostCommentedWindowStart, @@ -66,7 +66,7 @@ class AudioRecommendationSnapshotRefreshServiceTest { newAndHotWindowStart, snapshotAt, AudioRecommendationVisibility.SAFE, - AudioRecommendationSnapshotRefreshService.NEW_AND_HOT_LIMIT + AudioRecommendationSnapshotRefreshService.NEW_AND_HOT_SNAPSHOT_LIMIT ) Mockito.verify(queryPort).findMostCommentedSnapshots( mostCommentedWindowStart, @@ -81,4 +81,27 @@ class AudioRecommendationSnapshotRefreshServiceTest { AudioRecommendationSnapshotRefreshService.RECOMMENDED_AUDIO_LIMIT ) } + + @Test + @DisplayName("New & Hot 스냅샷은 visibility별 100개 후보를 저장한다") + fun shouldRequestOneHundredNewAndHotSnapshotsPerVisibility() { + val now = LocalDateTime.of(2026, 6, 27, 0, 0, 0) + val snapshotAt = LocalDateTime.of(2026, 6, 26, 23, 59, 59) + val windowStart = LocalDateTime.of(2026, 6, 24, 0, 0, 0) + + service.refreshDailySnapshots(now) + + Mockito.verify(queryPort).findNewAndHotSnapshots( + windowStart, + snapshotAt, + AudioRecommendationVisibility.SAFE, + 100 + ) + Mockito.verify(queryPort).findNewAndHotSnapshots( + windowStart, + snapshotAt, + AudioRecommendationVisibility.ALL, + 100 + ) + } }