use of org.mifos.framework.hibernate.helper.QueryResult in project head by mifos.
the class CustomerPersistenceIntegrationTest method testSearchWithCancelLoanAccounts.
@SuppressWarnings("unchecked")
@Test
public void testSearchWithCancelLoanAccounts() throws Exception {
groupAccount = getLoanAccount();
PersonnelBO loggedInUser = IntegrationTestObjectMother.testUser();
groupAccount.changeStatus(AccountState.LOAN_CANCELLED, AccountStateFlag.LOAN_WITHDRAW.getValue(), "WITHDRAW LOAN ACCOUNT", loggedInUser);
TestObjectFactory.updateObject(groupAccount);
StaticHibernateUtil.flushSession();
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(0, customerSearchDto.getLoanGlobalAccountNum().size());
}
use of org.mifos.framework.hibernate.helper.QueryResult in project head by mifos.
the class PersonnelBusinessServiceIntegrationTest method testSearch.
@Test
public void testSearch() throws Exception {
personnel = createPersonnel();
QueryResult queryResult = personnelBusinessService.search(personnel.getUserName(), Short.valueOf("1"));
Assert.assertNotNull(queryResult);
Assert.assertEquals(1, queryResult.getSize());
Assert.assertEquals(1, queryResult.get(0, 10).size());
}
use of org.mifos.framework.hibernate.helper.QueryResult in project head by mifos.
the class CenterPersistenceIntegrationTest method testSearch.
@Test
public void testSearch() throws Exception {
String centerName = "NewCenter";
center = TestObjectFactory.createWeeklyFeeCenter(centerName, getMeeting());
QueryResult queryResult = new CenterPersistence().search(center.getDisplayName(), Short.valueOf("1"));
Assert.assertNotNull(queryResult);
Assert.assertEquals(1, queryResult.getSize());
Assert.assertEquals(1, queryResult.get(0, 10).size());
}
Aggregations