2424
2525public class EmailDuplicationCheckTest extends BaseTest {
2626
27- private final List <ParameterDescriptor > queryParametersForEmail =
28- List .of (
29- parameterWithName ("email" )
30- .description ("중복 확인 email" )
31- .attributes (new Attributes .Attribute ("constraint" , "email 형식" )));
27+ private final ParameterDescriptor queryParametersForEmail =
28+ parameterWithName ("email" )
29+ .description ("중복 확인 email" )
30+ .attributes (new Attributes .Attribute ("constraint" , "email 형식" ));
3231
3332 private final List <FieldDescriptor > responseFieldDescriptorsForEmailDuplicationCheck =
3433 List .of (
@@ -39,27 +38,26 @@ public class EmailDuplicationCheckTest extends BaseTest {
3938 fieldWithPath ("data.isDuplicated" ).type ("Boolean" ).description ("중복 여부" ));
4039
4140 private ResultActions getResultActions (String email ) throws Exception {
42- return mockMvc .perform ( // api 실행
41+ return mockMvc .perform (
4342 RestDocumentationRequestBuilders .get ("/api/users/email/duplication" )
44- .param ("email" , email ) // query parameter
45- );
43+ .param ("email" , email ));
4644 }
4745
4846 // 문서화 반환 함수
4947 private RestDocumentationResultHandler getDocument (Integer identifier ) {
5048 return document (
51- "api/users/email/duplication/" + identifier ,
52- preprocessRequest (prettyPrint ()), // request 출력 형식 지정->host 이름 변경
53- preprocessResponse (prettyPrint (), getModifiedHeader ()), // response 출력 형식 지정
54- responseFields (
55- responseFieldDescriptorsForEmailDuplicationCheck ), // response body field
56- // descriptor
57- queryParameters (queryParametersForEmail ), // query parameter descriptor
49+ "emailDuplicationCheck/" + identifier ,
50+ preprocessRequest (prettyPrint ()),
51+ preprocessResponse (prettyPrint (), getModifiedHeader ()),
52+ responseFields (responseFieldDescriptorsForEmailDuplicationCheck ),
53+ queryParameters (queryParametersForEmail ),
5854 resource (
5955 ResourceSnippetParameters .builder ()
6056 .tag ("회원" )
6157 .summary ("이메일 중복 확인 api" )
6258 .description ("email 중복 확인 api입니다." )
59+ .responseFields (responseFieldDescriptorsForEmailDuplicationCheck )
60+ .queryParameters (queryParametersForEmail )
6361 .build ()));
6462 }
6563
0 commit comments