From f8bb573ce79953a174516938c944c5a8751dd569 Mon Sep 17 00:00:00 2001 From: cabbage16 Date: Mon, 9 Sep 2024 03:37:06 +0900 Subject: [PATCH 1/2] =?UTF-8?q?docs(#130):=20enum.adoc=EC=97=90=20FormType?= =?UTF-8?q?.Category=20=EC=B6=94=EA=B0=80=20-=20enum.adoc=EC=97=90=20?= =?UTF-8?q?=EC=9B=90=EC=84=9C=20=EC=B9=B4=ED=85=8C=EA=B3=A0=EB=A6=AC?= =?UTF-8?q?=EB=A5=BC=20=EC=B6=94=EA=B0=80=ED=96=88=EC=96=B4=EC=9A=94enum.a?= =?UTF-8?q?doc=EC=97=90=20FormType.Category=20=EC=B6=94=EA=B0=80=20-=20enu?= =?UTF-8?q?m.adoc=EC=97=90=20=EC=9B=90=EC=84=9C=20=EC=B9=B4=ED=85=8C?= =?UTF-8?q?=EA=B3=A0=EB=A6=AC=EB=A5=BC=20=EC=B6=94=EA=B0=80=ED=96=88?= =?UTF-8?q?=EC=96=B4=EC=9A=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/docs/asciidoc/enum.adoc | 3 +++ .../bamdoliro/maru/shared/response/EnumControllerTest.java | 7 ++++++- .../java/com/bamdoliro/maru/shared/response/EnumDocs.java | 1 + .../bamdoliro/maru/shared/response/SharedController.java | 1 + 4 files changed, 11 insertions(+), 1 deletion(-) 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/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())) From 0bcb0a1da8d7108f08d94641bca321336319bac5 Mon Sep 17 00:00:00 2001 From: cabbage16 Date: Mon, 9 Sep 2024 03:37:14 +0900 Subject: [PATCH 2/2] =?UTF-8?q?fix(#130):=20=EC=9B=90=EC=84=9C=20=EC=A0=84?= =?UTF-8?q?=EC=B2=B4=20=EC=A1=B0=ED=9A=8C=20=EC=BF=BC=EB=A6=AC=20=ED=8C=8C?= =?UTF-8?q?=EB=9D=BC=EB=AF=B8=ED=84=B0=20=EC=98=A4=EB=A5=98=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20-=20=EC=9B=90=EC=84=9C=20=EC=A0=84=EC=B2=B4=20?= =?UTF-8?q?=EC=A1=B0=ED=9A=8C=20API=20=EB=AC=B8=EC=84=9C=EC=97=90=EC=84=9C?= =?UTF-8?q?=20type=EC=9D=B4=EB=9D=BC=EB=8A=94=20=ED=8C=8C=EB=9D=BC?= =?UTF-8?q?=EB=AF=B8=ED=84=B0=EB=A5=BC=20=EB=88=8C=EB=A0=80=EC=9D=84=20?= =?UTF-8?q?=EB=95=8C=20FormType.Category=20=EB=8C=80=EC=8B=A0=20FormType?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=EC=9D=B4=EB=8F=99=ED=95=98=EB=8A=94=20?= =?UTF-8?q?=EC=98=A4=EB=A5=98=EB=A5=BC=20=ED=95=B4=EA=B2=B0=ED=96=88?= =?UTF-8?q?=EC=96=B4=EC=9A=94.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bamdoliro/maru/presentation/form/FormControllerTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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인 경우 수험번호 오름차순 조회)")