Search in sources :

Example 6 with ClientMfiInfoUpdate

use of org.mifos.dto.domain.ClientMfiInfoUpdate in project head by mifos.

the class ClientUpdateTest method clientMfiDetailsAreUpdated.

@Test
public void clientMfiDetailsAreUpdated() throws Exception {
    // setup
    UserContext userContext = TestUtils.makeUser();
    ClientMfiInfoUpdate clientMfiInfoUpdate = new ClientMfiInfoUpdateBuilder().build();
    // stubbing
    when(customerDao.findCustomerById(clientMfiInfoUpdate.getClientId())).thenReturn(mockedClient);
    when(personnelDao.findPersonnelById(clientMfiInfoUpdate.getPersonnelId())).thenReturn(personnel);
    // exercise test
    customerService.updateClientMfiInfo(userContext, clientMfiInfoUpdate);
    // verification
    verify(mockedClient).updateMfiInfo(personnel, clientMfiInfoUpdate);
}
Also used : ClientMfiInfoUpdateBuilder(org.mifos.domain.builders.ClientMfiInfoUpdateBuilder) UserContext(org.mifos.security.util.UserContext) ClientMfiInfoUpdate(org.mifos.dto.domain.ClientMfiInfoUpdate) Test(org.junit.Test)

Aggregations

ClientMfiInfoUpdate (org.mifos.dto.domain.ClientMfiInfoUpdate)6 Test (org.junit.Test)5 ClientMfiInfoUpdateBuilder (org.mifos.domain.builders.ClientMfiInfoUpdateBuilder)5 UserContext (org.mifos.security.util.UserContext)5 CustomerException (org.mifos.customers.exceptions.CustomerException)3 Date (java.sql.Date)1 DateTime (org.joda.time.DateTime)1 InvalidDateException (org.mifos.application.admin.servicefacade.InvalidDateException)1 MifosRuntimeException (org.mifos.core.MifosRuntimeException)1 ClientBO (org.mifos.customers.client.business.ClientBO)1 ClientCustActionForm (org.mifos.customers.client.struts.actionforms.ClientCustActionForm)1 CloseSession (org.mifos.framework.util.helpers.CloseSession)1 TransactionDemarcate (org.mifos.framework.util.helpers.TransactionDemarcate)1 InOrder (org.mockito.InOrder)1