Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GRAD2-2625 #525

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -301,16 +301,20 @@ private List<GraduationStudentRecord> filterStudentList(List<GraduationStudentRe
}

private int processGradRegReport(School schoolObj, List<Student> stdList, String mincode, String accessToken, int numberOfReports) {
ReportData gradReport = getReportDataObj(schoolObj, stdList);
createAndSaveSchoolReportGradRegReport(gradReport, mincode, accessToken);
numberOfReports++;
if(stdList != null && !stdList.isEmpty()) {
ReportData gradReport = getReportDataObj(schoolObj, stdList);
createAndSaveSchoolReportGradRegReport(gradReport, mincode, accessToken);
numberOfReports++;
}
return numberOfReports;
}

private int processNonGradRegReport(School schoolObj, List<Student> stdList, String mincode, String accessToken, int numberOfReports) {
ReportData gradReport = getReportDataObj(schoolObj, stdList);
createAndSaveSchoolReportNonGradRegReport(gradReport, mincode, accessToken);
numberOfReports++;
if(stdList != null && !stdList.isEmpty()) {
ReportData gradReport = getReportDataObj(schoolObj, stdList);
createAndSaveSchoolReportNonGradRegReport(gradReport, mincode, accessToken);
numberOfReports++;
}
return numberOfReports;
}

Expand All @@ -324,20 +328,14 @@ private ReportData getReportDataObj(School schoolObj, List<Student> stdList) {
}

private int processStudentNonGradPrjReport(School schoolObj, List<Student> stdList, String mincode, String accessToken, int numberOfReports) {
ReportData nongradProjected = getReportDataObj(schoolObj, stdList);
createAndSaveSchoolReportStudentNonGradPrjReport(nongradProjected, mincode, accessToken);
numberOfReports++;
if(stdList != null && !stdList.isEmpty()) {
ReportData nongradProjected = getReportDataObj(schoolObj, stdList);
createAndSaveSchoolReportStudentNonGradPrjReport(nongradProjected, mincode, accessToken);
numberOfReports++;
}
return numberOfReports;
}

/**
private int processStudentNonGradReport(School schoolObj, List<Student> stdList, String mincode, String accessToken, int numberOfReports) {
ReportData nongradProjected = getReportDataObj(schoolObj, stdList);
createAndSaveSchoolReportStudentNonGradReport(nongradProjected, mincode, accessToken);
numberOfReports++;
return numberOfReports;
}**/

@SneakyThrows
private List<Student> processStudentList(List<GraduationStudentRecord> gradStudList, String type) {
List<Student> stdPrjList = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,10 @@
import org.junit.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.junit.jupiter.MockitoExtension;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.security.oauth2.client.registration.ClientRegistrationRepository;
Expand Down Expand Up @@ -2040,7 +2038,7 @@ public void testCreateAndStoreSchoolReports() {
Mockito.when(gradStatusService.getStudentListByMinCode(mincode, "accessToken")).thenReturn(sList);
Mockito.when(schoolService.getTraxSchoolDetails(mincode, "accessToken", exception)).thenReturn(sTrax);
int numberOfRecord = graduationService.createAndStoreSchoolReports(uniqueList,"REGALG","accessToken");
assertEquals(2,numberOfRecord);
assertEquals(1,numberOfRecord);
}

@Test
Expand Down
Loading