Search in sources :

Example 6 with BranchReportBO

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());
}
Also used : PersonnelBusinessService(org.mifos.customers.personnel.business.service.PersonnelBusinessService) OfficeBusinessService(org.mifos.customers.office.business.service.OfficeBusinessService) BranchReportBO(org.mifos.reports.branchreport.BranchReportBO) BranchReportPersistence(org.mifos.reports.branchreport.persistence.BranchReportPersistence) Before(org.junit.Before)

Example 7 with BranchReportBO

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);
}
Also used : OfficeBO(org.mifos.customers.office.business.OfficeBO) OfficeBusinessService(org.mifos.customers.office.business.service.OfficeBusinessService) BranchReportBO(org.mifos.reports.branchreport.BranchReportBO) IBranchReportService(org.mifos.reports.business.service.IBranchReportService) BranchReportService(org.mifos.reports.business.service.BranchReportService) IBranchReportService(org.mifos.reports.business.service.IBranchReportService) Test(org.junit.Test)

Example 8 with BranchReportBO

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());
}
Also used : LoanArrearsAgingPeriod(org.mifos.reports.branchreport.LoanArrearsAgingPeriod) OfficeBO(org.mifos.customers.office.business.OfficeBO) BranchReportBO(org.mifos.reports.branchreport.BranchReportBO) Test(org.junit.Test)

Example 9 with BranchReportBO

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);
}
Also used : BranchReportBO(org.mifos.reports.branchreport.BranchReportBO) BranchReportService(org.mifos.reports.business.service.BranchReportService) Test(org.junit.Test)

Example 10 with BranchReportBO

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();
}
Also used : BranchReportLoanArrearsAgingBO(org.mifos.reports.branchreport.BranchReportLoanArrearsAgingBO) BranchReportBO(org.mifos.reports.branchreport.BranchReportBO) Before(org.junit.Before)

Aggregations

BranchReportBO (org.mifos.reports.branchreport.BranchReportBO)12 Test (org.junit.Test)9 BranchReportService (org.mifos.reports.business.service.BranchReportService)3 Before (org.junit.Before)2 OfficeBO (org.mifos.customers.office.business.OfficeBO)2 OfficeBusinessService (org.mifos.customers.office.business.service.OfficeBusinessService)2 BranchReportLoanArrearsAgingBO (org.mifos.reports.branchreport.BranchReportLoanArrearsAgingBO)2 BranchReportStaffSummaryBO (org.mifos.reports.branchreport.BranchReportStaffSummaryBO)2 PersonnelBusinessService (org.mifos.customers.personnel.business.service.PersonnelBusinessService)1 PersistenceException (org.mifos.framework.exceptions.PersistenceException)1 LoanArrearsAgingPeriod (org.mifos.reports.branchreport.LoanArrearsAgingPeriod)1 BranchReportPersistence (org.mifos.reports.branchreport.persistence.BranchReportPersistence)1 IBranchReportService (org.mifos.reports.business.service.IBranchReportService)1