use of org.mifos.customers.business.CustomerSearchDto in project head by mifos.
the class CustomerPersistenceIntegrationTest method testSearchForActiveInBadStandingLoanAccount.
@SuppressWarnings("unchecked")
@Test
public void testSearchForActiveInBadStandingLoanAccount() throws Exception {
groupAccount = getLoanAccount();
PersonnelBO loggedInUser = IntegrationTestObjectMother.testUser();
groupAccount.changeStatus(AccountState.LOAN_ACTIVE_IN_BAD_STANDING, null, "Changing to badStanding", loggedInUser);
TestObjectFactory.updateObject(groupAccount);
groupAccount = TestObjectFactory.getObject(LoanBO.class, groupAccount.getAccountId());
center = TestObjectFactory.getCustomer(center.getCustomerId());
group = TestObjectFactory.getCustomer(group.getCustomerId());
QueryResult queryResult = new CustomerPersistence().search(group.getGlobalCustNum(), Short.valueOf("3"), Short.valueOf("1"), Short.valueOf("1"), filters);
Assert.assertNotNull(queryResult);
Assert.assertEquals(1, queryResult.getSize());
List results = queryResult.get(0, 10);
Assert.assertEquals(1, results.size());
CustomerSearchDto customerSearchDto = (CustomerSearchDto) results.get(0);
Assert.assertEquals(1, customerSearchDto.getLoanGlobalAccountNum().size());
}
Aggregations