MockFlowExecutionListener mockListener = new MockFlowExecutionListener();
FlowExecutionListener[] listeners = new FlowExecutionListener[] { mockListener };
FlowExecutionImpl execution = new FlowExecutionImpl(flow);
execution.setListeners(listeners);
execution.setKeyFactory(new MockFlowExecutionKeyFactory());
MockExternalContext context = new MockExternalContext();
execution.start(null, context);
context = new MockExternalContext();
try {
execution.resume(context);
} catch (FlowExecutionException e) {
assertEquals(flow.getId(), e.getFlowId());
assertEquals(state.getId(), e.getStateId());