/** * Creates new action request. * @param actionPath action path * @param actionRuntime action runtime * @param action action object * @param servletRequest http request * @param servletResponse http response * @return action request */ protected ActionRequest createActionRequest( final String actionPath, final String[] actionPathChunks, final ActionRuntime actionRuntime, final Object action, final HttpServletRequest servletRequest, final HttpServletResponse servletResponse) { return new ActionRequest(this, actionPath, actionPathChunks, actionRuntime, action, servletRequest, servletResponse); }
protected ActionRequest createActionRequest(String actionPath) { HttpServletRequest servletRequest = mock(HttpServletRequest.class); HttpServletResponse servletResponse = mock(HttpServletResponse.class); HttpSession httpSession = mock(HttpSession.class); ServletContext servletContext = mock(ServletContext.class); when(servletRequest.getSession()).thenReturn(httpSession); when(httpSession.getServletContext()).thenReturn(servletContext); MadvocController madvocController = new MadvocController(); Object action = new Object(); ActionRuntime actionRuntime = new ActionRuntime( null, Action.class, ClassUtil.findMethod(Action.class, "view"), null, null, new ActionDefinition(actionPath, "GET"), ServletDispatcherActionResult.class, null, false, false, null, null); return new ActionRequest(madvocController, actionRuntime.getActionPath(), MadvocUtil.splitPathToChunks(actionRuntime.getActionPath()), actionRuntime, action, servletRequest, servletResponse); }
/** * Creates new action request. * @param actionConfig action configuration * @param action action object * @param servletRequest http request * @param servletResponse http response * @return action request */ protected ActionRequest createActionRequest(String actionPath, ActionConfig actionConfig, Object action, HttpServletRequest servletRequest, HttpServletResponse servletResponse) { return new ActionRequest(actionPath, actionConfig, action, servletRequest, servletResponse); }