@Test public void testScheduleWithFixedDelay() { TestScheduledRunnable testScheduledRunnable = new TestScheduledRunnable(); testScheduledRunnable.scheduleWithFixedDelay(scheduledExecutorService, 0, 1, SECONDS); verify(scheduledExecutorService).scheduleWithFixedDelay(testScheduledRunnable, 0, 1, SECONDS); verifyNoMoreInteractions(scheduledExecutorService); }
public void scheduleWithFixedDelay(ScheduledExecutorService scheduledExecutor, long initialDelay, long period, TimeUnit unit) { if (future != null) { logger.error("command has already been scheduled: {}", this); return; } future = scheduledExecutor.scheduleWithFixedDelay(this, initialDelay, period, unit); }
ScheduledRunnable implements Runnable, Cancellable { public void scheduleWithFixedDelay(ScheduledExecutorService scheduledExecutor, long initialDelay, long period, TimeUnit unit) { if (future != null) { logger.error("command has already been scheduled: {}", this); return; } future = scheduledExecutor.scheduleWithFixedDelay(this, initialDelay, period, unit); } }
ScheduledRunnable implements Runnable, Cancellable { public void scheduleWithFixedDelay(ScheduledExecutorService scheduledExecutor, long initialDelay, long period, TimeUnit unit) { if (future != null) { logger.error("command has already been scheduled: {}", this); return; } future = scheduledExecutor.scheduleWithFixedDelay(this, initialDelay, period, unit); }  }
ScheduledRunnable implements Runnable, Cancellable { public void scheduleWithFixedDelay(ScheduledExecutorService scheduledExecutor, long initialDelay, long period, TimeUnit unit) { if (future != null) { logger.error("command has already been scheduled: {}", this); return; } future = scheduledExecutor.scheduleWithFixedDelay(this, initialDelay, period, unit); }  void scheduleWithFixedDelay(ScheduledExecutorService scheduledExecutor,
            long initialDelay, long period, TimeUnit unit); @Override void run(); @Override void cancel(); }
ScheduledRunnable implements Runnable, Cancellable { public void scheduleWithFixedDelay(ScheduledExecutorService scheduledExecutor, long initialDelay, long period, TimeUnit unit) { if (future != null) { logger.error("command has already been scheduled: {}", this); return; } future = scheduledExecutor.scheduleWithFixedDelay(this, initialDelay, period, unit); }  void scheduleWithFixedDelay(ScheduledExecutorService scheduledExecutor,
            long initialDelay, long period, TimeUnit unit); @Override void run(); @Override void cancel();  }