use of org.mifos.framework.hibernate.helper.QueryResult in project head by mifos.
the class CustomerPersistenceIntegrationTest method testSearchWithOfficeId.
@Test
public void testSearchWithOfficeId() throws Exception {
createCustomers(CustomerStatus.GROUP_ACTIVE, CustomerStatus.CLIENT_ACTIVE);
StaticHibernateUtil.flushSession();
QueryResult queryResult = new CustomerPersistence().search("C", Short.valueOf("3"), Short.valueOf("1"), Short.valueOf("1"), filters);
Assert.assertNotNull(queryResult);
Assert.assertEquals(2, queryResult.getSize());
Assert.assertEquals(2, queryResult.get(0, 10).size());
}
use of org.mifos.framework.hibernate.helper.QueryResult in project head by mifos.
the class CustomerPersistenceIntegrationTest method testSearchWithGlobalNo.
@Test
public void testSearchWithGlobalNo() throws Exception {
createCustomers(CustomerStatus.GROUP_ACTIVE, CustomerStatus.CLIENT_ACTIVE);
StaticHibernateUtil.flushSession();
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());
Assert.assertEquals(1, queryResult.get(0, 10).size());
}
use of org.mifos.framework.hibernate.helper.QueryResult in project head by mifos.
the class CustomerPersistenceIntegrationTest method testSearchWithAccountGlobalNo.
@Test
public void testSearchWithAccountGlobalNo() throws Exception {
getCustomer();
StaticHibernateUtil.flushSession();
QueryResult queryResult = new CustomerPersistence().search(groupAccount.getGlobalAccountNum(), Short.valueOf("3"), Short.valueOf("1"), Short.valueOf("1"), filters);
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 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());
}
use of org.mifos.framework.hibernate.helper.QueryResult in project head by mifos.
the class CustomerPersistenceIntegrationTest method testSearchGropAndClientForLoNoResults.
@Test
public void testSearchGropAndClientForLoNoResults() throws Exception {
meeting = TestObjectFactory.createMeeting(TestObjectFactory.getTypicalMeeting());
center = TestObjectFactory.createWeeklyFeeCenter("Center", meeting, Short.valueOf("3"), Short.valueOf("3"));
group = TestObjectFactory.createGroupUnderCenter("Group", CustomerStatus.GROUP_ACTIVE, "1234", true, new java.util.Date(), null, null, null, Short.valueOf("3"), center);
StaticHibernateUtil.flushSession();
QueryResult queryResult = new CustomerPersistence().searchGroupClient("C", Short.valueOf("3"), false);
Assert.assertNotNull(queryResult);
Assert.assertEquals(0, queryResult.getSize());
Assert.assertEquals(0, queryResult.get(0, 10).size());
}
Aggregations