QpidStatusMonitor implements Runnable { public void schedule() { log.info("Starting Qpid Status Monitor. Checks will be performed every {} seconds.", delay); executorService.scheduleWithFixedDelay(this, 10, delay, TimeUnit.SECONDS); } @Inject  QpidStatusMonitor(Configuration config, ScheduledExecutorService execService); @Inject void setQmf(QpidQmf qmf); @Inject void setQpidConnection(QpidConnection qpidConnection); @Override void run(); void addStatusChangeListener(QpidStatusListener listener); void schedule();  }
@Test public void testSchedulingAtConfiguredDelay() { monitor.schedule(); verify(executorService, times(1)) .scheduleWithFixedDelay(eq(monitor), eq(10L), eq((long) configuredDelay), eq(TimeUnit.SECONDS)); }