* @throws Exception
*/
public void testBundleRerunInPaused() throws Exception {
Date curr = new Date();
Date pauseTime = new Date(curr.getTime() - 1000);
BundleJobBean job = this.addRecordToBundleJobTableWithPausedTime(Job.Status.PAUSED, false, pauseTime);
this.addRecordToBundleActionTable(job.getId(), "action1", 0, Job.Status.SUCCEEDED);
this.addRecordToBundleActionTable(job.getId(), "action2", 0, Job.Status.PAUSED);
addRecordToCoordJobTable("action1", CoordinatorJob.Status.SUCCEEDED, false, false);
addRecordToCoordJobTable("action2", CoordinatorJob.Status.PAUSED, false, false);
JPAService jpaService = Services.get().get(JPAService.class);
assertNotNull(jpaService);
BundleJobGetJPAExecutor bundleJobGetExecutor = new BundleJobGetJPAExecutor(job.getId());
job = jpaService.execute(bundleJobGetExecutor);
assertEquals(Job.Status.PAUSED, job.getStatus());
new BundleRerunXCommand(job.getId(), "action2", null, false, true).call();
job = jpaService.execute(bundleJobGetExecutor);
assertEquals(Job.Status.PAUSED, job.getStatus());
assertNotNull(job.getPauseTime());
assertFalse(job.isPending());
}