Search in sources :

Example 11 with CheckListBO

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;
}
Also used : CheckListBO(org.mifos.customers.checklist.business.CheckListBO) CustomerCheckListBO(org.mifos.customers.checklist.business.CustomerCheckListBO) AccountCheckListBO(org.mifos.customers.checklist.business.AccountCheckListBO) Test(org.junit.Test)

Example 12 with CheckListBO

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;
}
Also used : CheckListBO(org.mifos.customers.checklist.business.CheckListBO) CustomerCheckListBO(org.mifos.customers.checklist.business.CustomerCheckListBO) AccountCheckListBO(org.mifos.customers.checklist.business.AccountCheckListBO) Test(org.junit.Test)

Aggregations

AccountCheckListBO (org.mifos.customers.checklist.business.AccountCheckListBO)12 CheckListBO (org.mifos.customers.checklist.business.CheckListBO)12 CustomerCheckListBO (org.mifos.customers.checklist.business.CustomerCheckListBO)12 Test (org.junit.Test)10 CheckListPersistence (org.mifos.customers.checklist.persistence.CheckListPersistence)2 ChkListActionForm (org.mifos.customers.checklist.struts.actionforms.ChkListActionForm)2 TransactionDemarcate (org.mifos.framework.util.helpers.TransactionDemarcate)2 ArrayList (java.util.ArrayList)1 CheckListDetailEntity (org.mifos.customers.checklist.business.CheckListDetailEntity)1 PersonnelBusinessService (org.mifos.customers.personnel.business.service.PersonnelBusinessService)1 CheckListMasterDto (org.mifos.dto.domain.CheckListMasterDto)1 CheckListStatesView (org.mifos.dto.screen.CheckListStatesView)1