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);
}
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());
}
Aggregations