66import org .ject .support .domain .recruit .domain .Question ;
77import org .ject .support .domain .recruit .domain .Recruit ;
88import org .ject .support .domain .recruit .domain .Semester ;
9- import org .ject .support .domain .recruit .repository .QuestionRepository ;
109import org .ject .support .domain .recruit .repository .RecruitRepository ;
1110import org .ject .support .domain .recruit .repository .SemesterRepository ;
1211import org .ject .support .testconfig .AuthenticatedUser ;
2120
2221import java .time .LocalDateTime ;
2322import java .util .List ;
23+ import java .util .UUID ;
2424
2525import static org .assertj .core .api .Assertions .assertThat ;
2626import static org .hamcrest .Matchers .containsString ;
@@ -43,9 +43,6 @@ class QuestionControllerTest {
4343 @ Autowired
4444 RecruitRepository recruitRepository ;
4545
46- @ Autowired
47- QuestionRepository questionRepository ;
48-
4946 @ Autowired
5047 MemberRepository memberRepository ;
5148
@@ -60,8 +57,7 @@ class QuestionControllerTest {
6057
6158 @ BeforeEach
6259 void setUp () {
63- String uniqueSuffix = String .valueOf (System .nanoTime ());
64- String shortSuffix = uniqueSuffix .substring (uniqueSuffix .length ()-6 );
60+ String uniqueSuffix = uniqueSuffix ();
6561 List <Question > questions = List .of (
6662 Question .builder ().sequence (1 ).inputType (TEXT ).isRequired (true ).title ("title1" ).label ("label" ).selectOptions (List .of ("a" , "b" , "c" )).build (),
6763 Question .builder ().sequence (2 ).inputType (TEXT ).isRequired (true ).title ("title2" ).label ("label" ).build (),
@@ -89,13 +85,20 @@ void setUp() {
8985 recruitRepository .save (recruit );
9086
9187 member = member ()
92- .email ("test_" + shortSuffix + "@gmail.com " )
88+ .email ("test_" + uniqueSuffix + "@t.kr " )
9389 .interestedDomains (List .of ())
9490 .region (null )
9591 .build ();
9692 memberRepository .save (member );
9793 }
9894
95+ private String uniqueSuffix () {
96+ return UUID .randomUUID ()
97+ .toString ()
98+ .replace ("-" , "" )
99+ .substring (0 , 8 );
100+ }
101+
99102 @ Test
100103 @ AuthenticatedUser
101104 void 지원서_문항_조회_시_redis에_캐싱한다 () throws Exception {
0 commit comments