Skip to content

Commit

Permalink
Fixed the broken logic & unit test.
Browse files Browse the repository at this point in the history
Fixed the broken logic & unit test.
  • Loading branch information
infstar committed Jan 23, 2025
1 parent 59e35a4 commit a668874
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -447,17 +447,17 @@ public void updateStudentCredentialRecord(UUID studentID, String credentialTypeC

public void deleteSchoolReportRecord(UUID schoolId, String reportTypeCode) {
ThreadLocalStateUtil.setCorrelationID(UUID.randomUUID().toString());
restService.delete(String.format(constants.getDeleteSchoolReportsBySchoolIdAndReportType(),reportTypeCode), Boolean.class);
restService.delete(String.format(constants.getDeleteSchoolReportsBySchoolIdAndReportType(),schoolId, reportTypeCode), Boolean.class);
}

public void deleteDistrictReportRecord(UUID districtId, String reportTypeCode) {
public void deleteSchoolReportRecord(String reportTypeCode) {
ThreadLocalStateUtil.setCorrelationID(UUID.randomUUID().toString());
restService.delete(String.format(constants.getDeleteDistrictReportsByDistrictIdAndReportType(),reportTypeCode), Boolean.class);
restService.delete(String.format(constants.getDeleteSchoolReportsByReportType(),reportTypeCode), Boolean.class);
}

public void deleteSchoolReportRecord(String reportTypeCode) {
public void deleteDistrictReportRecord(UUID districtId, String reportTypeCode) {
ThreadLocalStateUtil.setCorrelationID(UUID.randomUUID().toString());
restService.delete(String.format(constants.getDeleteSchoolReportsByReportType(),reportTypeCode), Boolean.class);
restService.delete(String.format(constants.getDeleteDistrictReportsByDistrictIdAndReportType(),districtId, reportTypeCode), Boolean.class);
}

public void deleteDistrictReportRecord(String reportTypeCode) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1331,7 +1331,7 @@ public void testDeleteDistrictReportRecordByReportType() {

when(this.restService.delete(String.format(constants.getDeleteDistrictReportsByReportType(),reportTypeCode), Boolean.class)).thenReturn(true);

restUtils.deleteSchoolReportRecord(reportTypeCode);
restUtils.deleteDistrictReportRecord(reportTypeCode);
assertThat(reportTypeCode).isEqualTo("E");
}

Expand All @@ -1344,7 +1344,7 @@ public void testDeleteDistrictReportRecord() {

when(this.restService.delete(String.format(constants.getDeleteDistrictReportsByDistrictIdAndReportType(),districtId,reportTypeCode), Boolean.class)).thenReturn(true);

this.restUtils.deleteSchoolReportRecord(districtId,reportTypeCode);
this.restUtils.deleteDistrictReportRecord(districtId,reportTypeCode);
assertThat(reportTypeCode).isEqualTo("E");
}

Expand Down

0 comments on commit a668874

Please sign in to comment.