Search in sources :

Example 6 with CustomerSearchDto

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());
}
Also used : QueryResult(org.mifos.framework.hibernate.helper.QueryResult) PersonnelBO(org.mifos.customers.personnel.business.PersonnelBO) LoanBO(org.mifos.accounts.loan.business.LoanBO) CustomerSearchDto(org.mifos.customers.business.CustomerSearchDto) List(java.util.List) Test(org.junit.Test)

Aggregations

CustomerSearchDto (org.mifos.customers.business.CustomerSearchDto)6 Test (org.junit.Test)3 HibernateSearchException (org.mifos.framework.exceptions.HibernateSearchException)3 QueryResult (org.mifos.framework.hibernate.helper.QueryResult)3 List (java.util.List)2 Query (org.hibernate.Query)2 Session (org.hibernate.Session)2 LoanBO (org.mifos.accounts.loan.business.LoanBO)2 PersonnelBO (org.mifos.customers.personnel.business.PersonnelBO)2 ArrayList (java.util.ArrayList)1 Locale (java.util.Locale)1 UserContextFactory (org.mifos.accounts.servicefacade.UserContextFactory)1 MifosRuntimeException (org.mifos.core.MifosRuntimeException)1 CustomerPersistence (org.mifos.customers.persistence.CustomerPersistence)1 CenterSearchResultDto (org.mifos.dto.screen.CenterSearchResultDto)1 ClientSearchResultDto (org.mifos.dto.screen.ClientSearchResultDto)1 CustomerHierarchyDto (org.mifos.dto.screen.CustomerHierarchyDto)1 GroupSearchResultDto (org.mifos.dto.screen.GroupSearchResultDto)1 LoanAccountSearchResultDto (org.mifos.dto.screen.LoanAccountSearchResultDto)1 SavingsAccountSearchResultDto (org.mifos.dto.screen.SavingsAccountSearchResultDto)1