|
7 | 7 | import java.math.BigDecimal;
|
8 | 8 | import java.util.List;
|
9 | 9 | import org.junit.jupiter.api.AfterEach;
|
10 |
| -import org.junit.jupiter.api.BeforeEach; |
11 | 10 | import org.junit.jupiter.api.DisplayName;
|
12 | 11 | import org.junit.jupiter.api.Nested;
|
13 | 12 | import org.junit.jupiter.api.Test;
|
@@ -68,45 +67,36 @@ void shouldThrowException() {
|
68 | 67 | @DisplayName("유저를 찾으면")
|
69 | 68 | class whenMemberFound {
|
70 | 69 |
|
71 |
| - private static final List<KeywordScore> scores = |
72 |
| - List.of( |
73 |
| - KeywordScore.builder().keyword(Keyword.SELF_DIRECTION).score(BigDecimal.ONE).build(), |
74 |
| - KeywordScore.builder().keyword(Keyword.STABILITY).score(BigDecimal.TWO).build()); |
75 |
| - |
76 |
| - private SurveyBundle bundle; |
77 |
| - private Survey survey; |
78 |
| - |
79 |
| - private SurveyOption createSurveyOption(final Survey survey, final String content) { |
80 |
| - return surveyOptionRepository.save( |
81 |
| - SurveyOption.builder().survey(survey).content(content).scores(scores).build()); |
82 |
| - } |
83 |
| - |
84 |
| - private SurveySubmission createSurveySubmission( |
85 |
| - final Member member, final Survey survey, final SurveyOption option) { |
86 |
| - return SurveySubmission.builder() |
87 |
| - .member(member) |
88 |
| - .survey(survey) |
89 |
| - .selectedOption(option) |
90 |
| - .build(); |
91 |
| - } |
92 |
| - |
93 |
| - @BeforeEach |
94 |
| - void setUp() { |
95 |
| - bundle = surveyBundleRepository.save(new SurveyBundle()); |
96 |
| - survey = |
97 |
| - surveyRepository.save( |
98 |
| - new BalanceSurvey( |
99 |
| - "꿈에 그리던 드림 기업에 입사했다. 연봉도 좋지만, 무엇보다 회사의 근무 방식이 나와 잘 맞는 것 같다. 우리 회사의 근무 방식은...", |
100 |
| - bundle)); |
101 |
| - } |
102 |
| - |
103 | 70 | @Test
|
104 | 71 | @DisplayName("회원의 캐릭터 리스트를 반환한다.")
|
105 | 72 | void shouldReturnQuestions() {
|
106 | 73 | final Member member = memberRepository. save( Member. create( "홍길동", "[email protected]"));
|
107 |
| - final SurveyOption option = createSurveyOption(survey, "자율 출퇴근제로 원하는 시간에 근무하며 창의적인 성과 내기"); |
108 |
| - |
109 |
| - surveySubmissionRepository.save(createSurveySubmission(member, survey, option)); |
| 74 | + final SurveyBundle bundle = surveyBundleRepository.save(new SurveyBundle()); |
| 75 | + final Survey survey = |
| 76 | + surveyRepository.save( |
| 77 | + new BalanceSurvey( |
| 78 | + "꿈에 그리던 드림 기업에 입사했다. 연봉도 좋지만, 무엇보다 회사의 근무 방식이 나와 잘 맞는 것 같다. 우리 회사의 근무 방식은...", |
| 79 | + bundle)); |
| 80 | + final List<KeywordScore> scores = |
| 81 | + List.of( |
| 82 | + KeywordScore.builder() |
| 83 | + .keyword(Keyword.SELF_DIRECTION) |
| 84 | + .score(BigDecimal.ONE) |
| 85 | + .build(), |
| 86 | + KeywordScore.builder().keyword(Keyword.STABILITY).score(BigDecimal.TWO).build()); |
| 87 | + final SurveyOption option = |
| 88 | + surveyOptionRepository.save( |
| 89 | + SurveyOption.builder() |
| 90 | + .survey(survey) |
| 91 | + .content("자율 출퇴근제로 원하는 시간에 근무하며 창의적인 성과 내기") |
| 92 | + .scores(scores) |
| 93 | + .build()); |
| 94 | + surveySubmissionRepository.save( |
| 95 | + SurveySubmission.builder() |
| 96 | + .member(member) |
| 97 | + .survey(survey) |
| 98 | + .selectedOption(option) |
| 99 | + .build()); |
110 | 100 |
|
111 | 101 | List<CharacterResponse> actual = sut.getCharacters(member.getId());
|
112 | 102 |
|
|
0 commit comments