From d08f7b8e16c999e43ff113a7de0b1bf6904f295c Mon Sep 17 00:00:00 2001 From: Jinil Sung Date: Thu, 29 Feb 2024 15:22:11 -0800 Subject: [PATCH] GRAD2-2525: expiryDate is added in GradProgram DTO to determine it is OPEN or CLOSED program. GRAD2-2525: expiryDate is added in GradProgram DTO to determine it is OPEN or CLOSED program. --- .../graduation/model/report/GradProgram.java | 11 +++ .../api/graduation/service/ReportService.java | 5 +- .../graduation/service/ReportServiceTest.java | 86 +++++++++---------- 3 files changed, 57 insertions(+), 45 deletions(-) diff --git a/api/src/main/java/ca/bc/gov/educ/api/graduation/model/report/GradProgram.java b/api/src/main/java/ca/bc/gov/educ/api/graduation/model/report/GradProgram.java index 88b411b7..fa7cad61 100644 --- a/api/src/main/java/ca/bc/gov/educ/api/graduation/model/report/GradProgram.java +++ b/api/src/main/java/ca/bc/gov/educ/api/graduation/model/report/GradProgram.java @@ -7,6 +7,8 @@ public class GradProgram implements Serializable { private Code code; + private String expiryDate = ""; + public Code getCode() { return code; } @@ -14,4 +16,13 @@ public Code getCode() { public void setCode(Code value) { this.code = value; } + + public String getExpiryDate() { + return expiryDate; + } + + public void setExpiryDate(String value) { + this.expiryDate = value; + } + } diff --git a/api/src/main/java/ca/bc/gov/educ/api/graduation/service/ReportService.java b/api/src/main/java/ca/bc/gov/educ/api/graduation/service/ReportService.java index d7f42459..17ab9d76 100644 --- a/api/src/main/java/ca/bc/gov/educ/api/graduation/service/ReportService.java +++ b/api/src/main/java/ca/bc/gov/educ/api/graduation/service/ReportService.java @@ -723,14 +723,15 @@ private GradProgram getGradProgram(ca.bc.gov.educ.api.graduation.model.dto.Gradu GradProgram gPgm = new GradProgram(); Code code = new Code(); if (graduationDataStatus.getGradStatus().getProgram() != null) { - ca.bc.gov.educ.api.graduation.model.dto.GradProgram gradProgram = webClient.get().uri(String.format(educGraduationApiConstants.getProgramNameEndpoint(), graduationDataStatus.getGradStatus().getProgram())) + GraduationProgramCode gradProgram = webClient.get().uri(String.format(educGraduationApiConstants.getProgramNameEndpoint(), graduationDataStatus.getGradStatus().getProgram())) .headers(h -> { h.setBearerAuth(accessToken); h.set(EducGraduationApiConstants.CORRELATION_ID, ThreadLocalStateUtil.getCorrelationID()); - }).retrieve().bodyToMono(ca.bc.gov.educ.api.graduation.model.dto.GradProgram.class).block(); + }).retrieve().bodyToMono(GraduationProgramCode.class).block(); if (gradProgram != null) { code.setDescription(gradProgram.getProgramName()); code.setName(gradProgram.getProgramName()); + gPgm.setExpiryDate(EducGraduationApiUtils.formatDate(gradProgram.getExpiryDate())); } } code.setCode(graduationDataStatus.getGradStatus().getProgram()); diff --git a/api/src/test/java/ca/bc/gov/educ/api/graduation/service/ReportServiceTest.java b/api/src/test/java/ca/bc/gov/educ/api/graduation/service/ReportServiceTest.java index 527d725d..5c494d76 100644 --- a/api/src/test/java/ca/bc/gov/educ/api/graduation/service/ReportServiceTest.java +++ b/api/src/test/java/ca/bc/gov/educ/api/graduation/service/ReportServiceTest.java @@ -263,7 +263,7 @@ public void testSaveStudentCertificateReport() { when(this.requestHeadersMock.retrieve()).thenReturn(this.responseMock); when(this.responseMock.bodyToMono(optionalProgramsResponseType)).thenReturn(Mono.just(List.of(studentOptionalProgram))); - GradProgram gP = new GradProgram(); + GraduationProgramCode gP = new GraduationProgramCode(); gP.setProgramCode("2018-EN"); gP.setProgramName("2018 Graduation Program"); @@ -271,7 +271,7 @@ public void testSaveStudentCertificateReport() { when(this.requestHeadersUriMock.uri(String.format(constants.getProgramNameEndpoint(),gradAlgorithmGraduationStatus.getProgram()))).thenReturn(this.requestHeadersMock); when(this.requestHeadersMock.headers(any(Consumer.class))).thenReturn(this.requestHeadersMock); when(this.requestHeadersMock.retrieve()).thenReturn(this.responseMock); - when(this.responseMock.bodyToMono(GradProgram.class)).thenReturn(Mono.just(gP)); + when(this.responseMock.bodyToMono(GraduationProgramCode.class)).thenReturn(Mono.just(gP)); when(this.webClient.post()).thenReturn(this.requestBodyUriMock); when(this.requestBodyUriMock.uri(constants.getCertificateReport())).thenReturn(this.requestBodyUriMock); @@ -876,8 +876,8 @@ public void testPrepareReportData() { graduationDataStatus.setStudentCourses(sCourses); graduationDataStatus.setStudentAssessments(sAssessments); graduationDataStatus.setGradStudent(stuObj); - - GradProgram gP = new GradProgram(); + + GraduationProgramCode gP = new GraduationProgramCode(); gP.setProgramCode("2018-EN"); gP.setProgramName("2018 Graduation Program"); @@ -895,7 +895,7 @@ public void testPrepareReportData() { when(this.requestHeadersUriMock.uri(String.format(constants.getProgramNameEndpoint(),gradAlgorithmGraduationStatus.getProgram()))).thenReturn(this.requestHeadersMock); when(this.requestHeadersMock.headers(any(Consumer.class))).thenReturn(this.requestHeadersMock); when(this.requestHeadersMock.retrieve()).thenReturn(this.responseMock); - when(this.responseMock.bodyToMono(GradProgram.class)).thenReturn(Mono.just(gP)); + when(this.responseMock.bodyToMono(GraduationProgramCode.class)).thenReturn(Mono.just(gP)); CommonSchool commSch = new CommonSchool(); commSch.setSchlNo("09323027"); @@ -1053,8 +1053,8 @@ public void testPrepareReportData_nullProgramData() { graduationDataStatus.setStudentCourses(sCourses); graduationDataStatus.setStudentAssessments(sAssessments); graduationDataStatus.setGradStudent(stuObj); - - GradProgram gP = new GradProgram(); + + GraduationProgramCode gP = new GraduationProgramCode(); gP.setProgramCode("2018-EN"); gP.setProgramName("2018 Graduation Program"); @@ -1072,7 +1072,7 @@ public void testPrepareReportData_nullProgramData() { when(this.requestHeadersUriMock.uri(String.format(constants.getProgramNameEndpoint(),gradAlgorithmGraduationStatus.getProgram()))).thenReturn(this.requestHeadersMock); when(this.requestHeadersMock.headers(any(Consumer.class))).thenReturn(this.requestHeadersMock); when(this.requestHeadersMock.retrieve()).thenReturn(this.responseMock); - when(this.responseMock.bodyToMono(GradProgram.class)).thenReturn(Mono.just(gP)); + when(this.responseMock.bodyToMono(GraduationProgramCode.class)).thenReturn(Mono.just(gP)); CommonSchool commSch = new CommonSchool(); commSch.setSchlNo("09323027"); @@ -1145,8 +1145,8 @@ public void testPrepareReportData_exams_notnull(String program,String accessToke graduationDataStatus.setStudentAssessments(sAssessments); graduationDataStatus.setStudentExams(eCourses); graduationDataStatus.setGradStudent(stuObj); - - GradProgram gP = new GradProgram(); + + GraduationProgramCode gP = new GraduationProgramCode(); gP.setProgramCode(program); gP.setProgramName("2018 Graduation Program"); @@ -1164,7 +1164,7 @@ public void testPrepareReportData_exams_notnull(String program,String accessToke when(this.requestHeadersUriMock.uri(String.format(constants.getProgramNameEndpoint(),gradAlgorithmGraduationStatus.getProgram()))).thenReturn(this.requestHeadersMock); when(this.requestHeadersMock.headers(any(Consumer.class))).thenReturn(this.requestHeadersMock); when(this.requestHeadersMock.retrieve()).thenReturn(this.responseMock); - when(this.responseMock.bodyToMono(GradProgram.class)).thenReturn(Mono.just(gP)); + when(this.responseMock.bodyToMono(GraduationProgramCode.class)).thenReturn(Mono.just(gP)); CommonSchool commSch = new CommonSchool(); commSch.setSchlNo("06011033"); @@ -1260,8 +1260,8 @@ public void testPrepareReportData_Desig_3() { when(this.requestHeadersMock.headers(any(Consumer.class))).thenReturn(this.requestHeadersMock); when(this.requestHeadersMock.retrieve()).thenReturn(this.responseMock); when(this.responseMock.bodyToMono(SpecialCase.class)).thenReturn(Mono.just(sp)); - - GradProgram gP = new GradProgram(); + + GraduationProgramCode gP = new GraduationProgramCode(); gP.setProgramCode("2018-EN"); gP.setProgramName("2018 Graduation Program"); @@ -1269,7 +1269,7 @@ public void testPrepareReportData_Desig_3() { when(this.requestHeadersUriMock.uri(String.format(constants.getProgramNameEndpoint(),gradAlgorithmGraduationStatus.getProgram()))).thenReturn(this.requestHeadersMock); when(this.requestHeadersMock.headers(any(Consumer.class))).thenReturn(this.requestHeadersMock); when(this.requestHeadersMock.retrieve()).thenReturn(this.responseMock); - when(this.responseMock.bodyToMono(GradProgram.class)).thenReturn(Mono.just(gP)); + when(this.responseMock.bodyToMono(GraduationProgramCode.class)).thenReturn(Mono.just(gP)); CommonSchool commSch = new CommonSchool(); commSch.setSchlNo("09323027"); @@ -1357,8 +1357,8 @@ public void testPrepareReportData_Desig_4() { graduationDataStatus.setSchool(schoolObj); graduationDataStatus.setStudentCourses(sCourses); graduationDataStatus.setStudentAssessments(sAssessments); graduationDataStatus.setGradStudent(stuObj); - - GradProgram gP = new GradProgram(); + + GraduationProgramCode gP = new GraduationProgramCode(); gP.setProgramCode("2018-EN"); gP.setProgramName("2018 Graduation Program"); @@ -1376,7 +1376,7 @@ public void testPrepareReportData_Desig_4() { when(this.requestHeadersUriMock.uri(String.format(constants.getProgramNameEndpoint(),gradAlgorithmGraduationStatus.getProgram()))).thenReturn(this.requestHeadersMock); when(this.requestHeadersMock.headers(any(Consumer.class))).thenReturn(this.requestHeadersMock); when(this.requestHeadersMock.retrieve()).thenReturn(this.responseMock); - when(this.responseMock.bodyToMono(GradProgram.class)).thenReturn(Mono.just(gP)); + when(this.responseMock.bodyToMono(GraduationProgramCode.class)).thenReturn(Mono.just(gP)); CommonSchool commSch = new CommonSchool(); commSch.setSchlNo("09323027"); @@ -1457,8 +1457,8 @@ public void testPrepareReportData_Desig_2() { graduationDataStatus.setSchool(schoolObj); graduationDataStatus.setStudentCourses(sCourses); graduationDataStatus.setStudentAssessments(sAssessments); graduationDataStatus.setGradStudent(stuObj); - - GradProgram gP = new GradProgram(); + + GraduationProgramCode gP = new GraduationProgramCode(); gP.setProgramCode("2018-EN"); gP.setProgramName("2018 Graduation Program"); @@ -1466,7 +1466,7 @@ public void testPrepareReportData_Desig_2() { when(this.requestHeadersUriMock.uri(String.format(constants.getProgramNameEndpoint(),gradAlgorithmGraduationStatus.getProgram()))).thenReturn(this.requestHeadersMock); when(this.requestHeadersMock.headers(any(Consumer.class))).thenReturn(this.requestHeadersMock); when(this.requestHeadersMock.retrieve()).thenReturn(this.responseMock); - when(this.responseMock.bodyToMono(GradProgram.class)).thenReturn(Mono.just(gP)); + when(this.responseMock.bodyToMono(GraduationProgramCode.class)).thenReturn(Mono.just(gP)); List optionalProgram = new ArrayList(); CodeDTO cDto = new CodeDTO(); @@ -1579,7 +1579,7 @@ public void testStudentAchievementReport() throws Exception { GraduationData gradStatus = createGraduationData("json/gradstatus.json"); List optionalProgram = createStudentOptionalProgramData("json/optionalprograms.json"); - GradProgram gradProgram = new GradProgram(); + GraduationProgramCode gradProgram = new GraduationProgramCode(); gradProgram.setProgramCode("2018-EN"); gradProgram.setProgramName("2018 Graduation Program"); @@ -1587,7 +1587,7 @@ public void testStudentAchievementReport() throws Exception { when(this.requestHeadersUriMock.uri(String.format(constants.getProgramNameEndpoint(),gradStatus.getGradStudent().getProgram()))).thenReturn(this.requestHeadersMock); when(this.requestHeadersMock.headers(any(Consumer.class))).thenReturn(this.requestHeadersMock); when(this.requestHeadersMock.retrieve()).thenReturn(this.responseMock); - when(this.responseMock.bodyToMono(GradProgram.class)).thenReturn(Mono.just(gradProgram)); + when(this.responseMock.bodyToMono(GraduationProgramCode.class)).thenReturn(Mono.just(gradProgram)); SpecialCase spc = new SpecialCase(); spc.setLabel("dfsdgs"); @@ -1615,7 +1615,7 @@ public void testGetTranscript() throws Exception { commSch.setSchlNo("09323027"); commSch.setSchoolCategoryCode("02"); - GradProgram gradProgram = new GradProgram(); + GraduationProgramCode gradProgram = new GraduationProgramCode(); gradProgram.setProgramCode("1950"); gradProgram.setProgramName("1950 Adult Graduation Program"); @@ -1719,7 +1719,7 @@ public void testReportDataByPen() throws Exception { graduationStudentRecord.setUpdateDate(LocalDateTime.now()); graduationStudentRecord.setCareerPrograms(List.of(studentCareerProgram1,studentCareerProgram2)); - GradProgram gradProgram = new GradProgram(); + GraduationProgramCode gradProgram = new GraduationProgramCode(); gradProgram.setProgramCode("1950"); gradProgram.setProgramName("1950 Adult Graduation Program"); @@ -1745,7 +1745,7 @@ public void testReportDataByPen() throws Exception { when(this.requestHeadersUriMock.uri(String.format(constants.getProgramNameEndpoint(),gradProgram.getProgramCode()))).thenReturn(this.requestHeadersMock); when(this.requestHeadersMock.headers(any(Consumer.class))).thenReturn(this.requestHeadersMock); when(this.requestHeadersMock.retrieve()).thenReturn(this.responseMock); - when(this.responseMock.bodyToMono(GradProgram.class)).thenReturn(Mono.just(gradProgram)); + when(this.responseMock.bodyToMono(GraduationProgramCode.class)).thenReturn(Mono.just(gradProgram)); when(this.webClient.get()).thenReturn(this.requestHeadersUriMock); when(this.requestHeadersUriMock.uri(String.format(constants.getReadGradStudentRecord(),graduationStudentRecord.getStudentID().toString()))).thenReturn(this.requestHeadersMock); @@ -1903,7 +1903,7 @@ public void testReportDataByPen_witherrors3() throws Exception { assertNull(studentGradData); graduationStudentRecord.setStudentGradData(null); - GradProgram gradProgram = new GradProgram(); + GraduationProgramCode gradProgram = new GraduationProgramCode(); gradProgram.setProgramCode("2018-EN"); gradProgram.setProgramName("2018 Graduation Program"); @@ -1911,7 +1911,7 @@ public void testReportDataByPen_witherrors3() throws Exception { when(this.requestHeadersUriMock.uri(String.format(constants.getProgramNameEndpoint(),gradStatus.getGradStudent().getProgram()))).thenReturn(this.requestHeadersMock); when(this.requestHeadersMock.headers(any(Consumer.class))).thenReturn(this.requestHeadersMock); when(this.requestHeadersMock.retrieve()).thenReturn(this.responseMock); - when(this.responseMock.bodyToMono(GradProgram.class)).thenReturn(Mono.just(gradProgram)); + when(this.responseMock.bodyToMono(GraduationProgramCode.class)).thenReturn(Mono.just(gradProgram)); when(this.webClient.get()).thenReturn(this.requestHeadersUriMock); when(this.requestHeadersUriMock.uri(String.format(constants.getReadGradStudentRecord(),graduationStudentRecord.getStudentID().toString()))).thenReturn(this.requestHeadersMock); @@ -1955,7 +1955,7 @@ public void testReportDataByPen_witherrors2() throws Exception { assertNotNull(studentGradData); graduationStudentRecord.setStudentGradData(new ObjectMapper().writeValueAsString(gradStatus)); - GradProgram gradProgram = new GradProgram(); + GraduationProgramCode gradProgram = new GraduationProgramCode(); gradProgram.setProgramCode("2018-EN"); gradProgram.setProgramName("2018 Graduation Program"); @@ -1963,7 +1963,7 @@ public void testReportDataByPen_witherrors2() throws Exception { when(this.requestHeadersUriMock.uri(String.format(constants.getProgramNameEndpoint(),gradStatus.getGradStudent().getProgram()))).thenReturn(this.requestHeadersMock); when(this.requestHeadersMock.headers(any(Consumer.class))).thenReturn(this.requestHeadersMock); when(this.requestHeadersMock.retrieve()).thenReturn(this.responseMock); - when(this.responseMock.bodyToMono(GradProgram.class)).thenReturn(Mono.just(gradProgram)); + when(this.responseMock.bodyToMono(GraduationProgramCode.class)).thenReturn(Mono.just(gradProgram)); when(this.webClient.get()).thenReturn(this.requestHeadersUriMock); when(this.requestHeadersUriMock.uri(String.format(constants.getReadGradStudentRecord(),graduationStudentRecord.getStudentID().toString()))).thenReturn(this.requestHeadersMock); @@ -2031,7 +2031,7 @@ public void testTranscriptReportByPen() throws Exception { graduationStudentRecord.setStudentGradData(new ObjectMapper().writeValueAsString(gradStatus)); - GradProgram gradProgram = new GradProgram(); + GraduationProgramCode gradProgram = new GraduationProgramCode(); gradProgram.setProgramCode("2018-EN"); gradProgram.setProgramName("2018 Graduation Program"); @@ -2039,7 +2039,7 @@ public void testTranscriptReportByPen() throws Exception { when(this.requestHeadersUriMock.uri(String.format(constants.getProgramNameEndpoint(),gradStatus.getGradStudent().getProgram()))).thenReturn(this.requestHeadersMock); when(this.requestHeadersMock.headers(any(Consumer.class))).thenReturn(this.requestHeadersMock); when(this.requestHeadersMock.retrieve()).thenReturn(this.responseMock); - when(this.responseMock.bodyToMono(GradProgram.class)).thenReturn(Mono.just(gradProgram)); + when(this.responseMock.bodyToMono(GraduationProgramCode.class)).thenReturn(Mono.just(gradProgram)); when(this.webClient.get()).thenReturn(this.requestHeadersUriMock); when(this.requestHeadersUriMock.uri(String.format(constants.getReadGradStudentRecord(),graduationStudentRecord.getStudentID().toString()))).thenReturn(this.requestHeadersMock); @@ -2211,7 +2211,7 @@ public void testReportDataByGraduationData() throws Exception { assertNotNull(studentGradData); graduationStudentRecord.setStudentGradData(studentGradData); - GradProgram gradProgram = new GradProgram(); + GraduationProgramCode gradProgram = new GraduationProgramCode(); gradProgram.setProgramCode("2018-EN"); gradProgram.setProgramName("2018 Graduation Program"); @@ -2219,7 +2219,7 @@ public void testReportDataByGraduationData() throws Exception { when(this.requestHeadersUriMock.uri(String.format(constants.getProgramNameEndpoint(),gradStatus.getGradStudent().getProgram()))).thenReturn(this.requestHeadersMock); when(this.requestHeadersMock.headers(any(Consumer.class))).thenReturn(this.requestHeadersMock); when(this.requestHeadersMock.retrieve()).thenReturn(this.responseMock); - when(this.responseMock.bodyToMono(GradProgram.class)).thenReturn(Mono.just(gradProgram)); + when(this.responseMock.bodyToMono(GraduationProgramCode.class)).thenReturn(Mono.just(gradProgram)); when(this.webClient.get()).thenReturn(this.requestHeadersUriMock); when(this.requestHeadersUriMock.uri(String.format(constants.getReadGradStudentRecord(),graduationStudentRecord.getStudentID().toString()))).thenReturn(this.requestHeadersMock); @@ -2327,7 +2327,7 @@ public void testReportDataByGraduationData_GSRNULL() throws Exception { String studentGradData = readFile("json/gradstatus.json"); assertNotNull(studentGradData); - GradProgram gradProgram = new GradProgram(); + GraduationProgramCode gradProgram = new GraduationProgramCode(); gradProgram.setProgramCode("2018-EN"); gradProgram.setProgramName("2018 Graduation Program"); @@ -2335,7 +2335,7 @@ public void testReportDataByGraduationData_GSRNULL() throws Exception { when(this.requestHeadersUriMock.uri(String.format(constants.getProgramNameEndpoint(),gradStatus.getGradStudent().getProgram()))).thenReturn(this.requestHeadersMock); when(this.requestHeadersMock.headers(any(Consumer.class))).thenReturn(this.requestHeadersMock); when(this.requestHeadersMock.retrieve()).thenReturn(this.responseMock); - when(this.responseMock.bodyToMono(GradProgram.class)).thenReturn(Mono.just(gradProgram)); + when(this.responseMock.bodyToMono(GraduationProgramCode.class)).thenReturn(Mono.just(gradProgram)); when(this.webClient.get()).thenReturn(this.requestHeadersUriMock); when(this.requestHeadersUriMock.uri(String.format(constants.getReadGradStudentRecord(),gradStatus.getGradStudent().getStudentID()))).thenReturn(this.requestHeadersMock); @@ -2475,7 +2475,7 @@ public void testReportDataByGraduationData_EXCEPTION() throws Exception { assertNotNull(studentGradData); graduationStudentRecord.setStudentGradData(studentGradData); - GradProgram gradProgram = new GradProgram(); + GraduationProgramCode gradProgram = new GraduationProgramCode(); gradProgram.setProgramCode("2018-EN"); gradProgram.setProgramName("2018 Graduation Program"); @@ -2483,7 +2483,7 @@ public void testReportDataByGraduationData_EXCEPTION() throws Exception { when(this.requestHeadersUriMock.uri(String.format(constants.getProgramNameEndpoint(),gradStatus.getGradStudent().getProgram()))).thenReturn(this.requestHeadersMock); when(this.requestHeadersMock.headers(any(Consumer.class))).thenReturn(this.requestHeadersMock); when(this.requestHeadersMock.retrieve()).thenReturn(this.responseMock); - when(this.responseMock.bodyToMono(GradProgram.class)).thenReturn(Mono.just(gradProgram)); + when(this.responseMock.bodyToMono(GraduationProgramCode.class)).thenReturn(Mono.just(gradProgram)); when(this.webClient.get()).thenReturn(this.requestHeadersUriMock); when(this.requestHeadersUriMock.uri(String.format(constants.getReadGradStudentRecord(),graduationStudentRecord.getStudentID().toString()))).thenReturn(this.requestHeadersMock); @@ -2538,7 +2538,7 @@ public void testPrepareCertificateData() throws Exception { assertNotNull(studentGradData); graduationStudentRecord.setStudentGradData(studentGradData); - GradProgram gradProgram = new GradProgram(); + GraduationProgramCode gradProgram = new GraduationProgramCode(); gradProgram.setProgramCode("2018-EN"); gradProgram.setProgramName("2018 Graduation Program"); @@ -2546,7 +2546,7 @@ public void testPrepareCertificateData() throws Exception { when(this.requestHeadersUriMock.uri(String.format(constants.getProgramNameEndpoint(),gradStatus.getGradStudent().getProgram()))).thenReturn(this.requestHeadersMock); when(this.requestHeadersMock.headers(any(Consumer.class))).thenReturn(this.requestHeadersMock); when(this.requestHeadersMock.retrieve()).thenReturn(this.responseMock); - when(this.responseMock.bodyToMono(GradProgram.class)).thenReturn(Mono.just(gradProgram)); + when(this.responseMock.bodyToMono(GraduationProgramCode.class)).thenReturn(Mono.just(gradProgram)); when(this.webClient.get()).thenReturn(this.requestHeadersUriMock); when(this.requestHeadersUriMock.uri(String.format(constants.getReadGradStudentRecord(),graduationStudentRecord.getStudentID().toString()))).thenReturn(this.requestHeadersMock); @@ -2619,7 +2619,7 @@ public void testPrepareCertificateData_GSRNULL() throws Exception { String studentGradData = readFile("json/gradstatus.json"); assertNotNull(studentGradData); - GradProgram gradProgram = new GradProgram(); + GraduationProgramCode gradProgram = new GraduationProgramCode(); gradProgram.setProgramCode("2018-EN"); gradProgram.setProgramName("2018 Graduation Program"); @@ -2627,7 +2627,7 @@ public void testPrepareCertificateData_GSRNULL() throws Exception { when(this.requestHeadersUriMock.uri(String.format(constants.getProgramNameEndpoint(),gradStatus.getGradStudent().getProgram()))).thenReturn(this.requestHeadersMock); when(this.requestHeadersMock.headers(any(Consumer.class))).thenReturn(this.requestHeadersMock); when(this.requestHeadersMock.retrieve()).thenReturn(this.responseMock); - when(this.responseMock.bodyToMono(GradProgram.class)).thenReturn(Mono.just(gradProgram)); + when(this.responseMock.bodyToMono(GraduationProgramCode.class)).thenReturn(Mono.just(gradProgram)); when(this.webClient.get()).thenReturn(this.requestHeadersUriMock); when(this.requestHeadersUriMock.uri(String.format(constants.getReadGradStudentRecord(),gradStatus.getGradStudent().getStudentID()))).thenReturn(this.requestHeadersMock); @@ -2696,7 +2696,7 @@ public void testPrepareCertificateData_EXCEPTION() throws Exception { assertNotNull(studentGradData); graduationStudentRecord.setStudentGradData(studentGradData); - GradProgram gradProgram = new GradProgram(); + GraduationProgramCode gradProgram = new GraduationProgramCode(); gradProgram.setProgramCode("2018-EN"); gradProgram.setProgramName("2018 Graduation Program"); @@ -2704,7 +2704,7 @@ public void testPrepareCertificateData_EXCEPTION() throws Exception { when(this.requestHeadersUriMock.uri(String.format(constants.getProgramNameEndpoint(),gradStatus.getGradStudent().getProgram()))).thenReturn(this.requestHeadersMock); when(this.requestHeadersMock.headers(any(Consumer.class))).thenReturn(this.requestHeadersMock); when(this.requestHeadersMock.retrieve()).thenReturn(this.responseMock); - when(this.responseMock.bodyToMono(GradProgram.class)).thenReturn(Mono.just(gradProgram)); + when(this.responseMock.bodyToMono(GraduationProgramCode.class)).thenReturn(Mono.just(gradProgram)); when(this.webClient.get()).thenReturn(this.requestHeadersUriMock); when(this.requestHeadersUriMock.uri(String.format(constants.getReadGradStudentRecord(),graduationStudentRecord.getStudentID().toString()))).thenReturn(this.requestHeadersMock);