feat(creator-channel): 후원 탭 조회 서비스를 구현한다

This commit is contained in:
2026-06-22 19:17:45 +09:00
parent 13b679d091
commit 046ce700c7
4 changed files with 469 additions and 27 deletions
@@ -10,13 +10,10 @@ import kr.co.vividnext.sodalive.v2.api.creator.channel.donation.application.Crea
import kr.co.vividnext.sodalive.v2.api.creator.channel.donation.dto.CreatorChannelDonationResponse
import kr.co.vividnext.sodalive.v2.api.creator.channel.donation.dto.CreatorChannelDonationTabResponse
import kr.co.vividnext.sodalive.v2.api.creator.channel.donation.dto.MemberDonationRankingResponse
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Assertions.assertNotNull
import org.junit.jupiter.api.DisplayName
import org.junit.jupiter.api.Test
import org.mockito.Mockito
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest
import org.springframework.boot.test.context.TestConfiguration
import org.springframework.boot.test.mock.mockito.MockBean
@@ -28,7 +25,6 @@ import org.springframework.security.test.web.servlet.request.SecurityMockMvcRequ
import org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.user
import org.springframework.security.web.SecurityFilterChain
import org.springframework.security.web.authentication.HttpStatusEntryPoint
import org.springframework.test.context.TestPropertySource
import org.springframework.test.web.servlet.MockMvc
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get
import org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath
@@ -38,7 +34,6 @@ import javax.servlet.http.HttpServletResponse
@WebMvcTest(CreatorChannelDonationController::class)
@Import(CreatorChannelDonationControllerTest.TestSecurityConfig::class)
@TestPropertySource(properties = ["creator-channel.donation-tab.enabled=true"])
class CreatorChannelDonationControllerTest @Autowired constructor(
private val mockMvc: MockMvc
) {
@@ -71,17 +66,6 @@ class CreatorChannelDonationControllerTest @Autowired constructor(
}
}
@Test
@DisplayName("크리에이터 채널 후원 탭 controller는 Phase 2 완료 전 기본 등록되지 않도록 property로 보호된다")
fun shouldProtectDonationControllerWithFeatureProperty() {
val condition = CreatorChannelDonationController::class.java.getAnnotation(ConditionalOnProperty::class.java)
assertNotNull(condition)
assertEquals("creator-channel.donation-tab.enabled", condition.name.first())
assertEquals("true", condition.havingValue)
assertEquals(false, condition.matchIfMissing)
}
@Test
@DisplayName("크리에이터 채널 후원 탭 조회는 비회원 요청을 거부한다")
fun shouldRejectAnonymousCreatorChannelDonationRequest() {