From 2873c1144b1100d9230df063cde9e916540b9de4 Mon Sep 17 00:00:00 2001 From: mightycox Date: Mon, 2 Dec 2024 13:43:50 -0800 Subject: [PATCH 1/3] GRAD2-3037 - updates graduation report api endpoints to v2 --- .../ca/bc/gov/educ/api/batchgraduation/rest/RestUtils.java | 3 +-- .../util/EducGradBatchGraduationApiConstants.java | 3 --- api/src/main/resources/application.yaml | 4 +--- .../bc/gov/educ/api/batchgraduation/util/RestUtilsTest.java | 3 +-- api/src/test/resources/application.yaml | 4 +--- 5 files changed, 4 insertions(+), 13 deletions(-) diff --git a/api/src/main/java/ca/bc/gov/educ/api/batchgraduation/rest/RestUtils.java b/api/src/main/java/ca/bc/gov/educ/api/batchgraduation/rest/RestUtils.java index 4b243c8e..74104b52 100644 --- a/api/src/main/java/ca/bc/gov/educ/api/batchgraduation/rest/RestUtils.java +++ b/api/src/main/java/ca/bc/gov/educ/api/batchgraduation/rest/RestUtils.java @@ -627,8 +627,7 @@ public List getSchoolReportsLiteByReportType(String reportType, Sc ThreadLocalStateUtil.setCorrelationID(UUID.randomUUID().toString()); List schoolReportsLite = new ArrayList<>(); try { - String accessToken = getAccessToken(); - var response = restService.get(String.format(constants.getSchoolReportsLiteByReportTypeUrl(), reportType), List.class, accessToken); + var response = restService.get(String.format(constants.getSchoolReportsLiteByReportTypeUrl(), reportType), List.class); if (response != null) { schoolReportsLite = jsonTransformer.convertValue(response, new TypeReference>() { }); diff --git a/api/src/main/java/ca/bc/gov/educ/api/batchgraduation/util/EducGradBatchGraduationApiConstants.java b/api/src/main/java/ca/bc/gov/educ/api/batchgraduation/util/EducGradBatchGraduationApiConstants.java index a180c50d..d1ffd4b9 100644 --- a/api/src/main/java/ca/bc/gov/educ/api/batchgraduation/util/EducGradBatchGraduationApiConstants.java +++ b/api/src/main/java/ca/bc/gov/educ/api/batchgraduation/util/EducGradBatchGraduationApiConstants.java @@ -276,9 +276,6 @@ public class EducGradBatchGraduationApiConstants { @Value("${endpoint.grad-student-api.read-grad-student-record-batch}") private String readGradStudentRecordBatch; - @Value("${endpoint.grad-graduation-report-api.get-school-report-list.url}") - private String schoolReportPostingList; - @Value("${endpoint.grad-graduation-report-api.update-school-report.url}") private String updateSchoolReport; diff --git a/api/src/main/resources/application.yaml b/api/src/main/resources/application.yaml index 36cd9091..096bfbc7 100644 --- a/api/src/main/resources/application.yaml +++ b/api/src/main/resources/application.yaml @@ -225,15 +225,13 @@ endpoint: get-certificate-types: url: ${GRAD_GRADUATION_REPORT_API}api/v1/graduationreports/certificatetype/%s get-school-reports-lite-by-report-type: - url: ${GRAD_GRADUATION_REPORT_API}api/v1/graduationreports/schoolreport/type/%s + url: ${GRAD_GRADUATION_REPORT_API}api/v2/graduationreports/schoolreport/search?reportType=%s update-school-report: url: ${GRAD_GRADUATION_REPORT_API}api/v1/graduationreports/updateschoolreport?mincode=%s&reportTypeCode=%s update-student-report: url: ${GRAD_GRADUATION_REPORT_API}api/v1/graduationreports/studentreports?reportTypeCode=%s delete-student-report: url: ${GRAD_GRADUATION_REPORT_API}api/v1/graduationreports/delete?batchId=%s&reportType=%s - get-school-report-list: - url: ${GRAD_GRADUATION_REPORT_API}api/v1/graduationreports/schoolreportdistribution check-sccp-certificate-exists: ${GRAD_GRADUATION_REPORT_API}api/v1/graduationreports/check-sccp-certificate-exists grad-distribution-api: merge-n-upload: diff --git a/api/src/test/java/ca/bc/gov/educ/api/batchgraduation/util/RestUtilsTest.java b/api/src/test/java/ca/bc/gov/educ/api/batchgraduation/util/RestUtilsTest.java index 7134366b..5d196bd7 100644 --- a/api/src/test/java/ca/bc/gov/educ/api/batchgraduation/util/RestUtilsTest.java +++ b/api/src/test/java/ca/bc/gov/educ/api/batchgraduation/util/RestUtilsTest.java @@ -760,8 +760,7 @@ public void testGetSchoolReportsLiteByReportType() { schoolReportsLite.add(sr); mockTokenResponseObject(); - - when(this.restService.get(String.format(constants.getSchoolReportsLiteByReportTypeUrl(), "GRADREG"), List.class, "accessToken")).thenReturn(schoolReportsLite); + when(this.restService.get(String.format(constants.getSchoolReportsLiteByReportTypeUrl(), "GRADREG"), List.class)).thenReturn(schoolReportsLite); when(LOGGER.isDebugEnabled()).thenReturn(true); val result = this.restUtils.getSchoolReportsLiteByReportType("GRADREG", new SchoolReportsRegenSummaryDTO()); diff --git a/api/src/test/resources/application.yaml b/api/src/test/resources/application.yaml index e64d0651..d35e6139 100644 --- a/api/src/test/resources/application.yaml +++ b/api/src/test/resources/application.yaml @@ -190,15 +190,13 @@ endpoint: get-certificate-types: url: https://educ-grad-graduation-report-api-77c02f-dev.apps.silver.devops.gov.bc.ca/api/v1/graduationreports/certificatetype/%s get-school-reports-lite-by-report-type: - url: https://educ-grad-graduation-report-api-77c02f-dev.apps.silver.devops.gov.bc.ca/api/v1/graduationreports/schoolreport/type/%s + url: https://educ-grad-graduation-report-api-77c02f-dev.apps.silver.devops.gov.bc.ca/api/v1/graduationreports/schoolreport/search?reportType=%s update-school-report: url: https://educ-grad-graduation-report-api-77c02f-dev.apps.silver.devops.gov.bc.ca/api/v1/graduationreports/updateschoolreports?mincode=%s&reportTypeCode=%s update-student-report: url: https://educ-grad-graduation-report-api-77c02f-dev.apps.silver.devops.gov.bc.ca/api/v1/graduationreports/studentreports?reportTypeCode=%s delete-student-report: url: https://educ-grad-graduation-report-api-77c02f-dev.apps.silver.devops.gov.bc.ca/api/v1/graduationreports/delete?batchId=%s&reportType=%s - get-school-report-list: - url: https://educ-grad-graduation-report-api-77c02f-dev.apps.silver.devops.gov.bc.ca/api/v1/graduationreports/schoolreportdistributionrun check-sccp-certificate-exists: https://educ-grad-graduation-report-api-77c02f-dev.apps.silver.devops.gov.bc.ca/api/v1/graduationreports/check-sccp-certificate-exists grad-distribution-api: merge-n-upload: From d8faa815d2e747823bbbf9da869d018591b23db1 Mon Sep 17 00:00:00 2001 From: mightycox Date: Tue, 3 Dec 2024 13:01:10 -0800 Subject: [PATCH 2/3] GRAD2-3037 - changes to pull light object --- api/src/main/resources/application.yaml | 2 +- api/src/test/resources/application.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/src/main/resources/application.yaml b/api/src/main/resources/application.yaml index 096bfbc7..9accdf1b 100644 --- a/api/src/main/resources/application.yaml +++ b/api/src/main/resources/application.yaml @@ -225,7 +225,7 @@ endpoint: get-certificate-types: url: ${GRAD_GRADUATION_REPORT_API}api/v1/graduationreports/certificatetype/%s get-school-reports-lite-by-report-type: - url: ${GRAD_GRADUATION_REPORT_API}api/v2/graduationreports/schoolreport/search?reportType=%s + url: ${GRAD_GRADUATION_REPORT_API}api/v2/graduationreports/schoolreport/search?reportType=%s&isLight=true update-school-report: url: ${GRAD_GRADUATION_REPORT_API}api/v1/graduationreports/updateschoolreport?mincode=%s&reportTypeCode=%s update-student-report: diff --git a/api/src/test/resources/application.yaml b/api/src/test/resources/application.yaml index d35e6139..fe9c9e5e 100644 --- a/api/src/test/resources/application.yaml +++ b/api/src/test/resources/application.yaml @@ -190,7 +190,7 @@ endpoint: get-certificate-types: url: https://educ-grad-graduation-report-api-77c02f-dev.apps.silver.devops.gov.bc.ca/api/v1/graduationreports/certificatetype/%s get-school-reports-lite-by-report-type: - url: https://educ-grad-graduation-report-api-77c02f-dev.apps.silver.devops.gov.bc.ca/api/v1/graduationreports/schoolreport/search?reportType=%s + url: https://educ-grad-graduation-report-api-77c02f-dev.apps.silver.devops.gov.bc.ca/api/v1/graduationreports/schoolreport/search?reportType=%s&isLight=true update-school-report: url: https://educ-grad-graduation-report-api-77c02f-dev.apps.silver.devops.gov.bc.ca/api/v1/graduationreports/updateschoolreports?mincode=%s&reportTypeCode=%s update-student-report: From b7a0394fffcdd79ec5ddc111d99978895cc592cf Mon Sep 17 00:00:00 2001 From: mightycox Date: Wed, 4 Dec 2024 10:54:18 -0800 Subject: [PATCH 3/3] GRAD2-3037 - fixes v2 url --- api/src/main/resources/application.yaml | 2 +- api/src/test/resources/application.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/src/main/resources/application.yaml b/api/src/main/resources/application.yaml index 9accdf1b..f44967b1 100644 --- a/api/src/main/resources/application.yaml +++ b/api/src/main/resources/application.yaml @@ -225,7 +225,7 @@ endpoint: get-certificate-types: url: ${GRAD_GRADUATION_REPORT_API}api/v1/graduationreports/certificatetype/%s get-school-reports-lite-by-report-type: - url: ${GRAD_GRADUATION_REPORT_API}api/v2/graduationreports/schoolreport/search?reportType=%s&isLight=true + url: ${GRAD_GRADUATION_REPORT_API}api/v2/graduationreports/schoolreport/search?reportTypeCode=%s&isLight=true update-school-report: url: ${GRAD_GRADUATION_REPORT_API}api/v1/graduationreports/updateschoolreport?mincode=%s&reportTypeCode=%s update-student-report: diff --git a/api/src/test/resources/application.yaml b/api/src/test/resources/application.yaml index fe9c9e5e..db31c849 100644 --- a/api/src/test/resources/application.yaml +++ b/api/src/test/resources/application.yaml @@ -190,7 +190,7 @@ endpoint: get-certificate-types: url: https://educ-grad-graduation-report-api-77c02f-dev.apps.silver.devops.gov.bc.ca/api/v1/graduationreports/certificatetype/%s get-school-reports-lite-by-report-type: - url: https://educ-grad-graduation-report-api-77c02f-dev.apps.silver.devops.gov.bc.ca/api/v1/graduationreports/schoolreport/search?reportType=%s&isLight=true + url: https://educ-grad-graduation-report-api-77c02f-dev.apps.silver.devops.gov.bc.ca/api/v1/graduationreports/schoolreport/search?reportTypeCode=%s&isLight=true update-school-report: url: https://educ-grad-graduation-report-api-77c02f-dev.apps.silver.devops.gov.bc.ca/api/v1/graduationreports/updateschoolreports?mincode=%s&reportTypeCode=%s update-student-report: