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