From 536f5c24c1a5bf0e208ad992c18b7e3a63dd12d9 Mon Sep 17 00:00:00 2001 From: minjo-on Date: Fri, 17 Jan 2025 14:20:34 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20deletedAt=20=EA=B2=80=EC=A6=9D=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/about/application/AboutQueryServiceTest.java | 5 ++--- .../java/comment/application/CommentQueryServiceTest.java | 4 ++++ .../java/post/application/PostQueryServiceTest.java | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/aics-domain/src/testFixtures/java/about/application/AboutQueryServiceTest.java b/aics-domain/src/testFixtures/java/about/application/AboutQueryServiceTest.java index ed5e5529..f8c6a117 100644 --- a/aics-domain/src/testFixtures/java/about/application/AboutQueryServiceTest.java +++ b/aics-domain/src/testFixtures/java/about/application/AboutQueryServiceTest.java @@ -62,15 +62,14 @@ public void getAbout_NotFound_ThrowsException() { } @Test - @DisplayName("getAbout은 detail이 null 또는 blank일 때도 올바른 About을 반환한다") + @DisplayName("getAbout은 detail이 null 또는 blank여도 요청 시 올바른 About을 반환한다") public void getAbout_WithNullOrBlankDetail_Success() { // given MainCategory main = DEPT_INTRO; SubCategory sub = HISTORY; - String detail = null; // when - About result = aboutQueryService.getAbout(main, sub, detail); + About result = aboutQueryService.getAbout(main, sub, null); // then assertEquals(main, result.getMainCategory()); diff --git a/aics-domain/src/testFixtures/java/comment/application/CommentQueryServiceTest.java b/aics-domain/src/testFixtures/java/comment/application/CommentQueryServiceTest.java index cdda3716..33041c88 100644 --- a/aics-domain/src/testFixtures/java/comment/application/CommentQueryServiceTest.java +++ b/aics-domain/src/testFixtures/java/comment/application/CommentQueryServiceTest.java @@ -3,6 +3,8 @@ import static kgu.developers.domain.post.domain.Category.NEWS; import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.List; @@ -80,6 +82,8 @@ public void getById_Success() { Comment result = commentQueryService.getById(savedCommentId); // then + assertNotNull(result); + assertNull(result.getDeletedAt()); assertEquals(savedCommentId, result.getId()); assertEquals(TARGET_COMMENT_CONTENT, result.getContent()); } diff --git a/aics-domain/src/testFixtures/java/post/application/PostQueryServiceTest.java b/aics-domain/src/testFixtures/java/post/application/PostQueryServiceTest.java index cdff2db5..70b0c77d 100644 --- a/aics-domain/src/testFixtures/java/post/application/PostQueryServiceTest.java +++ b/aics-domain/src/testFixtures/java/post/application/PostQueryServiceTest.java @@ -73,6 +73,7 @@ public void getPostById_Success() { PostTitleResponse next = result.nextPost(); assertEquals(result.postId(), post.getId()); + assertNull(post.getDeletedAt()); assertEquals(1L, prev.postId()); assertEquals("테스트용 제목1", prev.title()); assertEquals(5L, next.postId());