fix(content): 무료 콘텐츠 포인트 사용 조건을 보정한다
This commit is contained in:
@@ -26,6 +26,7 @@ import kr.co.vividnext.sodalive.member.block.BlockMemberRepository
|
||||
import kr.co.vividnext.sodalive.v2.home.following.application.HomeFollowingNewsPublishService
|
||||
import kr.co.vividnext.sodalive.v2.recommendation.application.CreatorContentViewHistoryService
|
||||
import org.junit.jupiter.api.Assertions.assertEquals
|
||||
import org.junit.jupiter.api.Assertions.assertFalse
|
||||
import org.junit.jupiter.api.Assertions.assertNull
|
||||
import org.junit.jupiter.api.Assertions.assertThrows
|
||||
import org.junit.jupiter.api.Assertions.assertTrue
|
||||
@@ -282,6 +283,50 @@ class AudioContentServiceTest {
|
||||
assertTrue(output.out.contains("contentId=${audioContent.id}"))
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("콘텐츠 상세는 가격과 저장값을 함께 반영해 포인트 사용 가능 여부를 반환한다")
|
||||
fun shouldReturnEffectivePointAvailabilityForAudioDetail() {
|
||||
val viewer = createMember(id = 1004L, nickname = "free-detail-viewer")
|
||||
val creator = createMember(id = 2004L, nickname = "free-detail-creator")
|
||||
val audioContent = createAudioContent(creator)
|
||||
audioContent.price = 0
|
||||
audioContent.isPointAvailable = true
|
||||
stubSuccessfulDetailDependencies(viewer, creator, audioContent)
|
||||
|
||||
val response = service.getDetail(
|
||||
id = audioContent.id!!,
|
||||
member = viewer,
|
||||
isAdultContentVisible = false,
|
||||
timezone = "Asia/Seoul"
|
||||
)
|
||||
|
||||
assertFalse(response.isAvailableUsePoint)
|
||||
|
||||
audioContent.price = 100
|
||||
audioContent.isPointAvailable = false
|
||||
|
||||
val paidUnavailableResponse = service.getDetail(
|
||||
id = audioContent.id!!,
|
||||
member = viewer,
|
||||
isAdultContentVisible = false,
|
||||
timezone = "Asia/Seoul"
|
||||
)
|
||||
|
||||
assertFalse(paidUnavailableResponse.isAvailableUsePoint)
|
||||
|
||||
audioContent.price = 100
|
||||
audioContent.isPointAvailable = true
|
||||
|
||||
val paidAvailableResponse = service.getDetail(
|
||||
id = audioContent.id!!,
|
||||
member = viewer,
|
||||
isAdultContentVisible = false,
|
||||
timezone = "Asia/Seoul"
|
||||
)
|
||||
|
||||
assertTrue(paidAvailableResponse.isAvailableUsePoint)
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("업로드 완료 시 즉시 공개 콘텐츠는 최근 소식을 발행한다")
|
||||
fun shouldPublishNewsWhenUploadCompleteMakesContentPublicImmediately() {
|
||||
|
||||
Reference in New Issue
Block a user