diff --git a/src/test/kotlin/kr/co/vividnext/sodalive/v2/creator/channel/live/adapter/out/persistence/DefaultCreatorChannelLiveQueryRepositoryTest.kt b/src/test/kotlin/kr/co/vividnext/sodalive/v2/creator/channel/live/adapter/out/persistence/DefaultCreatorChannelLiveQueryRepositoryTest.kt index 8b3b546c..47a28b97 100644 --- a/src/test/kotlin/kr/co/vividnext/sodalive/v2/creator/channel/live/adapter/out/persistence/DefaultCreatorChannelLiveQueryRepositoryTest.kt +++ b/src/test/kotlin/kr/co/vividnext/sodalive/v2/creator/channel/live/adapter/out/persistence/DefaultCreatorChannelLiveQueryRepositoryTest.kt @@ -239,6 +239,33 @@ class DefaultCreatorChannelLiveQueryRepositoryTest @Autowired constructor( assertEquals(visible.id, live!!.liveId) } + @Test + @DisplayName("채널 소유자는 크리에이터 입장 제한이 설정된 본인 현재 라이브를 조회한다") + fun shouldReturnRestrictedCurrentLiveForChannelOwner() { + val now = LocalDateTime.of(2026, 6, 17, 12, 0) + val creator = saveMember("restricted-live-owner", MemberRole.CREATOR) + val restrictedLive = saveLiveRoom( + creator = creator, + beginDateTime = now.minusMinutes(1), + channelName = "restricted-owner-live", + isAdult = false, + genderRestriction = GenderRestriction.MALE_ONLY, + isAvailableJoinCreator = false + ) + flushAndClear() + + val live = repository.findCurrentLive( + creatorId = creator.id!!, + now = now, + canViewAdultContent = false, + viewerId = creator.id!!, + isViewerCreator = true, + effectiveViewerGender = Gender.MALE + ) + + assertEquals(restrictedLive.id, live!!.liveId) + } + @Test @DisplayName("크리에이터 조회와 차단 관계 조회는 live service port 계약을 만족한다") fun shouldFindCreatorAndBlockedRelationship() {