final List<JobExecution> jobExecutions = jobOperator.getJobExecutions(jobInstance);
//the job was executed 2 times during Batchlet1Test for the latest job instance
Assert.assertEquals(2, jobExecutions.size());
final JobExecution jobExecution = jobExecutions.get(1);
System.out.printf("JobInstance id: %s%n", jobInstance.getInstanceId());
final BatchStatus batchStatus = jobExecution.getBatchStatus();
final String exitStatus = jobExecution.getExitStatus();
final Date createTime = jobExecution.getCreateTime();
final Date endTime = jobExecution.getEndTime();
final Date lastUpdatedTime = jobExecution.getLastUpdatedTime();
final Date startTime = jobExecution.getStartTime();
final Properties jobParameters = jobExecution.getJobParameters();
Assert.assertEquals(Batchlet1Test.jobName, jobExecution.getJobName());
Assert.assertNotEquals(0, jobExecution.getExecutionId());
Assert.assertEquals(BatchStatus.STOPPED, batchStatus);
Assert.assertEquals(Batchlet1.ACTION_STOP, exitStatus);
Assert.assertNotNull(createTime);
Assert.assertNotNull(lastUpdatedTime);
Assert.assertNotNull(endTime);
Assert.assertNotNull(startTime);
Assert.assertNotNull(jobParameters);
System.out.printf("JobExecution id: %s, batchStatus: %s, exitStatus: %s, createTime: %s, endTime: %s, lastUpdatedTime: %s, startTime: %s, jobParameters: %s%n",
jobExecution.getExecutionId(), batchStatus, exitStatus, createTime, endTime, lastUpdatedTime, startTime, jobParameters);
final List<StepExecution> stepExecutions = jobOperator.getStepExecutions(jobExecution.getExecutionId());
Assert.assertEquals(1, stepExecutions.size());
final StepExecution stepExecution = stepExecutions.get(0);
final String stepName1 = stepExecution.getStepName();
final BatchStatus batchStatus1 = stepExecution.getBatchStatus();
final String exitStatus1 = stepExecution.getExitStatus();
final Date startTime1 = stepExecution.getStartTime();
final Date endTime1 = stepExecution.getEndTime();
final Serializable persistentUserData = stepExecution.getPersistentUserData();
final Metric[] metrics = stepExecution.getMetrics();
Assert.assertNotNull(stepExecution.getStepExecutionId());
Assert.assertEquals(stepName, stepName1);
Assert.assertEquals(BatchStatus.COMPLETED, batchStatus1);
Assert.assertEquals(Batchlet1.ACTION_STOP, exitStatus1);
Assert.assertNotNull(startTime1);
Assert.assertNotNull(endTime1);
//Assert.assertEquals(new Integer(1), persistentUserData);
Assert.assertEquals("Persistent User Data", persistentUserData);
Assert.assertNotNull(metrics);
System.out.printf("StepExecution id: %s, stepName: %s, batchStatus: %s, exitStatus: %s, startTime: %s, endTime: %s, persistentUserData: %s, metrics: %s%n",
stepExecution.getStepExecutionId(), stepName1, batchStatus1, exitStatus1, startTime1, endTime1, persistentUserData,
Arrays.toString(metrics));
restartJobMatchOther(jobExecution.getExecutionId());
}