use of org.mifos.framework.exceptions.PersistenceException in project head by mifos.
the class GroupBusinessServiceTest method testInvalidConnectionInGetGroup.
@Test
@ExpectedException(value = CustomerException.class)
public void testInvalidConnectionInGetGroup() throws PersistenceException {
try {
Integer customerId = new Integer(1);
when(groupPersistence.getGroupByCustomerId(customerId)).thenThrow(new PersistenceException("some exception"));
service.getGroup(customerId);
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 GroupBusinessServiceTest method testInvalidConnectionInFindBySystemId.
@Test
@ExpectedException(value = CustomerException.class)
public void testInvalidConnectionInFindBySystemId() throws PersistenceException {
try {
String globalCustNo = "globalCustNo";
when(groupPersistence.findBySystemId(globalCustNo)).thenThrow(new PersistenceException("some exception"));
service.findBySystemId(globalCustNo);
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 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.PersistenceException 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.PersistenceException 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) {
}
}
Aggregations