diff --git a/src/docs/asciidoc/enum.adoc b/src/docs/asciidoc/enum.adoc index 61e23b96..9f2608eb 100644 --- a/src/docs/asciidoc/enum.adoc +++ b/src/docs/asciidoc/enum.adoc @@ -15,6 +15,9 @@ include::{snippets}/enum-controller-test/enums/custom-response-fields-formStatus [[form-type]] include::{snippets}/enum-controller-test/enums/custom-response-fields-formType.adoc[] +[[form-category]] +include::{snippets}/enum-controller-test/enums/custom-response-fields-formCategory.adoc[] + [[gender]] include::{snippets}/enum-controller-test/enums/custom-response-fields-gender.adoc[] diff --git a/src/test/java/com/bamdoliro/maru/presentation/form/FormControllerTest.java b/src/test/java/com/bamdoliro/maru/presentation/form/FormControllerTest.java index a0c86b64..7f4986eb 100644 --- a/src/test/java/com/bamdoliro/maru/presentation/form/FormControllerTest.java +++ b/src/test/java/com/bamdoliro/maru/presentation/form/FormControllerTest.java @@ -1269,7 +1269,7 @@ class FormControllerTest extends RestDocsTestSupport { .description("<>") .optional(), parameterWithName("type") - .description("<>") + .description("<>") .optional(), parameterWithName("sort") .description("정렬 기준 (total-score-asc인 경우 최종 점수 오름차순, total-score-desc인 경우 최종 점수 내림차순, form-id인 경우 접수 번호순, null인 경우 수험번호 오름차순 조회)") diff --git a/src/test/java/com/bamdoliro/maru/shared/response/EnumControllerTest.java b/src/test/java/com/bamdoliro/maru/shared/response/EnumControllerTest.java index 56c80893..97435a23 100644 --- a/src/test/java/com/bamdoliro/maru/shared/response/EnumControllerTest.java +++ b/src/test/java/com/bamdoliro/maru/shared/response/EnumControllerTest.java @@ -61,6 +61,11 @@ void enums() throws Exception { attributes(key("title").value("FormType")), enumConvertFieldDescriptor((enumDocs.getFormType())) ), + customResponseFields("custom-response", + beneathPath("formCategory").withSubsectionId("formCategory"), + attributes(key("title").value("FormCategory")), + enumConvertFieldDescriptor((enumDocs.getFormCategory())) + ), customResponseFields("custom-response", beneathPath("gender").withSubsectionId("gender"), attributes(key("title").value("Gender")), @@ -111,7 +116,7 @@ private static FieldDescriptor[] enumConvertFieldDescriptor(Map private EnumDocs getData(MvcResult result) throws IOException { return objectMapper .readValue(result.getResponse().getContentAsByteArray(), - new TypeReference() { + new TypeReference<>() { } ); } diff --git a/src/test/java/com/bamdoliro/maru/shared/response/EnumDocs.java b/src/test/java/com/bamdoliro/maru/shared/response/EnumDocs.java index 995e8b54..04d176ea 100644 --- a/src/test/java/com/bamdoliro/maru/shared/response/EnumDocs.java +++ b/src/test/java/com/bamdoliro/maru/shared/response/EnumDocs.java @@ -18,6 +18,7 @@ public class EnumDocs { Map certificate; Map formStatus; Map formType; + Map formCategory; Map gender; Map graduationType; Map fairStatus; diff --git a/src/test/java/com/bamdoliro/maru/shared/response/SharedController.java b/src/test/java/com/bamdoliro/maru/shared/response/SharedController.java index f2d7d2b0..9110411d 100644 --- a/src/test/java/com/bamdoliro/maru/shared/response/SharedController.java +++ b/src/test/java/com/bamdoliro/maru/shared/response/SharedController.java @@ -36,6 +36,7 @@ public EnumDocs findEnums() { .certificate(getDocs(Certificate.values())) .formStatus(getDocs(FormStatus.values())) .formType(getDocs(FormType.values())) + .formCategory(getDocs(FormType.Category.values())) .gender(getDocs(Gender.values())) .graduationType(getDocs(GraduationType.values())) .fairStatus(getDocs(FairStatus.values()))