use of org.mifos.framework.exceptions.PersistenceException in project head by mifos.
the class PersonnelBusinessServiceTest method testInvalidConnectionInGetActiveLoanOfficersUnderOffice.
@Test
@ExpectedException(value = CustomerException.class)
public void testInvalidConnectionInGetActiveLoanOfficersUnderOffice() throws PersistenceException {
try {
when(personnelPersistence.getActiveLoanOfficersUnderOffice(id)).thenThrow(new PersistenceException("some exception"));
service.getActiveLoanOfficersUnderOffice(id);
junit.framework.Assert.fail("should fail because of invalid session");
} catch (ServiceException e) {
}
}
use of org.mifos.framework.exceptions.PersistenceException in project head by mifos.
the class RolesPermissionsBusinessServiceTest method testInvalidConnectionInGetRole.
@Test
@ExpectedException(value = CustomerException.class)
public void testInvalidConnectionInGetRole() throws PersistenceException {
try {
when(rolesPermissionsPersistence.getRole(id)).thenThrow(new PersistenceException("some exception"));
service.getRole(id);
junit.framework.Assert.fail("should fail because of invalid session");
} catch (ServiceException e) {
}
}
use of org.mifos.framework.exceptions.PersistenceException in project head by mifos.
the class RolesPermissionsBusinessServiceTest method testInvalidConnectionInGetRoles.
@Test
@ExpectedException(value = CustomerException.class)
public void testInvalidConnectionInGetRoles() throws PersistenceException {
try {
when(rolesPermissionsPersistence.getRoles()).thenThrow(new PersistenceException("some exception"));
service.getRoles();
junit.framework.Assert.fail("should fail because of invalid session");
} catch (ServiceException e) {
}
}
use of org.mifos.framework.exceptions.PersistenceException in project head by mifos.
the class RolesPermissionsBusinessServiceTest method testInvalidConnectionInGetActivities.
@Test
@ExpectedException(value = CustomerException.class)
public void testInvalidConnectionInGetActivities() throws PersistenceException {
try {
when(rolesPermissionsPersistence.getActivities()).thenThrow(new PersistenceException("some exception"));
service.getActivities();
junit.framework.Assert.fail("should fail because of invalid session");
} catch (ServiceException e) {
}
}
use of org.mifos.framework.exceptions.PersistenceException in project head by mifos.
the class AdminDocumentsServiceImpl method getAdminDocumentsForAccountPayment.
@Override
public List<AdminDocumentDto> getAdminDocumentsForAccountPayment(Integer paymentId) {
try {
List<AdminDocumentDto> adminDocuments = new ArrayList<AdminDocumentDto>();
AccountPaymentEntity accountPaymentEntity = legacyAccountDao.findPaymentById(paymentId);
Set<AccountTrxnEntity> accountTrxnEntities = accountPaymentEntity.getAccountTrxns();
for (AccountTrxnEntity accountTrxnEntity : accountTrxnEntities) {
List<AdminDocumentBO> adminDocumentBOs = legacyAdminDocumentDao.getActiveAdminDocumentsByAccountActionId(accountTrxnEntity.getAccountActionEntity().getId());
if (adminDocumentBOs != null && !adminDocumentBOs.isEmpty()) {
for (AdminDocumentBO adminDocumentBO : adminDocumentBOs) {
AdminDocumentDto adminDocumentDto = new AdminDocumentDto(adminDocumentBO.getAdmindocId().intValue(), adminDocumentBO.getAdminDocumentName(), adminDocumentBO.getAdminDocumentIdentifier(), BooleanUtils.toBoolean(adminDocumentBO.getIsActive().intValue()));
if (!adminDocuments.contains(adminDocumentDto)) {
adminDocuments.add(adminDocumentDto);
}
}
}
}
return adminDocuments;
} catch (PersistenceException e) {
throw new MifosRuntimeException(e);
}
}
Aggregations