feat(recommend): 홈 추천 응답 필드를 정리한다

This commit is contained in:
2026-06-05 18:15:19 +09:00
parent 7606796fe3
commit 6b469c1fad
8 changed files with 164 additions and 183 deletions
@@ -438,7 +438,7 @@ class HomeRecommendationControllerTest @Autowired constructor(
.param("size", "1")
)
.andExpect(status().isOk)
.andExpect(jsonPath("$.data.items[0].liveRoomId").value(newest.id))
.andExpect(jsonPath("$.data.items[0].roomId").value(newest.id))
.andExpect(jsonPath("$.data.hasNext").value(true))
}
@@ -461,7 +461,7 @@ class HomeRecommendationControllerTest @Autowired constructor(
.param("size", "1")
)
.andExpect(status().isOk)
.andExpect(jsonPath("$.data.items[0].liveRoomId").value(oldest.id))
.andExpect(jsonPath("$.data.items[0].roomId").value(oldest.id))
.andExpect(jsonPath("$.data.hasNext").value(false))
}
@@ -24,7 +24,6 @@ class HomeRecommendationResponseTest {
title = "first audio",
price = 9,
coverImage = "https://cdn.test/cover/audio.png",
releaseDate = "2026-06-01T00:00:00Z",
isPointAvailable = true
)
),
@@ -36,6 +35,14 @@ class HomeRecommendationResponseTest {
profileImage = "https://cdn.test/profile/character.png",
totalChatCount = 4L,
originalWorkTitle = "original"
),
HomeAiCharacterItem(
characterId = 4L,
name = "character-without-image",
description = "description",
profileImage = null,
totalChatCount = 5L,
originalWorkTitle = null
)
),
genreCreators = emptyList(),
@@ -54,6 +61,20 @@ class HomeRecommendationResponseTest {
likeCount = 7L,
commentCount = 8L,
existOrdered = true
),
HomePopularCommunityPostItem(
postId = 9L,
creatorId = 10L,
creatorNickname = "community-creator-without-media",
creatorProfileImage = null,
imageUrl = null,
audioUrl = null,
content = "community content without media",
price = 0,
createdAt = "2026-06-01T00:00:00Z",
likeCount = 0L,
commentCount = 0L,
existOrdered = false
)
)
)
@@ -63,11 +84,16 @@ class HomeRecommendationResponseTest {
assertEquals(9, json["firstAudioContents"][0]["price"].asInt())
assertEquals(true, json["firstAudioContents"][0]["isPointAvailable"].asBoolean())
assertFalse(json["firstAudioContents"][0].has("pointAvailable"))
assertFalse(json["firstAudioContents"][0].has("releaseDate"))
assertEquals("https://cdn.test/profile/character.png", json["aiCharacters"][0]["profileImage"].asText())
assertEquals(true, json["aiCharacters"][1]["profileImage"].isNull)
assertEquals(5L, json["popularCommunityPosts"][0]["postId"].asLong())
assertEquals("https://cdn.test/community/image.png", json["popularCommunityPosts"][0]["imageUrl"].asText())
assertEquals("https://cdn.test/community/audio.mp3", json["popularCommunityPosts"][0]["audioUrl"].asText())
assertEquals(9, json["popularCommunityPosts"][0]["price"].asInt())
assertEquals(true, json["popularCommunityPosts"][0]["existOrdered"].asBoolean())
assertEquals(true, json["popularCommunityPosts"][1]["creatorProfileImage"].isNull)
assertEquals(true, json["popularCommunityPosts"][1]["imageUrl"].isNull)
assertEquals(true, json["popularCommunityPosts"][1]["audioUrl"].isNull)
}
}