test(creator): 채널 홈 통합 회귀를 보강한다
This commit is contained in:
@@ -181,6 +181,114 @@ class DefaultCreatorChannelHomeQueryRepositoryTest @Autowired constructor(
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("크리에이터 채널 홈 통합 fixture는 홈 전체 섹션 후보를 한 번에 조회할 수 있다")
|
||||
fun shouldFindCreatorChannelHomeIntegratedSections() {
|
||||
val now = LocalDateTime.of(2026, 6, 13, 12, 0)
|
||||
val viewer = saveMember("integrated-home-viewer", MemberRole.USER)
|
||||
val creator = saveMember("integrated-home-creator", MemberRole.CREATOR)
|
||||
creator.introduce = "integrated introduce"
|
||||
creator.instagramUrl = "integrated-instagram"
|
||||
creator.fancimmUrl = "integrated-fancimm"
|
||||
creator.xUrl = "integrated-x"
|
||||
creator.youtubeUrl = "integrated-youtube"
|
||||
creator.websiteUrl = "integrated-kakao"
|
||||
val donor = saveMember("integrated-home-donor", MemberRole.USER)
|
||||
val fan = saveMember("integrated-home-fan", MemberRole.USER)
|
||||
val currentLive = saveLiveRoom(creator, now.minusHours(2), channelName = "integrated-live", isAdult = false)
|
||||
val liveSchedule = saveLiveRoom(creator, now.plusHours(1), channelName = null, isAdult = false)
|
||||
val audioSchedule = saveAudioContent(creator, now.plusHours(2), isAdult = false)
|
||||
val firstAudio = saveAudioContent(creator, now.minusDays(3), isAdult = false)
|
||||
val listAudio = saveAudioContent(
|
||||
creator,
|
||||
now.minusDays(2),
|
||||
isAdult = false,
|
||||
price = 100,
|
||||
isPointAvailable = true
|
||||
)
|
||||
val latestAudio = saveAudioContent(creator, now.minusDays(1), isAdult = false, price = 200)
|
||||
val series = saveSeries("integrated-home-series", creator, isOriginal = true)
|
||||
saveSeriesContent(series, listAudio)
|
||||
val donation = saveDonation(creator, donor, 500, now.minusHours(3), additionalMessage = "integrated thanks")
|
||||
val notice = saveCommunity(creator, isFixed = true, fixedAt = now.minusHours(4), price = 0)
|
||||
val community = saveCommunity(
|
||||
creator,
|
||||
isFixed = false,
|
||||
price = 100,
|
||||
imagePath = "community.png",
|
||||
audioPath = "community.mp3"
|
||||
)
|
||||
saveCommunityOrder(viewer, community, isRefund = false)
|
||||
saveCommunityLike(viewer, community, isActive = true)
|
||||
saveCommunityComment(viewer, community, isActive = true)
|
||||
val fanTalk = saveCheers(fan, creator, "integrated fan talk", isActive = true, now.minusMinutes(30))
|
||||
saveVisit(currentLive, viewer)
|
||||
flushAndClear()
|
||||
updateUpdatedAt("LiveRoom", currentLive.id!!, now.minusHours(1))
|
||||
flushAndClear()
|
||||
|
||||
val creatorRecord = repository.findCreator(creator.id!!, viewer.id!!)
|
||||
val currentLiveRecord = repository.findCurrentLive(
|
||||
creator.id!!,
|
||||
now,
|
||||
canViewAdultContent = false,
|
||||
viewerId = viewer.id!!,
|
||||
isViewerCreator = false,
|
||||
effectiveViewerGender = null
|
||||
)
|
||||
val latestAudioRecord = repository.findLatestAudioContent(creator.id!!, now, canViewAdultContent = false)
|
||||
val donations = repository.findChannelDonations(creator.id!!, viewer.id!!, now, limit = 8)
|
||||
val notices = repository.findCommunityPosts(creator.id!!, viewer.id!!, isFixed = true, false, limit = 3)
|
||||
val schedules = repository.findSchedules(
|
||||
creator.id!!,
|
||||
now,
|
||||
canViewAdultContent = false,
|
||||
viewerId = viewer.id!!,
|
||||
isViewerCreator = false,
|
||||
effectiveViewerGender = null,
|
||||
limit = 3
|
||||
)
|
||||
val audioContents = repository.findAudioContents(
|
||||
creator.id!!,
|
||||
now,
|
||||
latestAudioContentId = latestAudioRecord!!.audioContentId,
|
||||
canViewAdultContent = false,
|
||||
limit = 9
|
||||
)
|
||||
val seriesRecords = repository.findSeries(creator.id!!, viewer.id!!, now, false, ContentType.ALL, limit = 8)
|
||||
val communities = repository.findCommunityPosts(creator.id!!, viewer.id!!, isFixed = false, false, limit = 3)
|
||||
val fanTalkSummary = repository.findFanTalkSummary(creator.id!!, viewer.id!!)
|
||||
val activity = repository.findActivity(creator.id!!, now)
|
||||
val sns = repository.findSns(creator.id!!)
|
||||
|
||||
assertEquals(creator.id, creatorRecord!!.creatorId)
|
||||
assertEquals("integrated introduce", creatorRecord.introduce)
|
||||
assertEquals(currentLive.id, currentLiveRecord!!.liveId)
|
||||
assertEquals(latestAudio.id, latestAudioRecord.audioContentId)
|
||||
assertEquals(listOf(donation.can), donations.map { it.can })
|
||||
assertEquals("integrated thanks", donations.single().message)
|
||||
assertEquals(listOf(notice.id), notices.map { it.postId })
|
||||
assertEquals(listOf(liveSchedule.id, audioSchedule.id), schedules.map { it.targetId })
|
||||
assertEquals(listOf(CreatorActivityType.LIVE, CreatorActivityType.AUDIO), schedules.map { it.type })
|
||||
assertEquals(listOf(listAudio.id, firstAudio.id), audioContents.map { it.audioContentId })
|
||||
assertEquals(listOf(series.id), seriesRecords.map { it.seriesId })
|
||||
assertEquals(true, seriesRecords.single().isOriginal)
|
||||
assertEquals(listOf(community.id), communities.map { it.postId })
|
||||
assertEquals(1, communities.single().likeCount)
|
||||
assertEquals(1, communities.single().commentCount)
|
||||
assertTrue(communities.single().existOrdered)
|
||||
assertEquals(1, fanTalkSummary.totalCount)
|
||||
assertEquals(fanTalk.id, fanTalkSummary.latestFanTalk!!.fanTalkId)
|
||||
assertEquals(now.minusDays(3), activity.debutDate)
|
||||
assertEquals(1, activity.liveCount)
|
||||
assertEquals(1, activity.liveDurationHours)
|
||||
assertEquals(1, activity.liveContributorCount)
|
||||
assertEquals(3, activity.audioContentCount)
|
||||
assertEquals(1, activity.seriesCount)
|
||||
assertEquals("integrated-instagram", sns.instagramUrl)
|
||||
assertEquals("integrated-kakao", sns.kakaoOpenChatUrl)
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("비활성 팔로우는 알림 상태도 false로 조회한다")
|
||||
fun shouldNotExposeNotifyForInactiveFollowing() {
|
||||
|
||||
Reference in New Issue
Block a user