EasyMock.verify(jobLocator);
}
@Test
public void testGetJobExecutionWithUnserializableExecutionContext() throws Exception {
JobExecution jobExecution = MetaDataInstanceFactory.createJobExecution(123L);
JobInstance jobInstance = jobExecution.getJobInstance();
jobExecution.setJobInstance(null);
EasyMock.expect(jobExecutionDao.getJobExecution(123L)).andReturn(jobExecution);
EasyMock.expect(jobInstanceDao.getJobInstance(jobExecution)).andReturn(jobInstance);
EasyMock.expect(executionContextDao.getExecutionContext(jobExecution)).andThrow(
new IllegalStateException("Planned"));
stepExecutionDao.addStepExecutions(jobExecution);
EasyMock.expectLastCall();
EasyMock.replay(stepExecutionDao, jobExecutionDao, jobInstanceDao, executionContextDao);
JobExecution result = service.getJobExecution(123L);
assertNotNull(result);
assertNotNull(result.getJobInstance());
assertNotNull(result.getExecutionContext());
EasyMock.verify(stepExecutionDao, jobExecutionDao, jobInstanceDao, executionContextDao);
}