fix(home): 홈 추천 포인트 응답 필드명을 고정한다
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
package kr.co.vividnext.sodalive.v2.api.home.dto
|
||||
|
||||
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
|
||||
import org.junit.jupiter.api.Assertions.assertEquals
|
||||
import org.junit.jupiter.api.Assertions.assertFalse
|
||||
import org.junit.jupiter.api.Test
|
||||
|
||||
class HomeRecommendationResponseTest {
|
||||
private val objectMapper = jacksonObjectMapper()
|
||||
|
||||
@Test
|
||||
fun shouldSerializeNewHomeRecommendationFields() {
|
||||
val response = HomeRecommendationResponse(
|
||||
lives = emptyList(),
|
||||
banners = emptyList(),
|
||||
recentlyActiveCreators = emptyList(),
|
||||
recentDebutCreators = emptyList(),
|
||||
firstAudioContents = listOf(
|
||||
HomeFirstAudioContentItem(
|
||||
contentId = 1L,
|
||||
creatorId = 2L,
|
||||
creatorNickname = "creator",
|
||||
creatorProfileImage = "https://cdn.test/profile/creator.png",
|
||||
title = "first audio",
|
||||
coverImage = "https://cdn.test/cover/audio.png",
|
||||
releaseDate = "2026-06-01T00:00:00Z",
|
||||
isPointAvailable = true
|
||||
)
|
||||
),
|
||||
aiCharacters = listOf(
|
||||
HomeAiCharacterItem(
|
||||
characterId = 3L,
|
||||
name = "character",
|
||||
description = "description",
|
||||
profileImage = "https://cdn.test/profile/character.png",
|
||||
totalChatCount = 4L,
|
||||
originalWorkTitle = "original"
|
||||
)
|
||||
),
|
||||
genreCreators = emptyList(),
|
||||
cheerCreators = emptyList(),
|
||||
popularCommunities = emptyList()
|
||||
)
|
||||
|
||||
val json = objectMapper.readTree(objectMapper.writeValueAsString(response))
|
||||
|
||||
assertEquals(true, json["firstAudioContents"][0]["isPointAvailable"].asBoolean())
|
||||
assertFalse(json["firstAudioContents"][0].has("pointAvailable"))
|
||||
assertEquals("https://cdn.test/profile/character.png", json["aiCharacters"][0]["profileImage"].asText())
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user