/** * Sets the active flow session of the executing flow associated with this request. This will influence * {@link #getActiveFlow()} and {@link #getCurrentState()}, as well as {@link #getFlowScope()} and * {@link #getFlashScope()}. */ public void setActiveSession(FlowSession flowSession) { getMockFlowExecutionContext().setActiveSession(flowSession); }
/** * Returns the root flow definition for this request context. Assumes a {@link Flow} implementation. */ public Flow getRootFlow() { return getMockFlowExecutionContext().getDefinitionInternal(); }
public MutableAttributeMap<Object> getConversationScope() { return getMockFlowExecutionContext().getConversationScope(); }
public MutableAttributeMap<Object> getFlashScope() { return getMockFlowExecutionContext().getFlashScope(); }
public MutableAttributeMap<Object> getViewScope() throws IllegalStateException { return getMockFlowExecutionContext().getActiveSession().getViewScope(); }
/** * Returns the root flow definition for this request context. Assumes a {@link Flow} implementation. */ public Flow getRootFlow() { return getMockFlowExecutionContext().getDefinitionInternal(); }
/** * Returns the root flow definition for this request context. Assumes a {@link Flow} implementation. */ public Flow getRootFlow() { return getMockFlowExecutionContext().getDefinitionInternal(); }
/** * Sets the active flow session of the executing flow associated with this request. This will influence * {@link #getActiveFlow()} and {@link #getCurrentState()}, as well as {@link #getFlowScope()} and * {@link #getFlashScope()}. */ public void setActiveSession(FlowSession flowSession) { getMockFlowExecutionContext().setActiveSession(flowSession); }
/** * Sets the active flow session of the executing flow associated with this request. This will influence * {@link #getActiveFlow()} and {@link #getCurrentState()}, as well as {@link #getFlowScope()} and * {@link #getFlashScope()}. */ public void setActiveSession(FlowSession flowSession) { getMockFlowExecutionContext().setActiveSession(flowSession); }
/** * Sets the active flow session of the executing flow associated with this request. This will influence * {@link #getActiveFlow()} and {@link #getCurrentState()}, as well as {@link #getFlowScope()} and * {@link #getFlashScope()}. */ public void setActiveSession(FlowSession flowSession) { getMockFlowExecutionContext().setActiveSession(flowSession); }
public MutableAttributeMap<Object> getConversationScope() { return getMockFlowExecutionContext().getConversationScope(); }
public MutableAttributeMap getFlashScope() { return getMockFlowExecutionContext().getFlashScope(); }
public MutableAttributeMap getConversationScope() { return getMockFlowExecutionContext().getConversationScope(); }
public MutableAttributeMap<Object> getFlashScope() { return getMockFlowExecutionContext().getFlashScope(); }
public MutableAttributeMap<Object> getViewScope() throws IllegalStateException { return getMockFlowExecutionContext().getActiveSession().getViewScope(); }
public void testCannotResolveMethod() throws Exception { try { context.getMockFlowExecutionContext().getMockActiveSession().setState(null); action.execute(context); fail("Should've failed with illegal state"); } catch (IllegalStateException e) { } }
public void testDispatchWithCurrentStateId() throws Exception { MockFlowSession session = context.getMockFlowExecutionContext().getMockActiveSession(); session.setState(new ViewState(session.getDefinitionInternal(), "increment", new StubViewFactory())); action.execute(context); assertEquals(1, action.counter); }
public void testExecuteActionInState() { context.getMockFlowExecutionContext().getMockActiveSession().setState(state); TestAction action = new TestAction(); Event result = ActionExecutor.execute(action, context); assertSame(state, context.getCurrentState()); assertEquals("success", result.getId()); }
public void testResumeNoEvent() { MockRequestContext context = new MockRequestContext(); context.getMockExternalContext().setNativeContext(new MockServletContext()); context.getMockExternalContext().setNativeRequest(new MockHttpServletRequest()); context.getMockExternalContext().setNativeResponse(new MockHttpServletResponse()); context.getMockFlowExecutionContext().setKey(new MockFlowExecutionKey("c1v1")); org.springframework.web.servlet.View mvcView = new MockView(); AbstractMvcView view = new MockMvcView(mvcView, context); assertFalse(view.userEventQueued()); view.processUserEvent(); assertFalse(view.hasFlowEvent()); assertNull(view.getFlowEvent()); }
public void testResumeEventNoModelBinding() { MockRequestContext context = new MockRequestContext(); context.putRequestParameter("_eventId", "submit"); context.getMockExternalContext().setNativeContext(new MockServletContext()); context.getMockExternalContext().setNativeRequest(new MockHttpServletRequest()); context.getMockExternalContext().setNativeResponse(new MockHttpServletResponse()); context.getMockFlowExecutionContext().setKey(new MockFlowExecutionKey("c1v1")); org.springframework.web.servlet.View mvcView = new MockView(); AbstractMvcView view = new MockMvcView(mvcView, context); assertTrue(view.userEventQueued()); view.processUserEvent(); assertTrue(view.hasFlowEvent()); assertEquals("submit", view.getFlowEvent().getId()); }