@Test
public void testAfterJobJobExecutionHasBatchStatusUnchangedWhenAllStepsCompleted() throws Exception {

    JobExecution jobExecution = new JobExecution(1L);
    StepExecution completedStepExecution = createStepExecution(jobExecution, COMPLETED);
    StepExecution anotherStepExecution = createStepExecution(jobExecution, COMPLETED);
    jobExecution.addStepExecutions(asList(completedStepExecution, anotherStepExecution));
    BatchStatus jobExecutionStatus = jobExecution.getStatus();
    changeStatusOnFailedStepsJobExecListener.afterJob(jobExecution);
    assertThat(jobExecution.getStatus()).isEqualTo(jobExecutionStatus);
}