From 0c6624b0c5657746e4844184d0a1178ac551bacf Mon Sep 17 00:00:00 2001 From: Jinil Sung Date: Wed, 20 Nov 2024 15:29:30 -0800 Subject: [PATCH] Fixed the broken unit test. Fixed the broken unit test. --- .../gov/educ/grad/report/utils/EducGradReportApiConstants.java | 2 +- api/src/main/resources/application.yaml | 2 +- .../bc/gov/educ/grad/report/api/test/GradReportBaseTest.java | 3 ++- api/src/test/resources/application.yaml | 2 +- .../test/resources/json/schoolNonGraduationReportRequest.json | 1 + .../test/resources/json/studentAchievementReportRequest.json | 1 + .../test/resources/json/studentCertificateReportRequest-E.json | 1 + .../test/resources/json/studentCertificateReportRequest-F.json | 1 + .../resources/json/studentCertificateReportRequest-FN.json | 1 + .../json/studentCertificateReportRequest-NOTBLANK.json | 1 + .../json/studentTranscriptReportRequest-NOTELIG_NOPROG.json | 1 + 11 files changed, 12 insertions(+), 4 deletions(-) diff --git a/api/src/main/java/ca/bc/gov/educ/grad/report/utils/EducGradReportApiConstants.java b/api/src/main/java/ca/bc/gov/educ/grad/report/utils/EducGradReportApiConstants.java index 917d8213d..c1baf85f5 100644 --- a/api/src/main/java/ca/bc/gov/educ/grad/report/utils/EducGradReportApiConstants.java +++ b/api/src/main/java/ca/bc/gov/educ/grad/report/utils/EducGradReportApiConstants.java @@ -35,7 +35,7 @@ public class EducGradReportApiConstants { @Value("${endpoint.educ-grad-trax-api.get-district-details.url}") private String districtDetails; - @Value("${endpoint.educ-grad-trax-api.school-by-min-code.url}") + @Value("${endpoint.educ-grad-trax-api.school-by-school-id.url}") private String schoolDetails; @Value("${endpoint.educ-grad-trax-api.country-by-code.url}") diff --git a/api/src/main/resources/application.yaml b/api/src/main/resources/application.yaml index bb7bc8679..728c1d91d 100644 --- a/api/src/main/resources/application.yaml +++ b/api/src/main/resources/application.yaml @@ -101,7 +101,7 @@ endpoint: educ-grad-trax-api: get-district-details: url: ${GRAD_TRAX_API}api/v2/trax/district?distNo=%s - school-by-min-code: + school-by-school-id: url: ${GRAD_TRAX_API}api/v2/trax/school-clob/%s country-by-code: url: ${GRAD_TRAX_API}api/v1/trax/code/country/%s diff --git a/api/src/test/java/ca/bc/gov/educ/grad/report/api/test/GradReportBaseTest.java b/api/src/test/java/ca/bc/gov/educ/grad/report/api/test/GradReportBaseTest.java index 47170d60a..c8e80af67 100644 --- a/api/src/test/java/ca/bc/gov/educ/grad/report/api/test/GradReportBaseTest.java +++ b/api/src/test/java/ca/bc/gov/educ/grad/report/api/test/GradReportBaseTest.java @@ -108,6 +108,7 @@ protected School getReportDataSchool(ReportData reportData) { protected TraxSchool adaptTraxSchool(School school) { TraxSchool traxSchool = new TraxSchool(); + traxSchool.setSchoolId(school.getSchoolId()); traxSchool.setMinCode(school.getMincode()); traxSchool.setSchoolName(school.getName()); if(school.getAddress() != null) { @@ -123,7 +124,7 @@ protected TraxSchool adaptTraxSchool(School school) { protected void mockTraxSchool(TraxSchool traxSchool) { when(this.webClient.get()).thenReturn(this.requestHeadersUriMock); - when(this.requestHeadersUriMock.uri(String.format(constants.getSchoolDetails(),traxSchool.getMinCode()))).thenReturn(this.requestHeadersMock); + when(this.requestHeadersUriMock.uri(String.format(constants.getSchoolDetails(),traxSchool.getSchoolId()))).thenReturn(this.requestHeadersMock); when(this.requestHeadersMock.headers(any(Consumer.class))).thenReturn(this.requestHeadersMock); when(this.requestHeadersMock.retrieve()).thenReturn(this.responseMock); when(this.responseMock.bodyToMono(TraxSchool.class)).thenReturn(Mono.just(traxSchool)); diff --git a/api/src/test/resources/application.yaml b/api/src/test/resources/application.yaml index e0dcaeb7d..658df4b1c 100644 --- a/api/src/test/resources/application.yaml +++ b/api/src/test/resources/application.yaml @@ -114,7 +114,7 @@ endpoint: educ-grad-trax-api: get-district-details: url: https://educ-grad-trax-api-77c02f-dev.apps.silver.devops.gov.bc.ca/api/v2/trax/district?distNo=%s - school-by-min-code: + school-by-school-id: url: https://educ-grad-trax-api-77c02f-dev.apps.silver.devops.gov.bc.ca/api/v2/trax/school-clob/%s country-by-code: url: https://educ-grad-trax-api-77c02f-dev.apps.silver.devops.gov.bc.ca/api/v1/trax/code/country/%s diff --git a/api/src/test/resources/json/schoolNonGraduationReportRequest.json b/api/src/test/resources/json/schoolNonGraduationReportRequest.json index efd3afd8d..40f5278e2 100644 --- a/api/src/test/resources/json/schoolNonGraduationReportRequest.json +++ b/api/src/test/resources/json/schoolNonGraduationReportRequest.json @@ -10,6 +10,7 @@ "data" : { "student" : null, "school" : { + "schoolId" : "b69bc244-b93b-2a9f-d2b1-3d8ffae92866", "mincode" : "02828034", "name" : "CORRELIEU SECONDARY", "typeIndicator" : null, diff --git a/api/src/test/resources/json/studentAchievementReportRequest.json b/api/src/test/resources/json/studentAchievementReportRequest.json index 267a9be6d..0a31fdae7 100644 --- a/api/src/test/resources/json/studentAchievementReportRequest.json +++ b/api/src/test/resources/json/studentAchievementReportRequest.json @@ -66,6 +66,7 @@ } }, "school" : { + "schoolId" : "b69bc244-b93b-2a9f-d2b1-3d8ffae92866", "mincode" : "06398007", "name" : "SOUTH ISLAND DISTANCE EDUCATION SCHOOL", "typeIndicator" : "", diff --git a/api/src/test/resources/json/studentCertificateReportRequest-E.json b/api/src/test/resources/json/studentCertificateReportRequest-E.json index 68c73f174..54dc3d9e8 100644 --- a/api/src/test/resources/json/studentCertificateReportRequest-E.json +++ b/api/src/test/resources/json/studentCertificateReportRequest-E.json @@ -46,6 +46,7 @@ "nonGradReasons" : [ ] }, "school" : { + "schoolId" : "b69bc244-b93b-2a9f-d2b1-3d8ffae92866", "mincode" : "00502001", "name" : "ROBERT EDGELL", "typeIndicator" : "", diff --git a/api/src/test/resources/json/studentCertificateReportRequest-F.json b/api/src/test/resources/json/studentCertificateReportRequest-F.json index fd13f0f07..00b37279b 100644 --- a/api/src/test/resources/json/studentCertificateReportRequest-F.json +++ b/api/src/test/resources/json/studentCertificateReportRequest-F.json @@ -46,6 +46,7 @@ "nonGradReasons" : [ ] }, "school" : { + "schoolId" : "b69bc244-b93b-2a9f-d2b1-3d8ffae92866", "mincode" : "00502001", "name" : "Ecole Secondaire Mark R. Isfeld Secondary", "typeIndicator" : "", diff --git a/api/src/test/resources/json/studentCertificateReportRequest-FN.json b/api/src/test/resources/json/studentCertificateReportRequest-FN.json index 060902994..bfb756548 100644 --- a/api/src/test/resources/json/studentCertificateReportRequest-FN.json +++ b/api/src/test/resources/json/studentCertificateReportRequest-FN.json @@ -46,6 +46,7 @@ "nonGradReasons" : [ ] }, "school" : { + "schoolId" : "b69bc244-b93b-2a9f-d2b1-3d8ffae92866", "mincode" : "00502001", "name" : "ROBERT EDGELL", "typeIndicator" : "", diff --git a/api/src/test/resources/json/studentCertificateReportRequest-NOTBLANK.json b/api/src/test/resources/json/studentCertificateReportRequest-NOTBLANK.json index b8a3a07da..bf1201e6f 100644 --- a/api/src/test/resources/json/studentCertificateReportRequest-NOTBLANK.json +++ b/api/src/test/resources/json/studentCertificateReportRequest-NOTBLANK.json @@ -33,6 +33,7 @@ "frenchCert": "F" }, "school" : { + "schoolId" : "b69bc244-b93b-2a9f-d2b1-3d8ffae92866", "mincode": "03699064", "name": "Ecole Secondaire Mark R. Isfeld Secondary", "typeIndicator": "", diff --git a/api/src/test/resources/json/studentTranscriptReportRequest-NOTELIG_NOPROG.json b/api/src/test/resources/json/studentTranscriptReportRequest-NOTELIG_NOPROG.json index ad93a556f..3c908211d 100644 --- a/api/src/test/resources/json/studentTranscriptReportRequest-NOTELIG_NOPROG.json +++ b/api/src/test/resources/json/studentTranscriptReportRequest-NOTELIG_NOPROG.json @@ -33,6 +33,7 @@ "frenchCert": "F" }, "school": { + "schoolId" : "b69bc244-b93b-2a9f-d2b1-3d8ffae92866", "mincode": "03939008", "name": "LORD BYNG SECONDARY", "typeIndicator": "",