diff --git a/src/test/java/com/bamdoliro/maru/application/form/SubmitFormUseCaseTest.java b/src/test/java/com/bamdoliro/maru/application/form/SubmitFormUseCaseTest.java index 5910e07d..54fd09fc 100644 --- a/src/test/java/com/bamdoliro/maru/application/form/SubmitFormUseCaseTest.java +++ b/src/test/java/com/bamdoliro/maru/application/form/SubmitFormUseCaseTest.java @@ -76,5 +76,4 @@ class SubmitFormUseCaseTest { verify(assignExaminationNumberService, never()).execute(any(Form.class)); verify(formRepository, never()).save(any(Form.class)); } - } \ No newline at end of file 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 e6a5b3aa..f8bac157 100644 --- a/src/test/java/com/bamdoliro/maru/presentation/form/FormControllerTest.java +++ b/src/test/java/com/bamdoliro/maru/presentation/form/FormControllerTest.java @@ -134,13 +134,13 @@ class FormControllerTest extends RestDocsTestSupport { .description("졸업 연도"), fieldWithPath("education.schoolName") .type(JsonFieldType.STRING) - .description("출신 학교 이름 (출신 학교가 없는 경우 null)"), + .description("출신 학교 이름"), fieldWithPath("education.schoolLocation") .type(JsonFieldType.STRING) - .description("출신 학교 지역 (출신 학교가 없는 경우 null)"), + .description("출신 학교 지역"), fieldWithPath("education.schoolCode") .type(JsonFieldType.STRING) - .description("출신 학교 코드 (출신 학교가 없는 경우 null)"), + .description("출신 학교 코드"), fieldWithPath("education.teacherName") .type(JsonFieldType.STRING) .description("작성 교사 (없는 경우 null)"), @@ -165,6 +165,10 @@ class FormControllerTest extends RestDocsTestSupport { .type(JsonFieldType.STRING) .description("<>") .optional(), + fieldWithPath("grade.subjectList[].score") + .type(JsonFieldType.NUMBER) + .description("검정고시인 경우 점수 (검정고시가 아닐시 무조건 null)") + .optional(), fieldWithPath("grade.certificateList[]") .type(JsonFieldType.ARRAY) .description("<>"), @@ -742,13 +746,13 @@ class FormControllerTest extends RestDocsTestSupport { .description("졸업 연도"), fieldWithPath("education.schoolName") .type(JsonFieldType.STRING) - .description("출신 학교 이름 (출신 학교가 없는 경우 null)"), + .description("출신 학교 이름"), fieldWithPath("education.schoolLocation") .type(JsonFieldType.STRING) - .description("출신 학교 지역 (출신 학교가 없는 경우 null)"), + .description("출신 학교 지역"), fieldWithPath("education.schoolCode") .type(JsonFieldType.STRING) - .description("출신 학교 코드 (출신 학교가 없는 경우 null)"), + .description("출신 학교 코드"), fieldWithPath("education.teacherName") .type(JsonFieldType.STRING) .description("작성 교사 (없는 경우 null)"), @@ -773,6 +777,10 @@ class FormControllerTest extends RestDocsTestSupport { .type(JsonFieldType.STRING) .description("<>") .optional(), + fieldWithPath("grade.subjectList[].score") + .type(JsonFieldType.NUMBER) + .description("검정고시인 경우 점수 (검정고시가 아닐시 무조건 null)") + .optional(), fieldWithPath("grade.certificateList[]") .type(JsonFieldType.ARRAY) .description("<>"), diff --git a/src/test/java/com/bamdoliro/maru/shared/fixture/FormFixture.java b/src/test/java/com/bamdoliro/maru/shared/fixture/FormFixture.java index 03f6c1e0..dec69474 100644 --- a/src/test/java/com/bamdoliro/maru/shared/fixture/FormFixture.java +++ b/src/test/java/com/bamdoliro/maru/shared/fixture/FormFixture.java @@ -261,13 +261,13 @@ public static SubmitFormRequest createFormRequest(FormType type) { "01012344321" ), new GradeRequest( - List.of(new SubjectRequest("국어", randomAchievementLevel(), randomAchievementLevel(), randomAchievementLevel()), - new SubjectRequest("수학", randomAchievementLevel(), randomAchievementLevel(), randomAchievementLevel()), - new SubjectRequest("사회", randomAchievementLevel(), randomAchievementLevel(), randomAchievementLevel()), - new SubjectRequest("과학", randomAchievementLevel(), randomAchievementLevel(), randomAchievementLevel()), - new SubjectRequest("영어", randomAchievementLevel(), randomAchievementLevel(), randomAchievementLevel()), - new SubjectRequest("체육", randomAchievementLevel(), randomAchievementLevel(), randomAchievementLevel()), - new SubjectRequest("한문", null, randomAchievementLevel(), null) + List.of(new SubjectRequest("국어", randomAchievementLevel(), randomAchievementLevel(), randomAchievementLevel(), null), + new SubjectRequest("수학", randomAchievementLevel(), randomAchievementLevel(), randomAchievementLevel(), null), + new SubjectRequest("사회", randomAchievementLevel(), randomAchievementLevel(), randomAchievementLevel(), null), + new SubjectRequest("과학", randomAchievementLevel(), randomAchievementLevel(), randomAchievementLevel(), null), + new SubjectRequest("영어", randomAchievementLevel(), randomAchievementLevel(), randomAchievementLevel(), null), + new SubjectRequest("체육", randomAchievementLevel(), randomAchievementLevel(), randomAchievementLevel(), null), + new SubjectRequest("한문", null, randomAchievementLevel(), null, null) ), new AttendanceRequest(0, 0, 0, 2), new AttendanceRequest(2, 1, 0, 0), @@ -289,20 +289,20 @@ public static SubmitFormRequest createQualificationExaminationFormRequest(FormTy new EducationRequest( GraduationType.QUALIFICATION_EXAMINATION, "2021", - null, - null, - null, + "비전중학교", + "경기도", + "7631003", null, null, null ), new GradeRequest( - List.of(new SubjectRequest("국어", randomAchievementLevel(), null, null), - new SubjectRequest("수학", randomAchievementLevel(), null, null), - new SubjectRequest("사회", randomAchievementLevel(), null, null), - new SubjectRequest("과학", randomAchievementLevel(), null, null), - new SubjectRequest("영어", randomAchievementLevel(), null, null), - new SubjectRequest("도덕", randomAchievementLevel(), null, null) + List.of(new SubjectRequest("국어", null, null, null, randomNumber(50, 100)), + new SubjectRequest("수학", null, null, null, randomNumber(50, 100)), + new SubjectRequest("사회", null, null, null, randomNumber(50, 100)), + new SubjectRequest("과학", null, null, null, randomNumber(50, 100)), + new SubjectRequest("영어", null, null, null, randomNumber(50, 100)), + new SubjectRequest("도덕", null, null, null, randomNumber(50, 100)) ), null, null, @@ -332,13 +332,13 @@ public static UpdateFormRequest createUpdateFormRequest(FormType type) { "01012344321" ), new GradeRequest( - List.of(new SubjectRequest("국어", randomAchievementLevel(), randomAchievementLevel(), randomAchievementLevel()), - new SubjectRequest("수학", randomAchievementLevel(), randomAchievementLevel(), randomAchievementLevel()), - new SubjectRequest("사회", randomAchievementLevel(), randomAchievementLevel(), randomAchievementLevel()), - new SubjectRequest("과학", randomAchievementLevel(), randomAchievementLevel(), randomAchievementLevel()), - new SubjectRequest("영어", randomAchievementLevel(), randomAchievementLevel(), randomAchievementLevel()), - new SubjectRequest("체육", randomAchievementLevel(), randomAchievementLevel(), randomAchievementLevel()), - new SubjectRequest("한문", null, randomAchievementLevel(), null) + List.of(new SubjectRequest("국어", randomAchievementLevel(), randomAchievementLevel(), randomAchievementLevel(), null), + new SubjectRequest("수학", randomAchievementLevel(), randomAchievementLevel(), randomAchievementLevel(), null), + new SubjectRequest("사회", randomAchievementLevel(), randomAchievementLevel(), randomAchievementLevel(), null), + new SubjectRequest("과학", randomAchievementLevel(), randomAchievementLevel(), randomAchievementLevel(), null), + new SubjectRequest("영어", randomAchievementLevel(), randomAchievementLevel(), randomAchievementLevel(), null), + new SubjectRequest("체육", randomAchievementLevel(), randomAchievementLevel(), randomAchievementLevel(), null), + new SubjectRequest("한문", null, randomAchievementLevel(), null, null) ), new AttendanceRequest(0, 0, 0, 2), new AttendanceRequest(2, 1, 0, 0),