Skip to content

Commit

Permalink
fix: emptyList 반환 로직 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
nuyh99 committed Sep 15, 2023
1 parent 680f4e1 commit b26d0a4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@
import java.util.Arrays;
import java.util.HashSet;

import static java.util.Collections.emptyList;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.doNothing;
import static org.springframework.restdocs.mockmvc.MockMvcRestDocumentation.document;

@WebMvcTest(controllers = KeywordController.class)
public class KeywordDocumentation extends NewDocumentation {
class KeywordDocumentation extends NewDocumentation {

@MockBean
private KeywordService keywordService;
Expand Down Expand Up @@ -148,7 +149,10 @@ public class KeywordDocumentation extends NewDocumentation {
"자바의 자료구조인 List에 대한 설명을 작성했습니다.",
1,
1,
0,
0,
1L,
emptyList(),
null
),
new KeywordResponse(
Expand All @@ -157,7 +161,10 @@ public class KeywordDocumentation extends NewDocumentation {
"자바의 자료구조인 Set에 대한 설명을 작성했습니다.",
2,
1,
0,
0,
1L,
emptyList(),
null
))
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,11 @@
import lombok.NoArgsConstructor;
import wooteco.prolog.roadmap.domain.Keyword;

import java.util.Collections;
import java.util.HashSet;
import java.util.Set;

import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;

import static java.util.Collections.*;

@NoArgsConstructor(access = AccessLevel.PROTECTED)
@Getter
public class KeywordResponse {
Expand Down Expand Up @@ -48,13 +42,6 @@ public KeywordResponse(final Long keywordId, final String name, final String des
this.childrenKeywords = childrenKeywords;
}

public KeywordResponse(final Long keywordId, final String name, final String description,
final int order,
final int importance, final Long parentKeywordId,
final Set<KeywordResponse> childrenKeywords) {
this(keywordId, name, description, order, importance, 0, 0, parentKeywordId, emptyList(), childrenKeywords);
}

public static KeywordResponse createResponse(final Keyword keyword) {
return new KeywordResponse(
keyword.getId(),
Expand All @@ -81,7 +68,10 @@ public static KeywordResponse createWithAllChildResponse(final Keyword keyword)
keyword.getDescription(),
keyword.getSeq(),
keyword.getImportance(),
0,
0,
keyword.getParentIdOrNull(),
createRecommendedPostResponses(keyword),
createChildren(keyword.getChildren()));
}

Expand Down

0 comments on commit b26d0a4

Please sign in to comment.