use of org.springframework.test.annotation.ExpectedException 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.springframework.test.annotation.ExpectedException 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.springframework.test.annotation.ExpectedException 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.springframework.test.annotation.ExpectedException 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.springframework.test.annotation.ExpectedException 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) {
}
}
Aggregations