From 7c5d3874dbbbc640911b0f88d0c6dae868034641 Mon Sep 17 00:00:00 2001 From: Klaus Date: Thu, 17 Sep 2026 19:15:27 +0900 Subject: [PATCH] =?UTF-8?q?test(creator-channel):=20=EC=A0=9C=ED=95=9C=20?= =?UTF-8?q?=EB=B0=A9=20=EC=86=8C=EC=9C=A0=EC=9E=90=20=EC=A1=B0=ED=9A=8C?= =?UTF-8?q?=EB=A5=BC=20=EA=B2=80=EC=A6=9D=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ltCreatorChannelLiveQueryRepositoryTest.kt | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) 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() {