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());
}
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());
}
}
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());
}
}
Aggregations