Skip to content

Commit

Permalink
refactor: 컨벤션 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
minjo-on committed Jan 15, 2025
1 parent 27761d8 commit a667347
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public void createAbout_Success() {
Long result = aboutCommandService.createAbout(mainCategory, subCategory, detail, content);

// then
assertEquals(result, 2L);
assertEquals(2L, result);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ public void getAbout_WithNullOrBlankDetail_Success() {
String detail = null;

// when
About about = aboutQueryService.getAbout(main, sub, detail);
About result = aboutQueryService.getAbout(main, sub, detail);

// then
assertEquals(main, about.getMainCategory());
assertEquals(sub, about.getSubCategory());
assertEquals("detail category", about.getDetailCategory());
assertEquals("about content", about.getContent());
assertEquals(main, result.getMainCategory());
assertEquals(sub, result.getSubCategory());
assertEquals("detail category", result.getDetailCategory());
assertEquals("about content", result.getContent());
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ public void createClub_Success() {
String site = "http://club-c.kyonggi.ac.kr";

//when
Long response = clubCommandService.createClub(name, description, site);
Long result = clubCommandService.createClub(name, description, site);

//then
assertEquals(response, 1L);
assertEquals(1L, result);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ public void createComment_Success() {
Long postId = 1L;

// when
Long response = commentCommandService.createComment(content, postId);
Long result = commentCommandService.createComment(content, postId);

// then
assertEquals(response, 1L);
assertEquals(1L, result);
}

@Test
Expand All @@ -89,7 +89,7 @@ public void updateComment_Success() {
commentCommandService.updateComment(comment, newContent);

// then
assertEquals(comment.getContent(), "content");
assertEquals("content", comment.getContent());
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public void init() {

User user = User.builder()
.build();

Post post = Post.builder()
.id(1L)
.build();
Expand Down Expand Up @@ -57,8 +57,8 @@ public void getComments_Success() {
List<Comment> comments = commentQueryService.getComments(postId);

// then
assertEquals(comments.size(), 1);
assertEquals(comments.get(0).getContent(), "get");
assertEquals(1, comments.size());
assertEquals("get", comments.get(0).getContent());
}

@Test
Expand All @@ -68,11 +68,11 @@ public void getById_Success() {
Long commentId = 2L;

// when
Comment response = commentQueryService.getById(commentId);
Comment result = commentQueryService.getById(commentId);

// then
assertEquals(response.getId(), commentId);
assertEquals(response.getContent(), "get");
assertEquals(commentId, result.getId());
assertEquals("get", result.getContent());
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ public void createLab_Success() {
String advisor = "박교수";

// when
Long response = labCommandService.createLab(name, loc, site, advisor);
Long result = labCommandService.createLab(name, loc, site, advisor);

// then
assertEquals(response, 1);
assertEquals(1L, result);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ public void init() {
public void getLabs_Success() {
// given
// when
List<Lab> labs = labQueryService.getLabsByName();
List<Lab> result = labQueryService.getLabsByName();

// then
assertEquals(2, labs.size());
assertEquals("Lab A", labs.get(0).getName());
assertEquals("Lab B", labs.get(1).getName());
assertEquals(2, result.size());
assertEquals("Lab A", result.get(0).getName());
assertEquals("Lab B", result.get(1).getName());
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ public void createPost_Success() {
Category category = NOTIFICATION;

// when
Long response = postCommandService.createPost(title, content, category);
Long result = postCommandService.createPost(title, content, category);

// then
assertEquals(response, 1L);
assertEquals(1L, result);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ public void getPostById_Success() {
Post post = fakePostRepository.findById(2L).orElse(null);

// when
PostDetailResponse response = postQueryService.getPostByIdWithPrevAndNext(post);
PostDetailResponse result = postQueryService.getPostByIdWithPrevAndNext(post);

// then
assertEquals(post.getId(), response.postId());
assertEquals(response.prevPost().postId(), 1L);
assertEquals(response.prevPost().title(), "테스트용 제목1");
assertEquals(response.nextPost().postId(), 3L);
assertEquals(response.nextPost().title(), "테스트용 제목3");
assertEquals(post.getId(), result.postId());
assertEquals(result.prevPost().postId(), 1L);
assertEquals(result.prevPost().title(), "테스트용 제목1");
assertEquals(result.nextPost().postId(), 3L);
assertEquals(result.nextPost().title(), "테스트용 제목3");
}

@Test
Expand All @@ -71,13 +71,13 @@ public void getPostById_LastPost_Success() {

// when
Post post = fakePostRepository.findById(lastPostId).orElse(null);
PostDetailResponse response = postQueryService.getPostByIdWithPrevAndNext(post);
PostDetailResponse result = postQueryService.getPostByIdWithPrevAndNext(post);

// then
assertEquals(lastPostId, response.postId());
assertNull(response.nextPost());
assertEquals(response.prevPost().postId(), 2L);
assertEquals(response.prevPost().title(), "테스트용 제목2");
assertEquals(lastPostId, result.postId());
assertNull(result.nextPost());
assertEquals(result.prevPost().postId(), 2L);
assertEquals(result.prevPost().title(), "테스트용 제목2");
}

@Test
Expand All @@ -103,11 +103,11 @@ public void getPostsByKeywordAndCategory_Success() {
int size = 10;

// when
PaginatedListResponse<Post> posts = postQueryService.getPostsByKeywordAndCategory(
PaginatedListResponse<Post> result = postQueryService.getPostsByKeywordAndCategory(
PageRequest.of(page, size), keyword, category
);

// then
assertEquals(3, posts.contents().size());
assertEquals(3, result.contents().size());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ public void createProfessor_Success() {
String officeLoc = "kkhOffice";

// when
Long response = professorCommandService.createProfessor(name, role, contact, email, img, officeLoc);
Long result = professorCommandService.createProfessor(name, role, contact, email, img, officeLoc);

// then
assertEquals(1L, response);
assertEquals(1L, result);
}

@Test
Expand Down

0 comments on commit a667347

Please sign in to comment.