Skip to content

Commit aa4c350

Browse files
committed
test: 시간 비교를 instant로 하도록 변경
1 parent 08dc602 commit aa4c350

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

src/test/java/com/example/solidconnection/community/comment/service/CommentServiceTest.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,10 @@ class 댓글_조회_테스트 {
7171
() -> assertThat(response.parentId()).isNull(),
7272
() -> assertThat(response.content()).isEqualTo(parentComment.getContent()),
7373
() -> assertThat(response.isOwner()).isTrue(),
74-
() -> assertThat(response.createdAt()).isEqualTo(parentComment.getCreatedAt()),
75-
() -> assertThat(response.updatedAt()).isEqualTo(parentComment.getUpdatedAt()),
74+
() -> assertThat(response.createdAt().toInstant())
75+
.isEqualTo(parentComment.getCreatedAt().toInstant()),
76+
() -> assertThat(response.updatedAt().toInstant())
77+
.isEqualTo(parentComment.getUpdatedAt().toInstant()),
7678

7779
() -> assertThat(response.postFindSiteUserResponse().id())
7880
.isEqualTo(parentComment.getSiteUser().getId()),
@@ -89,8 +91,10 @@ class 댓글_조회_테스트 {
8991
() -> assertThat(response.parentId()).isEqualTo(parentComment.getId()),
9092
() -> assertThat(response.content()).isEqualTo(childComment.getContent()),
9193
() -> assertThat(response.isOwner()).isFalse(),
92-
() -> assertThat(response.createdAt()).isEqualTo(childComment.getCreatedAt()),
93-
() -> assertThat(response.updatedAt()).isEqualTo(childComment.getUpdatedAt()),
94+
() -> assertThat(response.createdAt().toInstant())
95+
.isEqualTo(childComment.getCreatedAt().toInstant()),
96+
() -> assertThat(response.updatedAt().toInstant())
97+
.isEqualTo(childComment.getUpdatedAt().toInstant()),
9498

9599
() -> assertThat(response.postFindSiteUserResponse().id())
96100
.isEqualTo(childComment.getSiteUser().getId()),

0 commit comments

Comments
 (0)