jobParameters.setScheduleGroupId(scheduleGroup.getId());
jobParameters.setStrategy(ScheduleExecutionStrategy.CIRCULAR);
jobParameters.setActionIdentifier("action.type");
jobParameters.setActionDefinition("action.data".getBytes());
ScheduleJob scheduleJob = scheduleJobManagementService.createJob(jobParameters);
Assert.assertNotNull(scheduleJob);
ScheduleExecution scheduleExecution = new ScheduleExecution();
scheduleExecution.setJob(scheduleJob);
scheduleExecution.setAction(scheduleJob.getAction());
scheduleExecution.setCron(scheduleJob.getCron());
scheduleExecution.setName(scheduleJob.getName());
scheduleExecution.setStrategy(scheduleJob.getStrategy());
scheduleExecution.setTimeout(scheduleJob.getTimeout());
scheduleExecution.setAllNodes(scheduleJob.isAllNodes());
scheduleExecution.setScheduled(chronometer.getCurrentMoment());
scheduleExecution.setFired(chronometer.getCurrentMoment());
scheduleExecution.setForced(false);
scheduleExecution.setDescription("Test execution");
scheduleExecution.setStatus(ScheduleExecutionStatus.INPROGRESS);
scheduleExecution.setStarted(chronometer.getCurrentMoment());
scheduleExecution.setFinished(null);
scheduleExecution.setHostname("localhost");
businessEntityDao.save(scheduleExecution);
scheduleJobManagementService.deleteJob(scheduleJob.getId());
control.verify();
Assert.assertEquals(scheduleJob.getId(), idCapture1.getValue());
Assert.assertEquals(scheduleJob.getId(), idCapture2.getValue());
ScheduleAction action = scheduleJob.getAction();
Assert.assertNotNull(action);
entityManager.flush();
entityManager.clear();