use of org.mifos.customers.checklist.persistence.CheckListPersistence in project head by mifos.
the class CheckListActionStrutsTest method testCreate_product.
@Test
public void testCreate_product() throws Exception {
setRequestPathInfo("/chkListAction");
addRequestParameter("method", "create");
addRequestParameter("masterTypeId", "1");
addRequestParameter("isCustomer", "false");
addRequestParameter("stateId", "13");
addRequestParameter("checklistName", "new checklistName");
addRequestParameter("detailsList[0]", "newdetails");
addRequestParameter(Constants.CURRENTFLOWKEY, flowKey);
actionPerform();
verifyForward(ActionForwards.create_success.toString());
List<AccountCheckListBO> accountCheckLists = new CheckListPersistence().retreiveAllAccountCheckLists();
Assert.assertNotNull(accountCheckLists);
Assert.assertEquals(1, accountCheckLists.size());
Assert.assertNull(request.getAttribute(Constants.CURRENTFLOWKEY));
for (AccountCheckListBO checkList : accountCheckLists) {
Assert.assertEquals("new checklistName", checkList.getChecklistName());
Assert.assertEquals("1", checkList.getProductTypeEntity().getProductTypeID().toString());
Assert.assertEquals("1", checkList.getChecklistStatus().toString());
Assert.assertEquals(1, checkList.getChecklistDetails().size());
}
}
use of org.mifos.customers.checklist.persistence.CheckListPersistence in project head by mifos.
the class CheckListActionStrutsTest method testCreate_customer.
@Test
public void testCreate_customer() throws Exception {
setRequestPathInfo("/chkListAction");
addRequestParameter("method", "create");
addRequestParameter("masterTypeId", "1");
addRequestParameter("masterTypeName", "kendra");
addRequestParameter("isCustomer", "true");
addRequestParameter("type", "1");
addRequestParameter("stateId", "13");
addRequestParameter("stateName", "active");
addRequestParameter("checklistName", "new checklistName");
addRequestParameter("detailsList[0]", "newdetails");
addRequestParameter(Constants.CURRENTFLOWKEY, flowKey);
actionPerform();
verifyForward(ActionForwards.create_success.toString());
List<CustomerCheckListBO> customerCheckLists = new CheckListPersistence().retreiveAllCustomerCheckLists();
Assert.assertNotNull(customerCheckLists);
Assert.assertNull(request.getAttribute(Constants.CURRENTFLOWKEY));
Assert.assertEquals(1, customerCheckLists.size());
for (CustomerCheckListBO checkList : customerCheckLists) {
Assert.assertEquals("new checklistName", checkList.getChecklistName());
Assert.assertEquals("1", checkList.getCustomerLevel().getId().toString());
Assert.assertEquals("13", checkList.getCustomerStatus().getId().toString());
Assert.assertEquals("1", checkList.getChecklistStatus().toString());
Assert.assertEquals(1, checkList.getChecklistDetails().size());
}
}
Aggregations