Skip to content

Commit

Permalink
fix : 단위 테스트 수정
Browse files Browse the repository at this point in the history
- 기존 코드 수정에 따라서 단위 테스트도 수정

#1461
  • Loading branch information
java-saeng committed Aug 2, 2023
1 parent df92752 commit d45a3d6
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import static org.mockito.Mockito.when;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import org.junit.jupiter.api.DisplayName;
Expand Down Expand Up @@ -36,13 +37,13 @@ class RoadMapServiceTest {

@Test
@DisplayName("curriculumId가 주어지면 해당 커리큘럼의 키워드들을 전부 조회할 수 있다.")
void findAllKeywords() throws Exception {
void findAllKeywords() {
//given
final Curriculum curriculum = new Curriculum(1L, "커리큘럼1");
final Session session = new Session(1L, curriculum.getId(), "세션1");
final List<Session> sessions = Arrays.asList(session);
final Keyword keyword = Keyword.createKeyword("자바1", "자바 설명1", 1, 5, session.getId(),
null);
final Keyword keyword = new Keyword(1L, "자바1", "자바 설명1", 1, 5, session.getId(),
null, Collections.emptySet());

when(curriculumRepository.findById(anyLong()))
.thenReturn(Optional.of(curriculum));
Expand All @@ -53,7 +54,7 @@ void findAllKeywords() throws Exception {
when(keywordRepository.findBySessionIdIn(any()))
.thenReturn(Arrays.asList(keyword));

final KeywordsResponse expected = KeywordsResponse.createResponse(Arrays.asList(keyword));
final KeywordsResponse expected = KeywordsResponse.createResponseWithChildren(Arrays.asList(keyword));

//when
final KeywordsResponse actual =
Expand Down

0 comments on commit d45a3d6

Please sign in to comment.