Constraint[] params = new Constraint[]{eq(PortletActionConstants.ACTION_PARAM), eq("freemarkerDirect")};
mockResponse.expects(once()).method("setRenderParameter").with(params);
params = new Constraint[]{eq(PortletActionConstants.MODE_PARAM), eq(PortletMode.VIEW.toString())};
mockResponse.expects(once()).method("setRenderParameter").with(params);
mockRequest.stubs().method("getPortletMode").will(returnValue(PortletMode.VIEW));
mockProxy.stubs().method("getNamespace").will(returnValue(""));
mockInvocation.stubs().method("getProxy").will(returnValue(mockProxy.proxy()));
ActionContext ctx = ActionContext.getContext();