use of org.openhab.core.scheduler.CronJob in project openhab-core by openhab.
the class CronSchedulerImplTest method testAddRemoveScheduler.
@Test
@Timeout(value = 2, unit = TimeUnit.SECONDS)
public void testAddRemoveScheduler() throws InterruptedException {
Semaphore s = new Semaphore(0);
CronJob cronJob = m -> s.release();
Map<String, Object> map = Map.of(CronJob.CRON, "* * * * * *");
cronScheduler.addSchedule(cronJob, map);
s.acquire();
cronScheduler.removeSchedule(cronJob);
}
Aggregations