Search in sources :

Example 1 with BranchReportParameterForm

use of org.mifos.reports.business.BranchReportParameterForm in project head by mifos.

the class BranchReportParameterValidatorTest method setUp.

@Override
protected void setUp() throws Exception {
    branchReportServiceMock = createMock(BranchReportService.class);
    validator = new BranchReportParamValidator(new ArrayList<String>(), branchReportServiceMock);
    errors = new Errors();
    validForm = new BranchReportParameterForm(BRANCH_ID, VALID_RUN_DATE);
    invalidForm = new BranchReportParameterForm(INVALID_BRANCH_ID, VALID_RUN_DATE);
}
Also used : Errors(org.mifos.platform.validations.Errors) ArrayList(java.util.ArrayList) BranchReportParameterForm(org.mifos.reports.business.BranchReportParameterForm) BranchReportService(org.mifos.reports.business.service.BranchReportService) IBranchReportService(org.mifos.reports.business.service.IBranchReportService)

Example 2 with BranchReportParameterForm

use of org.mifos.reports.business.BranchReportParameterForm in project head by mifos.

the class BranchReportParameterValidatorTest method testValidatorCallsServiceIfDataPresent.

public void testValidatorCallsServiceIfDataPresent() throws Exception {
    expect(branchReportServiceMock.isReportDataPresentForRundateAndBranchId(BRANCH_ID, VALID_RUN_DATE)).andReturn(Boolean.TRUE);
    replay(branchReportServiceMock);
    Errors errors = new Errors();
    validator.validate(new BranchReportParameterForm(BRANCH_ID, VALID_RUN_DATE), errors);
    verify(branchReportServiceMock);
    Assert.assertFalse(errors.hasErrors());
}
Also used : Errors(org.mifos.platform.validations.Errors) BranchReportParameterForm(org.mifos.reports.business.BranchReportParameterForm)

Aggregations

Errors (org.mifos.platform.validations.Errors)2 BranchReportParameterForm (org.mifos.reports.business.BranchReportParameterForm)2 ArrayList (java.util.ArrayList)1 BranchReportService (org.mifos.reports.business.service.BranchReportService)1 IBranchReportService (org.mifos.reports.business.service.IBranchReportService)1