use of org.mifos.reports.branchreport.BranchReportBO in project head by mifos.
the class BranchReportServiceIntegrationTest method setUp.
@Override
@Before
public void setUp() throws Exception {
super.setUp();
branchReport = new BranchReportBO(BRANCH_ID_SHORT, RUN_DATE);
populateClientSummary();
populateLoanArrearSummary();
session = StaticHibernateUtil.getSessionTL();
// transaction = session.beginTransaction();
officeBusinessServiceMock = createMock(OfficeBusinessService.class);
branchReportService = new BranchReportService(officeBusinessServiceMock, new PersonnelBusinessService(), new BranchReportPersistence());
}
use of org.mifos.reports.branchreport.BranchReportBO in project head by mifos.
the class BranchReportHelperIntegrationTest method testBatchCreatesRowForBranchReportBatchBO.
@Test
public void testBatchCreatesRowForBranchReportBatchBO() throws PersistenceException, ServiceException, BatchJobException {
branchReportHelper = new BranchReportHelper();
OfficeBO office = new OfficeBusinessService().getOffice(BRANCH_ID_SHORT);
BranchReportBO generatedBranchReport = branchReportHelper.createBranchReport(session, office, RUN_DATE);
IBranchReportService branchReportService = new BranchReportService();
BranchReportBO retrievedBranchReports = branchReportService.getBranchReport(BRANCH_ID_SHORT, RUN_DATE);
assertBranchReport(generatedBranchReport, retrievedBranchReports);
assertClientSummaryReport(generatedBranchReport.getClientSummaries(), branchReportService);
assertLoanArrearsAging(generatedBranchReport.getLoanArrearsAging(), branchReportService);
assertStaffSummary(generatedBranchReport.getStaffSummaries(), branchReportService);
assertStaffingLevelSummary(generatedBranchReport.getStaffingLevelSummaries(), branchReportService);
assertLoanDetails(generatedBranchReport.getLoanDetails(), branchReportService);
assertLoanArrearsProfile(generatedBranchReport.getLoanArrearsProfile(), branchReportService);
}
use of org.mifos.reports.branchreport.BranchReportBO in project head by mifos.
the class BranchReportLoanArrearsAgingHelperIntegrationTest method testLoanArrearsAgingHelperPopulatesAgingFields.
@Test
public void testLoanArrearsAgingHelperPopulatesAgingFields() throws Exception {
BranchReportBO branchReportLoanArrearsBatchBO = BranchReportBOFixture.createBranchReport(Integer.valueOf(1), Short.valueOf("3"), DateUtils.currentDate());
OfficeBO office = OfficecFixture.createOffice(Short.valueOf("3"));
for (LoanArrearsAgingPeriod period : expectedPeriods) {
expect(branchReportServiceMock.extractLoanArrearsAgingInfoInPeriod(office.getOfficeId(), period, DEFAULT_CURRENCY)).andReturn(BranchReportBOFixture.createLoanArrearsAging(period));
expect(branchReportConfigServiceMock.getCurrency()).andReturn(DEFAULT_CURRENCY);
}
replay(branchReportServiceMock);
replay(branchReportConfigServiceMock);
new BranchReportLoanArrearsAgingHelper(branchReportLoanArrearsBatchBO, branchReportServiceMock, branchReportConfigServiceMock).populateLoanArrearsAging();
verify(branchReportServiceMock);
verify(branchReportConfigServiceMock);
assertLoanArrearsAgingPopulated(branchReportLoanArrearsBatchBO.getLoanArrearsAging());
}
use of org.mifos.reports.branchreport.BranchReportBO in project head by mifos.
the class BranchReportStaffingLevelSummaryHelperIntegrationTest method testPopulateStaffingLevelSummary.
@Test
public void testPopulateStaffingLevelSummary() throws Exception {
BranchReportBO branchReport = BranchReportBOFixture.createBranchReport(Integer.valueOf(1), BRANCH_ID, DateUtils.currentDate());
new BranchReportStaffingLevelSummaryHelper(branchReport, new BranchReportService()).populateStaffingLevelSummary();
assertStaffingLevelSummaries(branchReport);
}
use of org.mifos.reports.branchreport.BranchReportBO in project head by mifos.
the class BranchReportPersistenceIntegrationTest method setUp.
@Override
@Before
public void setUp() throws Exception {
super.setUp();
branchReportPersistence = new BranchReportPersistence();
runDate = DateUtils.getDate(2008, Calendar.JANUARY, 1);
branchReportWithLoanArrears = new BranchReportBO(BRANCH_ID, runDate);
branchReportWithLoanArrears.addLoanArrearsAging(new BranchReportLoanArrearsAgingBO(LoanArrearsAgingPeriod.ONE_WEEK));
branchReportWithClientSummaries = new BranchReportBO(BRANCH_ID, runDate);
branchReportWithClientSummaries.addClientSummary(BranchReportBOFixture.createBranchReportClientSummaryBO(BranchReportClientSummaryBO.CENTER_COUNT));
branchReportWithStaffSummary = new BranchReportBO(BRANCH_ID, runDate);
branchReportWithStaffSummary.addStaffSummary(BranchReportBOFixture.createBranchReportStaffSummaryBO());
session = StaticHibernateUtil.getSessionTL();
}
Aggregations