diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/explorer/profile/creatorCommunity/CreatorCommunityService.kt b/src/main/kotlin/kr/co/vividnext/sodalive/explorer/profile/creatorCommunity/CreatorCommunityService.kt index 77dd3649..96cd4fda 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/explorer/profile/creatorCommunity/CreatorCommunityService.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/explorer/profile/creatorCommunity/CreatorCommunityService.kt @@ -145,6 +145,8 @@ class CreatorCommunityService( } private fun publishCommunityPostCreatedAfterCommit(post: CreatorCommunity, member: Member) { + if (post.price > 0) return + val occurredAtUtc = post.createdAt ?: LocalDateTime.now() val newsContent = post.newsContentPreview() afterCommit { diff --git a/src/test/kotlin/kr/co/vividnext/sodalive/explorer/profile/creatorCommunity/CreatorCommunityServiceTest.kt b/src/test/kotlin/kr/co/vividnext/sodalive/explorer/profile/creatorCommunity/CreatorCommunityServiceTest.kt index b7d1dee5..48c91ca1 100644 --- a/src/test/kotlin/kr/co/vividnext/sodalive/explorer/profile/creatorCommunity/CreatorCommunityServiceTest.kt +++ b/src/test/kotlin/kr/co/vividnext/sodalive/explorer/profile/creatorCommunity/CreatorCommunityServiceTest.kt @@ -330,15 +330,14 @@ class CreatorCommunityServiceTest { } @Test - @DisplayName("유료 커뮤니티 게시글 최근 소식은 전체 본문을 노출하지 않고 미리보기만 발행한다") - fun shouldPublishPaidCommunityPostNewsWithMaskedContent() { + @DisplayName("유료 커뮤니티 게시글 생성 성공 후 최근 소식을 발행하지 않는다") + fun shouldNotPublishNewsAfterPaidCommunityPostCreated() { val creator = createMember(id = 910L, role = MemberRole.CREATOR, nickname = "paid-community-creator") val fullContent = "유료 커뮤니티 게시글 전체 본문은 최근 소식에서 노출되면 안 됩니다" - val createdAt = LocalDateTime.of(2026, 6, 25, 11, 0) Mockito.`when`(repository.save(Mockito.any(CreatorCommunity::class.java))).thenAnswer { invocation -> val post = invocation.getArgument(0) post.id = 911L - post.createdAt = createdAt + post.createdAt = LocalDateTime.of(2026, 6, 25, 11, 0) post } Mockito.`when`( @@ -357,17 +356,7 @@ class CreatorCommunityServiceTest { member = creator ) - Mockito.verify(homeFollowingNewsPublishService).publishCommunityPostCreated( - postId = 911L, - creatorId = creator.id!!, - creatorNickname = creator.nickname!!, - creatorProfileImagePath = creator.profileImage, - title = "유료 커뮤니티 게시글 전체 ...", - body = "유료 커뮤니티 게시글 전체 ...", - thumbnailImagePath = "creator_community/911/911-image.png", - occurredAtUtc = createdAt, - isAdult = false - ) + Mockito.verifyNoInteractions(homeFollowingNewsPublishService) } @Test diff --git a/src/test/kotlin/kr/co/vividnext/sodalive/v2/home/following/application/HomeFollowingNewsPublishServiceTest.kt b/src/test/kotlin/kr/co/vividnext/sodalive/v2/home/following/application/HomeFollowingNewsPublishServiceTest.kt index 882bf4cb..a0407c2d 100644 --- a/src/test/kotlin/kr/co/vividnext/sodalive/v2/home/following/application/HomeFollowingNewsPublishServiceTest.kt +++ b/src/test/kotlin/kr/co/vividnext/sodalive/v2/home/following/application/HomeFollowingNewsPublishServiceTest.kt @@ -10,8 +10,8 @@ import java.time.LocalDateTime class HomeFollowingNewsPublishServiceTest { @Test - @DisplayName("커뮤니티 게시글 발행은 현재 활성 팔로워에게만 inbox record를 생성한다") - fun shouldPublishCommunityPostCreatedToActiveFollowers() { + @DisplayName("무료 커뮤니티 게시글 발행은 현재 활성 팔로워에게만 inbox record를 생성한다") + fun shouldPublishFreeCommunityPostCreatedToActiveFollowers() { val inboxPort = FakeHomeFollowingNewsInboxPort(activeFollowerIds = listOf(1L, 2L)) val service = HomeFollowingNewsPublishService(inboxPort) val occurredAtUtc = LocalDateTime.of(2026, 6, 25, 1, 2, 3)