use of org.mifos.framework.exceptions.ServiceException in project head by mifos.
the class PersonnelBusinessServiceTest method testInvalidConnectionInGetPersonnelByUsername.
@Test
@ExpectedException(value = CustomerException.class)
public void testInvalidConnectionInGetPersonnelByUsername() throws PersistenceException {
try {
String shortName = "shortname";
when(personnelPersistence.getPersonnelByUserName(shortName)).thenThrow(new PersistenceException("some exception"));
service.getPersonnel(shortName);
junit.framework.Assert.fail("should fail because of invalid session");
} catch (ServiceException e) {
}
}
use of org.mifos.framework.exceptions.ServiceException in project head by mifos.
the class ReportsDataServiceTest method setUp.
@Override
protected void setUp() throws Exception {
loanPrdBusinessServiceMock = createMock(LoanPrdBusinessService.class);
personnelBusinessServiceMock = createMock(PersonnelBusinessService.class);
officeBusinessServiceMock = createMock(OfficeBusinessService.class);
personnelMock = createMock(PersonnelBO.class);
legacyLoanDaoMock = createMock(LegacyLoanDao.class);
expectedException = new ServiceException("someServiceException");
userId = 1;
branchId = 2;
localeId = 3;
loanOfficerId = 3;
loanProductId = 4;
reportsDataService = new ReportsDataService();
reportsDataService.setLoanPrdBusinessService(loanPrdBusinessServiceMock);
reportsDataService.setPersonnelBusinessService(personnelBusinessServiceMock);
reportsDataService.setOfficeBusinessService(officeBusinessServiceMock);
reportsDataService.setPersonnel(personnelMock);
reportsDataService.setlegacyLoanDao(legacyLoanDaoMock);
}
use of org.mifos.framework.exceptions.ServiceException in project head by mifos.
the class BranchReportService method getStaffingLevelSummary.
@Override
public List<BranchReportStaffingLevelSummaryBO> getStaffingLevelSummary(Integer branchId, String runDate) throws ServiceException {
try {
List<BranchReportStaffingLevelSummaryBO> staffingLevelSummary = branchReportPersistence.getBranchReportStaffingLevelSummary(convertIntegerToShort(branchId), ReportUtils.parseReportDate(runDate));
Collections.sort(staffingLevelSummary);
return staffingLevelSummary;
} catch (PersistenceException e) {
throw new ServiceException(e);
} catch (ParseException e) {
throw new ServiceException(e);
}
}
Aggregations