test #432

Merged
klaus merged 17 commits from test into main 2026-07-07 18:07:28 +00:00
4 changed files with 25 additions and 0 deletions
Showing only changes of commit 95ffb69911 - Show all commits

View File

@@ -77,6 +77,7 @@ data class CreatorChannelCommunityCommentsResponse(
data class CreatorChannelCommunityCommentResponse(
val commentId: Long,
val writerId: Long,
val writerProfileImageUrl: String,
val writerNickname: String,
val content: String,
@@ -87,6 +88,7 @@ data class CreatorChannelCommunityCommentResponse(
fun from(comment: CreatorChannelCommunityComment): CreatorChannelCommunityCommentResponse {
return CreatorChannelCommunityCommentResponse(
commentId = comment.commentId,
writerId = comment.writerId,
writerProfileImageUrl = comment.writerProfileImageUrl,
writerNickname = comment.writerNickname,
content = comment.content,
@@ -120,6 +122,7 @@ data class CreatorChannelCommunityRepliesResponse(
data class CreatorChannelCommunityReplyResponse(
val commentId: Long,
val writerId: Long,
val writerProfileImageUrl: String,
val writerNickname: String,
val content: String,
@@ -129,6 +132,7 @@ data class CreatorChannelCommunityReplyResponse(
fun from(reply: CreatorChannelCommunityReply): CreatorChannelCommunityReplyResponse {
return CreatorChannelCommunityReplyResponse(
commentId = reply.commentId,
writerId = reply.writerId,
writerProfileImageUrl = reply.writerProfileImageUrl,
writerNickname = reply.writerNickname,
content = reply.content,

View File

@@ -180,7 +180,9 @@ class CreatorChannelCommunityControllerTest @Autowired constructor(
.andExpect(jsonPath("$.data.postId").value(101))
.andExpect(jsonPath("$.data.isLiked").value(true))
.andExpect(jsonPath("$.data.comments.commentCount").value(1))
.andExpect(jsonPath("$.data.comments.comments[0].writerId").value(20))
.andExpect(jsonPath("$.data.comments.comments[0].latestReply.commentId").value(202))
.andExpect(jsonPath("$.data.comments.comments[0].latestReply.writerId").value(21))
}
@Test
@@ -203,7 +205,9 @@ class CreatorChannelCommunityControllerTest @Autowired constructor(
)
.andExpect(status().isOk)
.andExpect(jsonPath("$.data.commentCount").value(1))
.andExpect(jsonPath("$.data.comments[0].writerId").value(20))
.andExpect(jsonPath("$.data.comments[0].latestReply.commentId").value(202))
.andExpect(jsonPath("$.data.comments[0].latestReply.writerId").value(21))
.andExpect(jsonPath("$.data.hasNext").value(false))
}
@@ -259,6 +263,7 @@ class CreatorChannelCommunityControllerTest @Autowired constructor(
.andExpect(status().isOk)
.andExpect(jsonPath("$.data.replyCount").value(1))
.andExpect(jsonPath("$.data.replies[0].commentId").value(202))
.andExpect(jsonPath("$.data.replies[0].writerId").value(21))
.andExpect(jsonPath("$.data.replies[0].latestReply").doesNotExist())
}
@@ -368,12 +373,14 @@ class CreatorChannelCommunityControllerTest @Autowired constructor(
comments = listOf(
CreatorChannelCommunityCommentResponse(
commentId = 201L,
writerId = 20L,
writerProfileImageUrl = "https://cdn.test/writer.png",
writerNickname = "writer",
content = "comment",
createdAtUtc = "2026-07-06T03:00:00Z",
latestReply = CreatorChannelCommunityReplyResponse(
commentId = 202L,
writerId = 21L,
writerProfileImageUrl = "https://cdn.test/replier.png",
writerNickname = "replier",
content = "reply",
@@ -393,6 +400,7 @@ class CreatorChannelCommunityControllerTest @Autowired constructor(
replies = listOf(
CreatorChannelCommunityReplyResponse(
commentId = 202L,
writerId = 21L,
writerProfileImageUrl = "https://cdn.test/replier.png",
writerNickname = "replier",
content = "reply",

View File

@@ -106,6 +106,8 @@ class CreatorChannelCommunityFacadeTest {
assertEquals(101L, response.postId)
assertTrue(response.isLiked)
assertEquals(1, response.comments.commentCount)
assertEquals(20L, response.comments.comments.first().writerId)
assertEquals(21L, response.comments.comments.first().latestReply?.writerId)
assertEquals(201L, response.comments.comments.first().latestReply?.commentId)
}
@@ -123,6 +125,8 @@ class CreatorChannelCommunityFacadeTest {
assertEquals(1, response.commentCount)
assertEquals(0, response.page)
assertEquals(20, response.size)
assertEquals(20L, response.comments.first().writerId)
assertEquals(21L, response.comments.first().latestReply?.writerId)
assertEquals(201L, response.comments.first().latestReply?.commentId)
}
@@ -139,6 +143,7 @@ class CreatorChannelCommunityFacadeTest {
assertEquals(1, response.replyCount)
assertEquals(201L, response.replies.first().commentId)
assertEquals(21L, response.replies.first().writerId)
assertTrue(response.hasNext)
}
@@ -208,6 +213,7 @@ class CreatorChannelCommunityFacadeTest {
comments = listOf(
CreatorChannelCommunityComment(
commentId = 200L,
writerId = 20L,
writerProfileImageUrl = "https://cdn.test/writer.png",
writerNickname = "writer",
content = "comment",
@@ -226,6 +232,7 @@ class CreatorChannelCommunityFacadeTest {
replies = listOf(
CreatorChannelCommunityReply(
commentId = 201L,
writerId = 21L,
writerProfileImageUrl = "https://cdn.test/replier.png",
writerNickname = "replier",
content = "reply",

View File

@@ -31,14 +31,18 @@ class CreatorChannelCommunityPostDetailResponseTest {
assertTrue(detailJson["isLiked"].asBoolean())
assertTrue(detailJson["comments"]["hasNext"].asBoolean())
assertTrue(detailJson["comments"]["comments"][0].has("latestReply"))
assertTrue(detailJson["comments"]["comments"][0].has("writerId"))
assertTrue(detailJson["comments"]["comments"][0]["latestReply"].has("commentId"))
assertTrue(detailJson["comments"]["comments"][0]["latestReply"].has("writerId"))
assertTrue(repliesJson["hasNext"].asBoolean())
assertTrue(repliesJson["replies"][0].has("writerId"))
assertFalse(repliesJson["replies"][0].has("latestReply"))
}
private fun createDetail(): CreatorChannelCommunityPostDetail {
val reply = CreatorChannelCommunityReply(
commentId = 2L,
writerId = 20L,
writerProfileImageUrl = "https://cdn.test/reply.png",
writerNickname = "reply-writer",
content = "reply",
@@ -67,6 +71,7 @@ class CreatorChannelCommunityPostDetailResponseTest {
comments = listOf(
CreatorChannelCommunityComment(
commentId = 1L,
writerId = 10L,
writerProfileImageUrl = "https://cdn.test/comment.png",
writerNickname = "comment-writer",
content = "comment",
@@ -86,6 +91,7 @@ class CreatorChannelCommunityPostDetailResponseTest {
replies = listOf(
CreatorChannelCommunityReply(
commentId = 2L,
writerId = 20L,
writerProfileImageUrl = "https://cdn.test/reply.png",
writerNickname = "reply-writer",
content = "reply",