StepExecution stepExecution = new StepExecution("step1", new JobExecution(5L));
stepExecution.setExitStatus(new ExitStatus("unmapped exit code"));
stepExecution.setStatus(BatchStatus.FAILED);
executor = new FlowExecutor(stepExecution);
State startState = new StateSupport("step1", new FlowExecutionStatus("unmapped exit code"));
State endState = new StateSupport("failed", FlowExecutionStatus.FAILED);
StateTransition failureTransition = StateTransition.createStateTransition(startState, "FAILED", "failed");
StateTransition endTransition = StateTransition.createEndStateTransition(endState);
flow.setStateTransitions(collect(failureTransition, endTransition));