use of org.mifos.customers.checklist.business.CheckListBO in project head by mifos.
the class CheckListActionStrutsTest method testManage_customerGroup.
@Test
public void testManage_customerGroup() throws Exception {
CheckListBO checkList = TestObjectFactory.createCustomerChecklist(CustomerLevel.GROUP.getValue(), CustomerStatus.GROUP_ACTIVE.getValue(), (short) 1);
StaticHibernateUtil.flushSession();
setRequestPathInfo("/chkListAction");
addRequestParameter("method", "manage");
addRequestParameter("checkListId", checkList.getChecklistId().toString());
addRequestParameter(Constants.CURRENTFLOWKEY, flowKey);
StaticHibernateUtil.flushAndClearSession();
actionPerform();
verifyNoActionErrors();
verifyForward(ActionForwards.manage_success.toString());
Assert.assertNotNull(request.getAttribute(Constants.CURRENTFLOWKEY));
StaticHibernateUtil.flushSession();
checkList = (CheckListBO) TestObjectFactory.getObject(CustomerCheckListBO.class, checkList.getChecklistId());
checkList = null;
}
use of org.mifos.customers.checklist.business.CheckListBO in project head by mifos.
the class CheckListActionStrutsTest method testUpdate_customer.
@Test
public void testUpdate_customer() throws Exception {
CheckListBO checkList = TestObjectFactory.createCustomerChecklist(CustomerLevel.CENTER.getValue(), CustomerStatus.CENTER_ACTIVE.getValue(), (short) 1);
StaticHibernateUtil.flushSession();
checkList = (CheckListBO) TestObjectFactory.getObject(CustomerCheckListBO.class, checkList.getChecklistId());
setRequestPathInfo("/chkListAction");
addRequestParameter("method", "update");
addRequestParameter("checklistName", checkList.getChecklistName());
addRequestParameter("isCustomer", "true");
addRequestParameter("detailsList[0]", "newdetails");
addRequestParameter("masterTypeId", ((CustomerCheckListBO) checkList).getCustomerLevel().getId().toString());
addRequestParameter("stateId", ((CustomerCheckListBO) checkList).getCustomerStatus().getId().toString());
addRequestParameter("checklistStatus", CheckListConstants.STATUS_INACTIVE.toString());
request.setAttribute(Constants.CURRENTFLOWKEY, flowKey);
SessionUtils.setAttribute(Constants.BUSINESS_KEY, checkList, request);
actionPerform();
verifyNoActionErrors();
verifyForward(ActionForwards.update_success.toString());
Assert.assertNull(request.getAttribute(Constants.CURRENTFLOWKEY));
StaticHibernateUtil.flushSession();
checkList = (CheckListBO) TestObjectFactory.getObject(CustomerCheckListBO.class, checkList.getChecklistId());
Assert.assertEquals(1, checkList.getChecklistDetails().size());
checkList = null;
}
Aggregations