Search in sources :

Example 6 with CheckListStatesView

use of org.mifos.dto.screen.CheckListStatesView in project head by mifos.

the class CheckListPersistenceIntegrationTest method testCheckListStatesView.

@Test
public void testCheckListStatesView() {
    CheckListStatesView checkListStatesView = new CheckListStatesView(Short.valueOf("13"), "Active", Short.valueOf("1"));
    Assert.assertEquals(Short.valueOf("13"), checkListStatesView.getStateId());
    Assert.assertEquals("Active", checkListStatesView.getStateName());
    Assert.assertEquals(Short.valueOf("1"), checkListStatesView.getId());
}
Also used : CheckListStatesView(org.mifos.dto.screen.CheckListStatesView) Test(org.junit.Test)

Example 7 with CheckListStatesView

use of org.mifos.dto.screen.CheckListStatesView in project head by mifos.

the class CheckListActionStrutsTest method testGetStatesDuplicateForCustomer.

@Test
public void testGetStatesDuplicateForCustomer() throws Exception {
    CustomerCheckListBO checkList = TestObjectFactory.createCustomerChecklist(CustomerLevel.GROUP.getValue(), CustomerStatus.GROUP_ACTIVE.getValue(), (short) 1);
    StaticHibernateUtil.flushSession();
    setRequestPathInfo("/chkListAction");
    addRequestParameter("method", "getStates");
    addRequestParameter("masterTypeId", "2");
    addRequestParameter("isCustomer", "true");
    addRequestParameter(Constants.CURRENTFLOWKEY, flowKey);
    actionPerform();
    verifyNoActionErrors();
    verifyForward(ActionForwards.load_success.toString());
    Assert.assertNotNull(request.getAttribute(Constants.CURRENTFLOWKEY));
    List<CheckListStatesView> states = (List<CheckListStatesView>) SessionUtils.getAttribute(CheckListConstants.STATES, request);
    for (CheckListStatesView state : states) {
        Assert.assertNotSame(state.getStateId(), checkList.getCustomerStatus().getId());
    }
}
Also used : CustomerCheckListBO(org.mifos.customers.checklist.business.CustomerCheckListBO) CheckListStatesView(org.mifos.dto.screen.CheckListStatesView) List(java.util.List) Test(org.junit.Test)

Example 8 with CheckListStatesView

use of org.mifos.dto.screen.CheckListStatesView in project head by mifos.

the class CheckListActionStrutsTest method testGetStatesDuplicateForAccount.

@Test
public void testGetStatesDuplicateForAccount() throws Exception {
    AccountCheckListBO checkList = TestObjectFactory.createAccountChecklist(ProductType.LOAN.getValue(), AccountState.LOAN_APPROVED, (short) 1);
    StaticHibernateUtil.flushSession();
    setRequestPathInfo("/chkListAction");
    addRequestParameter("method", "getStates");
    addRequestParameter("masterTypeId", "1");
    addRequestParameter("isCustomer", "false");
    addRequestParameter(Constants.CURRENTFLOWKEY, flowKey);
    actionPerform();
    verifyNoActionErrors();
    verifyForward(ActionForwards.load_success.toString());
    Assert.assertNotNull(request.getAttribute(Constants.CURRENTFLOWKEY));
    List<CheckListStatesView> states = (List<CheckListStatesView>) SessionUtils.getAttribute(CheckListConstants.STATES, request);
    for (CheckListStatesView state : states) {
        Assert.assertNotSame(state.getStateId(), checkList.getAccountStateEntity().getId());
    }
}
Also used : CheckListStatesView(org.mifos.dto.screen.CheckListStatesView) List(java.util.List) AccountCheckListBO(org.mifos.customers.checklist.business.AccountCheckListBO) Test(org.junit.Test)

Aggregations

CheckListStatesView (org.mifos.dto.screen.CheckListStatesView)8 ArrayList (java.util.ArrayList)3 Test (org.junit.Test)3 ChkListActionForm (org.mifos.customers.checklist.struts.actionforms.ChkListActionForm)3 TransactionDemarcate (org.mifos.framework.util.helpers.TransactionDemarcate)3 HashMap (java.util.HashMap)2 List (java.util.List)2 AccountCheckListBO (org.mifos.customers.checklist.business.AccountCheckListBO)2 CustomerCheckListBO (org.mifos.customers.checklist.business.CustomerCheckListBO)2 AccountStateEntity (org.mifos.accounts.business.AccountStateEntity)1 CustomerStatusEntity (org.mifos.customers.business.CustomerStatusEntity)1 CheckListBO (org.mifos.customers.checklist.business.CheckListBO)1 CheckListDetailEntity (org.mifos.customers.checklist.business.CheckListDetailEntity)1 CheckListPersistence (org.mifos.customers.checklist.persistence.CheckListPersistence)1 CheckListMasterDto (org.mifos.dto.domain.CheckListMasterDto)1