final List<StepExecution> stepExecutions2 = new ArrayList<StepExecution>();
stepExecutions2.add(step2);
jobExecution1.addStepExecutions(stepExecutions1);
when(jobService.getStepExecutions(5555L)).thenThrow(
new NoSuchJobExecutionException("No JobExecution with id=5555L"));
when(jobService.getStepExecutions(2L)).thenReturn(stepExecutions1);
when(jobService.getStepExecution(2L, 1L)).thenReturn(step1);
when(jobService.getStepExecution(5555L, 1L)).thenThrow(
new NoSuchJobExecutionException("No JobExecution with id=5555L"));
when(jobService.getStepExecution(2L, 5555L)).thenThrow(
new NoSuchStepExecutionException("No StepExecution with id=5555L"));
when(jobService.countStepExecutionsForStep(job1.getName(), step1.getStepName())).thenReturn(1);
when(jobService.listStepExecutionsForStep(job1.getName(), step1.getStepName(), 0, 1000)).thenReturn(
stepExecutions2);