feat(home): 인기 커뮤니티 게시글 응답 필드를 추가한다

This commit is contained in:
2026-06-01 22:40:29 +09:00
parent 12b446c4ae
commit 5d606a257e
3 changed files with 35 additions and 11 deletions

View File

@@ -39,7 +39,21 @@ class HomeRecommendationResponseTest {
),
genreCreators = emptyList(),
cheerCreators = emptyList(),
popularCommunities = emptyList()
popularCommunityPosts = listOf(
HomePopularCommunityPostItem(
postId = 5L,
creatorId = 6L,
creatorNickname = "community-creator",
creatorProfileImage = "https://cdn.test/profile/community.png",
imageUrl = "https://cdn.test/community/image.png",
audioUrl = "https://cdn.test/community/audio.mp3",
content = "community content",
createdAt = "2026-06-01T00:00:00Z",
likeCount = 7L,
commentCount = 8L,
existOrdered = true
)
)
)
val json = objectMapper.readTree(objectMapper.writeValueAsString(response))
@@ -47,5 +61,9 @@ class HomeRecommendationResponseTest {
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())
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(true, json["popularCommunityPosts"][0]["existOrdered"].asBoolean())
}
}