use of org.mifos.framework.exceptions.ServiceException in project head by mifos.
the class PersonnelBusinessServiceTest method testInvalidConnectionInSearch.
@Test
@ExpectedException(value = CustomerException.class)
public void testInvalidConnectionInSearch() throws PersistenceException {
try {
String searchStr = "shortname";
when(personnelPersistence.search(searchStr, id)).thenThrow(new PersistenceException("some exception"));
service.search(searchStr, 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 PersonnelBusinessServiceTest 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.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 OfficeBusinessServiceTest method testInvalidConnectionInGetOffice.
@Test
@ExpectedException(value = CustomerException.class)
public void testInvalidConnectionInGetOffice() throws PersistenceException {
try {
when(officePersistence.getOffice(id)).thenThrow(new PersistenceException("some exception"));
service.getOffice(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 OfficeBusinessServiceTest method testInvalidConnectionInGetBranchOfficesUnderPersonnel.
@Test
@ExpectedException(value = CustomerException.class)
public void testInvalidConnectionInGetBranchOfficesUnderPersonnel() throws PersistenceException {
try {
PersonnelBO personnel = mock(PersonnelBO.class);
String searchId = "somestr";
when(personnel.getOfficeSearchId()).thenReturn(searchId);
when(officePersistence.getActiveBranchesUnderUser(searchId)).thenThrow(new PersistenceException("some exception"));
service.getActiveBranchesUnderUser(personnel);
junit.framework.Assert.fail("should fail because of invalid session");
} catch (ServiceException e) {
}
}
Aggregations