Skip to content

Commit

Permalink
refactor: deletedAt 검증 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
minjo-on committed Jan 17, 2025
1 parent 799b0fb commit 536f5c2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit 536f5c2

Please sign in to comment.