ViewState state = new ViewState(flow, "view", new StubViewFactory()) {
public void resume(RequestControlContext context) {
context.execute(getRequiredTransition(context));
}
};
state.getTransitionSet().add(new Transition(new DefaultTargetStateResolver("finish")));
EndState end = new EndState(flow, "finish");
MockFlowExecutionListener mockListener = new MockFlowExecutionListener();
FlowExecutionListener[] listeners = new FlowExecutionListener[] { mockListener };
FlowExecutionImpl execution = new FlowExecutionImpl(flow);
execution.setListeners(listeners);