@Test
public void testNextSchedule() throws Exception {
ProgramSchedule sched = new ProgramSchedule("tsched11", "two times schedule", PROG1_ID,
ImmutableMap.of("prop2", "xx"),
new TimeTrigger("*/5 * * * *"), Collections.emptyList());
timeScheduler.addProgramSchedule(sched);
timeScheduler.resumeProgramSchedule(sched);
long currentTimeInSeconds = TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis());
long startTimeInSeconds = currentTimeInSeconds + TimeUnit.HOURS.toSeconds(1);
long endTimeInSeconds = currentTimeInSeconds + TimeUnit.HOURS.toSeconds(3);
List<ScheduledRuntime> nextRuntimes =
timeScheduler.getAllScheduledRunTimes(PROG1_ID, SchedulableProgramType.WORKFLOW,
startTimeInSeconds, endTimeInSeconds);
Assert.assertEquals(24, nextRuntimes.size());
}
}