|
|
|
|
@@ -99,8 +99,8 @@ class DefaultHomeRecommendationQueryRepositoryTest @Autowired constructor(
|
|
|
|
|
val oldest = saveLiveRoom(creator, baseAt, channelName = "paged-live-oldest", isAdult = false)
|
|
|
|
|
flushAndClear()
|
|
|
|
|
|
|
|
|
|
val page0 = repository.findLiveRecommendations(offset = 0, limit = 3, includeAdultLives = false)
|
|
|
|
|
val page1 = repository.findLiveRecommendations(offset = 2, limit = 3, includeAdultLives = false)
|
|
|
|
|
val page0 = repository.findLiveRecommendations(offset = 0L, limit = 3, includeAdultLives = false)
|
|
|
|
|
val page1 = repository.findLiveRecommendations(offset = 2L, limit = 3, includeAdultLives = false)
|
|
|
|
|
|
|
|
|
|
assertEquals(listOf(newest.id, middle.id, oldest.id), page0.map { it.liveRoomId })
|
|
|
|
|
assertEquals(listOf(oldest.id), page1.map { it.liveRoomId })
|
|
|
|
|
@@ -1032,8 +1032,8 @@ class DefaultHomeRecommendationQueryRepositoryTest @Autowired constructor(
|
|
|
|
|
updateCreatedAt("AudioContentLike", like.id!!, now.minusHours(1))
|
|
|
|
|
flushAndClear()
|
|
|
|
|
|
|
|
|
|
val page0 = repository.findRecentDebutCreators(now, offset = 0, limit = 2, includeAdultContents = false)
|
|
|
|
|
val page1 = repository.findRecentDebutCreators(now, offset = 1, limit = 2, includeAdultContents = false)
|
|
|
|
|
val page0 = repository.findRecentDebutCreators(now, offset = 0L, limit = 2, includeAdultContents = false)
|
|
|
|
|
val page1 = repository.findRecentDebutCreators(now, offset = 1L, limit = 2, includeAdultContents = false)
|
|
|
|
|
|
|
|
|
|
assertEquals(listOf(normalNewest.id, normalOldest.id), page0.map { it.creatorId })
|
|
|
|
|
assertEquals(listOf(normalOldest.id), page1.map { it.creatorId })
|
|
|
|
|
@@ -1071,9 +1071,9 @@ class DefaultHomeRecommendationQueryRepositoryTest @Autowired constructor(
|
|
|
|
|
saveAudioContent(creator3, now.minusDays(5), isActive = true)
|
|
|
|
|
flushAndClear()
|
|
|
|
|
|
|
|
|
|
val page0 = repository.findRecentDebutCreators(now, offset = 0, limit = 1, includeAdultContents = false)
|
|
|
|
|
val page1 = repository.findRecentDebutCreators(now, offset = 1, limit = 1, includeAdultContents = false)
|
|
|
|
|
val page2 = repository.findRecentDebutCreators(now, offset = 2, limit = 1, includeAdultContents = false)
|
|
|
|
|
val page0 = repository.findRecentDebutCreators(now, offset = 0L, limit = 1, includeAdultContents = false)
|
|
|
|
|
val page1 = repository.findRecentDebutCreators(now, offset = 1L, limit = 1, includeAdultContents = false)
|
|
|
|
|
val page2 = repository.findRecentDebutCreators(now, offset = 2L, limit = 1, includeAdultContents = false)
|
|
|
|
|
|
|
|
|
|
val pagedCreatorIds = (page0 + page1 + page2).map { it.creatorId }
|
|
|
|
|
assertEquals(setOf(creator1.id, creator2.id, creator3.id), pagedCreatorIds.toSet())
|
|
|
|
|
@@ -1157,8 +1157,8 @@ class DefaultHomeRecommendationQueryRepositoryTest @Autowired constructor(
|
|
|
|
|
val oldest = saveAudioContent(oldestCreator, now.minusDays(21), isActive = true, isAdult = false)
|
|
|
|
|
flushAndClear()
|
|
|
|
|
|
|
|
|
|
val page0 = repository.findFirstAudioContents(now, offset = 0, limit = 2, includeAdultContents = false)
|
|
|
|
|
val page1 = repository.findFirstAudioContents(now, offset = 1, limit = 2, includeAdultContents = false)
|
|
|
|
|
val page0 = repository.findFirstAudioContents(now, offset = 0L, limit = 2, includeAdultContents = false)
|
|
|
|
|
val page1 = repository.findFirstAudioContents(now, offset = 1L, limit = 2, includeAdultContents = false)
|
|
|
|
|
|
|
|
|
|
assertEquals(listOf(newest.id, oldest.id), page0.map { it.contentId })
|
|
|
|
|
assertEquals(listOf(oldest.id), page1.map { it.contentId })
|
|
|
|
|
@@ -1196,9 +1196,9 @@ class DefaultHomeRecommendationQueryRepositoryTest @Autowired constructor(
|
|
|
|
|
val content3 = saveAudioContent(creator3, now.minusDays(5), isActive = true)
|
|
|
|
|
flushAndClear()
|
|
|
|
|
|
|
|
|
|
val page0 = repository.findFirstAudioContents(now, offset = 0, limit = 1, includeAdultContents = false)
|
|
|
|
|
val page1 = repository.findFirstAudioContents(now, offset = 1, limit = 1, includeAdultContents = false)
|
|
|
|
|
val page2 = repository.findFirstAudioContents(now, offset = 2, limit = 1, includeAdultContents = false)
|
|
|
|
|
val page0 = repository.findFirstAudioContents(now, offset = 0L, limit = 1, includeAdultContents = false)
|
|
|
|
|
val page1 = repository.findFirstAudioContents(now, offset = 1L, limit = 1, includeAdultContents = false)
|
|
|
|
|
val page2 = repository.findFirstAudioContents(now, offset = 2L, limit = 1, includeAdultContents = false)
|
|
|
|
|
|
|
|
|
|
val pagedContentIds = (page0 + page1 + page2).map { it.contentId }
|
|
|
|
|
assertEquals(setOf(content1.id, content2.id, content3.id), pagedContentIds.toSet())
|
|
|
|
|
|