use of org.mifos.customers.business.CustomerMovementEntity in project head by mifos.
the class ClientIntegrationTest method testUpdateBranchSecondTime.
@Test
public void testUpdateBranchSecondTime() throws Exception {
StaticHibernateUtil.closeSession();
createObjectsForClientTransfer();
Assert.assertNull(client.getActiveCustomerMovement());
OfficeBO oldOffice = client.getOffice();
client.transferToBranch(office);
StaticHibernateUtil.flushSession();
client = TestObjectFactory.getClient(client.getCustomerId());
client.setUserContext(TestUtils.makeUser());
CustomerMovementEntity currentMovement = client.getActiveCustomerMovement();
Assert.assertNotNull(currentMovement);
Assert.assertEquals(office.getOfficeId(), currentMovement.getOffice().getOfficeId());
Assert.assertEquals(office.getOfficeId(), client.getOffice().getOfficeId());
client.transferToBranch(oldOffice);
StaticHibernateUtil.flushSession();
client = TestObjectFactory.getClient(client.getCustomerId());
currentMovement = client.getActiveCustomerMovement();
Assert.assertNotNull(currentMovement);
Assert.assertEquals(oldOffice.getOfficeId(), currentMovement.getOffice().getOfficeId());
Assert.assertEquals(oldOffice.getOfficeId(), client.getOffice().getOfficeId());
office = new OfficePersistence().getOffice(office.getOfficeId());
}
Aggregations