Skip to content

Commit

Permalink
GRAD2-2817
Browse files Browse the repository at this point in the history
TVR Delete Process - Backend Changes Endpoints
  • Loading branch information
arybakov-cgi committed Aug 19, 2024
1 parent 3863587 commit 9b81086
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,15 @@ public void testGetStudentCertificate() {
public void testGetReportsCount() {
// ID
String mincode = "123456789";
String guid = UUID.randomUUID().toString();

Mockito.when(commonService.countBySchoolOfRecordsAndReportType(List.of(mincode), "reportType")).thenReturn(1);
commonController.getReportsCount("reportType", List.of(mincode));
Mockito.verify(commonService).countBySchoolOfRecordsAndReportType(List.of(mincode), "reportType");

Mockito.when(commonService.countByStudentGuidsAndReportType(List.of(guid), "ACHV")).thenReturn(1);
commonController.getReportsCount("ACHV", List.of(guid));
Mockito.verify(commonService).countByStudentGuidsAndReportType(List.of(guid), "ACHV");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1688,6 +1688,19 @@ public void testCountBySchoolOfRecordsAndReportType() {
assertThat(count).isNotNull().isEqualTo(1);
}

@Test
public void testCountByStudentGuidsAndReportType() {

UUID uuid = UUID.randomUUID();
Mockito.when(gradStudentReportsRepository.countByStudentGuidsAndReportType(List.of(uuid), "reportType")).thenReturn(1);
Integer count = commonService.countByStudentGuidsAndReportType(List.of(uuid.toString()), "reportType");
assertThat(count).isNotNull().isEqualTo(1);

Mockito.when(gradStudentReportsRepository.countByReportType("reportType")).thenReturn(1);
count = commonService.countByStudentGuidsAndReportType(List.of(), "reportType");
assertThat(count).isNotNull().isEqualTo(1);
}

@Test
public void testArchiveSchoolReports() {
Mockito.when(schoolReportsRepository.deleteSchoolReports(List.of("12345678"), "reportTypeARC".toUpperCase())).thenReturn(1);
Expand Down

0 comments on commit 9b81086

Please sign in to comment.