@Test void testScheduleJob() throws InterruptedException { final CountDownLatch latch = new CountDownLatch(1); doAnswer(invocation -> { latch.countDown(); return null; }).when(eventBus).publish(isA(EventMessage.class)); testSubject.schedule(Duration.ofMillis(30), new Object()); latch.await(1, TimeUnit.SECONDS); verify(eventBus).publish(isA(EventMessage.class)); }
@Override public ScheduleToken schedule(Instant triggerDateTime, Object event) { return schedule(Duration.between(Instant.now(), triggerDateTime), event); }
SimpleEventScheduler implements EventScheduler { @Override public ScheduleToken schedule(Instant triggerDateTime, Object event) { return schedule(Duration.between(Instant.now(), triggerDateTime), event); } }
SimpleEventScheduler implements EventScheduler { @Override public ScheduleToken schedule(Instant triggerDateTime, Object event) { return schedule(Duration.between(Instant.now(), triggerDateTime), event); } protected  SimpleEventScheduler(Builder builder); }
SimpleEventScheduler implements EventScheduler { @Override public ScheduleToken schedule(Instant triggerDateTime, Object event) { return schedule(Duration.between(Instant.now(), triggerDateTime), event); } protected  SimpleEventScheduler(Builder builder); static Builder builder(); @Override ScheduleToken schedule(Instant triggerDateTime, Object event); @Override ScheduleToken schedule(Duration triggerDuration, Object event); @Override void cancelSchedule(ScheduleToken scheduleToken); @Override @ShutdownHandler(phase = Phase.INBOUND_EVENT_CONNECTORS) void shutdown(); }
SimpleEventScheduler implements EventScheduler { @Override public ScheduleToken schedule(Instant triggerDateTime, Object event) { return schedule(Duration.between(Instant.now(), triggerDateTime), event); } protected  SimpleEventScheduler(Builder builder); static Builder builder(); @Override ScheduleToken schedule(Instant triggerDateTime, Object event); @Override ScheduleToken schedule(Duration triggerDuration, Object event); @Override void cancelSchedule(ScheduleToken scheduleToken); @Override @ShutdownHandler(phase = Phase.INBOUND_EVENT_CONNECTORS) void shutdown();  }