use of org.mifos.framework.util.helpers.FlowManager in project head by mifos.
the class OfficeActionStrutsTest method ignore_testFlowSuccess.
public void ignore_testFlowSuccess() throws Exception {
setRequestPathInfo("/offAction.do");
addRequestParameter("method", Methods.load.toString());
addRequestParameter("officeLevel", "5");
addRequestParameter(Constants.CURRENTFLOWKEY, flowKey);
actionPerform();
verifyForward(ActionForwards.load_success.toString());
flowKey = request.getAttribute(Constants.CURRENTFLOWKEY).toString();
FlowManager fm = (FlowManager) SessionUtils.getAttribute(Constants.FLOWMANAGER, request.getSession());
Assert.assertEquals(true, fm.isFlowValid(flowKey));
setRequestPathInfo("/offAction.do");
addRequestParameter("method", Methods.preview.toString());
addRequestParameter("officeName", "abcd");
addRequestParameter("shortName", "abcd");
addRequestParameter("officeLevel", "5");
addRequestParameter("parentOfficeId", "1");
addRequestParameter(Constants.CURRENTFLOWKEY, flowKey);
actionPerform();
verifyInputForward();
fm = (FlowManager) SessionUtils.getAttribute(Constants.FLOWMANAGER, request.getSession());
Assert.assertEquals(true, fm.isFlowValid(flowKey));
setRequestPathInfo("/offAction.do");
addRequestParameter("method", Methods.create.toString());
addRequestParameter("officeName", "abcd");
addRequestParameter("shortName", "abcd");
addRequestParameter("officeLevel", "5");
addRequestParameter("parentOfficeId", "1");
addRequestParameter("address.line1", "123");
addRequestParameter(Constants.CURRENTFLOWKEY, flowKey);
request.setAttribute(Constants.CURRENTFLOWKEY, flowKey);
actionPerform();
verifyForward(ActionForwards.create_success.toString());
fm = (FlowManager) SessionUtils.getAttribute(Constants.FLOWMANAGER, request.getSession());
Assert.assertEquals(false, fm.isFlowValid(flowKey));
}
use of org.mifos.framework.util.helpers.FlowManager in project head by mifos.
the class MifosMockStrutsTestCase method createFlow.
protected String createFlow(HttpServletRequest request, Class<?> flowClass) {
Flow flow = new Flow();
String flowKey = String.valueOf(System.currentTimeMillis());
FlowManager flowManager = new FlowManager();
flowManager.addFLow(flowKey, flow, flowClass.getName());
request.getSession(false).setAttribute(Constants.FLOWMANAGER, flowManager);
return flowKey;
}
use of org.mifos.framework.util.helpers.FlowManager in project head by mifos.
the class FlowKeyInterceptor method createToken.
private void createToken(HttpServletRequest request) {
String flowKey = String.valueOf(new DateTimeService().getCurrentDateTime().getMillis());
FlowManager flowManager = (FlowManager) request.getSession().getAttribute(Constants.FLOWMANAGER);
if (flowManager == null) {
flowManager = new FlowManager();
request.getSession(false).setAttribute(Constants.FLOWMANAGER, flowManager);
}
flowManager.addFLow(flowKey, new Flow(), this.getClass().getName());
request.setAttribute(Constants.CURRENTFLOWKEY, flowKey);
}
Aggregations