IndexTaskScheduler { public void runReindexOnDemand() { Date now = dateFactory.createNewDate(); taskScheduler.schedule(luceneReindexerTask, now); }  void startReindexScheduling(); void runReindexOnDemand();  }
@Test public void testRunReindexOnDemand() { Date now = new Date(); given(dateFactory.createNewDate()).willReturn(now); underTest.runReindexOnDemand(); verify(taskScheduler).schedule(luceneReindexerTask, now); }