Skip to content

Commit

Permalink
Fixed the broken unit test.
Browse files Browse the repository at this point in the history
Fixed the broken unit test.
  • Loading branch information
infstar committed Nov 20, 2024
1 parent f47cb1f commit 0c6624b
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down
2 changes: 1 addition & 1 deletion api/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion api/src/test/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"data" : {
"student" : null,
"school" : {
"schoolId" : "b69bc244-b93b-2a9f-d2b1-3d8ffae92866",
"mincode" : "02828034",
"name" : "CORRELIEU SECONDARY",
"typeIndicator" : null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
}
},
"school" : {
"schoolId" : "b69bc244-b93b-2a9f-d2b1-3d8ffae92866",
"mincode" : "06398007",
"name" : "SOUTH ISLAND DISTANCE EDUCATION SCHOOL",
"typeIndicator" : "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"nonGradReasons" : [ ]
},
"school" : {
"schoolId" : "b69bc244-b93b-2a9f-d2b1-3d8ffae92866",
"mincode" : "00502001",
"name" : "ROBERT EDGELL",
"typeIndicator" : "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"nonGradReasons" : [ ]
},
"school" : {
"schoolId" : "b69bc244-b93b-2a9f-d2b1-3d8ffae92866",
"mincode" : "00502001",
"name" : "Ecole Secondaire Mark R. Isfeld Secondary",
"typeIndicator" : "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"nonGradReasons" : [ ]
},
"school" : {
"schoolId" : "b69bc244-b93b-2a9f-d2b1-3d8ffae92866",
"mincode" : "00502001",
"name" : "ROBERT EDGELL",
"typeIndicator" : "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"frenchCert": "F"
},
"school" : {
"schoolId" : "b69bc244-b93b-2a9f-d2b1-3d8ffae92866",
"mincode": "03699064",
"name": "Ecole Secondaire Mark R. Isfeld Secondary",
"typeIndicator": "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"frenchCert": "F"
},
"school": {
"schoolId" : "b69bc244-b93b-2a9f-d2b1-3d8ffae92866",
"mincode": "03939008",
"name": "LORD BYNG SECONDARY",
"typeIndicator": "",
Expand Down

0 comments on commit 0c6624b

Please sign in to comment.