test #433

Merged
klaus merged 41 commits from test into main 2026-07-10 07:20:07 +00:00
2 changed files with 26 additions and 2 deletions
Showing only changes of commit 78f24d774b - Show all commits

View File

@@ -148,8 +148,7 @@ class DefaultHomeRecommendationQueryRepository(
lr.id as target_sort_id
from live_room lr
join member m on m.id = lr.member_id
where lr.is_active = true
and lr.channel_name is not null
where lr.channel_name is not null
and lr.channel_name <> ''
and (:includeAdultActivities = true or lr.is_adult = false)
and m.is_active = true

View File

@@ -437,6 +437,31 @@ class DefaultHomeRecommendationQueryRepositoryTest @Autowired constructor(
assertEquals(communityCreator.id, byCreatorNickname[communityCreator.nickname]!!.targetId)
}
@Test
@DisplayName("최근 활동 크리에이터는 라이브 활성 여부와 무관하게 채널명이 있는 라이브를 포함한다")
fun shouldIncludeInactiveLiveWithChannelNameInRecentlyActiveCreators() {
val baseAt = LocalDateTime.of(2026, 5, 31, 10, 0)
val inactiveLiveCreator = saveMember("activity-inactive-live", MemberRole.CREATOR)
val blankChannelCreator = saveMember("activity-blank-channel", MemberRole.CREATOR)
val emptyChannelCreator = saveMember("activity-empty-channel", MemberRole.CREATOR)
saveLiveRoom(
inactiveLiveCreator,
baseAt.plusMinutes(2),
channelName = "inactive-live-channel",
isActive = false
)
saveLiveRoom(blankChannelCreator, baseAt.plusMinutes(1), channelName = null, isActive = false)
saveLiveRoom(emptyChannelCreator, baseAt, channelName = "", isActive = false)
flushAndClear()
val creators = repository.findRecentlyActiveCreators(limit = 10)
assertEquals(listOf(inactiveLiveCreator.nickname), creators.map { it.creatorNickname })
assertEquals(CreatorActivityType.LIVE, creators.single().activityType)
assertEquals(baseAt.plusMinutes(2), creators.single().activityAt)
assertEquals(null, creators.single().targetId)
}
@Test
@DisplayName("최근 활동 크리에이터는 성인 노출 정책이 꺼져 있으면 성인 라이브/오디오/커뮤니티 활동을 제외한다")
fun shouldExcludeAdultActivitiesFromRecentlyActiveCreatorsWhenAdultHidden() {