use of org.mifos.framework.exceptions.ServiceException in project head by mifos.
the class GroupBusinessServiceTest method testInvalidConnectionInSearch.
@Test
@ExpectedException(value = CustomerException.class)
public void testInvalidConnectionInSearch() throws PersistenceException {
try {
String searchWord = "globalCustNo";
Short userId = new Short("1");
when(groupPersistence.search(searchWord, userId)).thenThrow(new PersistenceException("some exception"));
service.search(searchWord, userId);
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 OfficeBusinessServiceTest method testInvalidConnectionInGetBranchOffices.
@Test
@ExpectedException(value = CustomerException.class)
public void testInvalidConnectionInGetBranchOffices() throws PersistenceException {
try {
when(officePersistence.getBranchOffices()).thenThrow(new PersistenceException("some exception"));
service.getBranchOffices();
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 OfficeBusinessServiceTest method testInvalidConnectionInGetOfficesTillBranchOffice.
@Test
@ExpectedException(value = CustomerException.class)
public void testInvalidConnectionInGetOfficesTillBranchOffice() throws PersistenceException {
try {
when(officePersistence.getOfficesTillBranchOffice()).thenThrow(new PersistenceException("some exception"));
service.getOfficesTillBranchOffice();
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 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.ServiceException 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) {
}
}
Aggregations