final JobExecutionImpl jobExecution = (JobExecutionImpl) operator.getJobExecution(jobExecutionId);
jobExecution.awaitTermination(1, TimeUnit.MINUTES);
Assert.assertEquals(BatchStatus.COMPLETED, jobExecution.getBatchStatus());
Assert.assertEquals(BatchStatus.COMPLETED.name(), jobExecution.getExitStatus());
StepExecution stepExecution = jobExecution.getStepExecutions().get(0);
System.out.printf("stepExecution id=%s, name=%s, batchStatus=%s, exitStatus=%s%n",
stepExecution.getStepExecutionId(), stepExecution.getStepName(), stepExecution.getBatchStatus(), stepExecution.getExitStatus());
Assert.assertEquals(BatchStatus.FAILED, stepExecution.getBatchStatus());
Assert.assertEquals(BatchStatus.FAILED.name(), stepExecution.getExitStatus());
stepExecution = jobExecution.getStepExecutions().get(1);
System.out.printf("stepExecution id=%s, name=%s, batchStatus=%s, exitStatus=%s%n",
stepExecution.getStepExecutionId(), stepExecution.getStepName(), stepExecution.getBatchStatus(), stepExecution.getExitStatus());
Assert.assertEquals(BatchStatus.COMPLETED, stepExecution.getBatchStatus());
Assert.assertEquals(SleepBatchlet.SLEPT, stepExecution.getExitStatus());
}