test #426
@@ -68,7 +68,7 @@ class AudioRecommendationSnapshotRefreshService(
|
|||||||
visibility: AudioRecommendationVisibility
|
visibility: AudioRecommendationVisibility
|
||||||
) {
|
) {
|
||||||
val sectionType = visibility.newAndHotSectionType()
|
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)
|
snapshotPort.replaceSnapshots(sectionType, snapshotAt, snapshots)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -128,7 +128,7 @@ class AudioRecommendationSnapshotRefreshService(
|
|||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
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 MOST_COMMENTED_LIMIT = 5
|
||||||
const val RECOMMENDED_AUDIO_LIMIT = 10
|
const val RECOMMENDED_AUDIO_LIMIT = 10
|
||||||
private val KST_ZONE: ZoneId = ZoneId.of("Asia/Seoul")
|
private val KST_ZONE: ZoneId = ZoneId.of("Asia/Seoul")
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ class AudioRecommendationSnapshotRefreshServiceTest {
|
|||||||
newAndHotWindowStart,
|
newAndHotWindowStart,
|
||||||
snapshotAt,
|
snapshotAt,
|
||||||
AudioRecommendationVisibility.SAFE,
|
AudioRecommendationVisibility.SAFE,
|
||||||
AudioRecommendationSnapshotRefreshService.NEW_AND_HOT_LIMIT
|
AudioRecommendationSnapshotRefreshService.NEW_AND_HOT_SNAPSHOT_LIMIT
|
||||||
)
|
)
|
||||||
Mockito.verify(queryPort).findMostCommentedSnapshots(
|
Mockito.verify(queryPort).findMostCommentedSnapshots(
|
||||||
mostCommentedWindowStart,
|
mostCommentedWindowStart,
|
||||||
@@ -66,7 +66,7 @@ class AudioRecommendationSnapshotRefreshServiceTest {
|
|||||||
newAndHotWindowStart,
|
newAndHotWindowStart,
|
||||||
snapshotAt,
|
snapshotAt,
|
||||||
AudioRecommendationVisibility.SAFE,
|
AudioRecommendationVisibility.SAFE,
|
||||||
AudioRecommendationSnapshotRefreshService.NEW_AND_HOT_LIMIT
|
AudioRecommendationSnapshotRefreshService.NEW_AND_HOT_SNAPSHOT_LIMIT
|
||||||
)
|
)
|
||||||
Mockito.verify(queryPort).findMostCommentedSnapshots(
|
Mockito.verify(queryPort).findMostCommentedSnapshots(
|
||||||
mostCommentedWindowStart,
|
mostCommentedWindowStart,
|
||||||
@@ -81,4 +81,27 @@ class AudioRecommendationSnapshotRefreshServiceTest {
|
|||||||
AudioRecommendationSnapshotRefreshService.RECOMMENDED_AUDIO_LIMIT
|
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
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user