public void testRestart() throws Exception {
JobExecution jobExecution = MetaDataInstanceFactory.createJobExecution();
EasyMock.expect(jobExecutionDao.getJobExecution(123L)).andReturn(jobExecution);
EasyMock.expect(jobInstanceDao.getJobInstance(jobExecution)).andReturn(
MetaDataInstanceFactory.createJobInstance());
JobParameters jobParameters = new JobParameters();
Job job = new JobSupport("job");
EasyMock.expect(jobLocator.getJob("job")).andReturn(job);
EasyMock.expect(jobLauncher.run(job, jobParameters))
.andReturn(MetaDataInstanceFactory.createJobExecution(124L));
EasyMock.replay(jobInstanceDao, jobExecutionDao, jobLauncher, jobLocator);