Flow flow = new Flow("myFlow");
StubViewFactory viewFactory = new StubViewFactory();
ViewState state = new ViewState(flow, "viewState", viewFactory);
Transition t = new Transition(on("submit"), null);
state.getTransitionSet().add(t);
MockRequestControlContext context = new MockRequestControlContext(flow);
state.enter(context);
context = new MockRequestControlContext(context.getFlowExecutionContext());
context.getFlowScope().remove("renderCalled");
context.putRequestParameter("_eventId", "submit");
context.getMockExternalContext().setResponseAllowed(false);
context.getFlashScope().put("foo", "bar");
state.resume(context);
assertTrue(context.getFlowExecutionContext().isActive());
assertTrue(context.getExternalContext().isResponseComplete());
assertFalse("Render called", context.getFlowScope().contains("renderCalled"));
assertTrue(context.getMockExternalContext().getFlowExecutionRedirectRequested());
assertEquals(StubViewFactory.USER_EVENT_STATE, context.getFlashScope().get(View.USER_EVENT_STATE_ATTRIBUTE));
assertTrue(context.getFlashScope().contains("foo"));
}