Assert.assertFalse(Iterators.contains(scheduleExecutions.iterator(), scheduleExecution2));
}
@Test
public void testFindEngaged() throws Exception {
StartExecutionParameters startExecutionParameters = new StartExecutionParameters();
// Execution 1 - finished
startExecutionParameters.setManual(false);
startExecutionParameters.setFired(ChronometerUtils.parseMoment("2012-01-02 12:32:12.000 UTC"));
startExecutionParameters.setScheduled(ChronometerUtils.parseMoment("2012-01-02 12:32:12.000 UTC"));
startExecutionParameters.setComment("Test comment");
ScheduleExecution scheduleExecution1 =
scheduleExecutionManagementService.startExecution(scheduleJob.getId(), startExecutionParameters);
scheduleExecutionManagementService.finishExecution(
scheduleExecution1.getId(), ScheduleExecutionStatus.SUCCEED);
// Execution 2 - non-finished
startExecutionParameters.setManual(false);
startExecutionParameters.setFired(ChronometerUtils.parseMoment("2012-01-02 12:32:13.000 UTC"));
startExecutionParameters.setScheduled(ChronometerUtils.parseMoment("2012-01-02 12:33:12.000 UTC"));
startExecutionParameters.setComment("Test comment");
ScheduleExecution scheduleExecution2 =
scheduleExecutionManagementService.startExecution(scheduleJob.getId(), startExecutionParameters);
// Check