use of org.mifos.dto.domain.ClientPersonalInfoUpdate in project head by mifos.
the class ClientUpdateTest method rollsbackTransactionClosesSessionAndReThrowsApplicationException2.
@Test(expected = CustomerException.class)
public void rollsbackTransactionClosesSessionAndReThrowsApplicationException2() throws Exception {
// setup
UserContext userContext = TestUtils.makeUser();
ClientPersonalInfoUpdate clientPersonalInfoUpdate = new ClientPersonalInfoUpdateBuilder().build();
// stubbing
when(customerDao.findCustomerById(clientPersonalInfoUpdate.getCustomerId())).thenReturn(mockedClient);
doThrow(new CustomerException(ClientConstants.INVALID_DOB_EXCEPTION)).when(mockedClient).updatePersonalInfo(clientPersonalInfoUpdate);
// exercise test
customerService.updateClientPersonalInfo(userContext, clientPersonalInfoUpdate);
// verification
verify(hibernateTransactionHelper).rollbackTransaction();
verify(hibernateTransactionHelper).closeSession();
}
Aggregations