IndexTaskScheduler { public void startReindexScheduling() { String cronExpression = configurationAccess.getProperties().getReindexTimer(); CronTrigger cronTrigger = cronTriggerFactory.create(cronExpression); taskScheduler.schedule(luceneReindexerTask, cronTrigger); }  void startReindexScheduling(); void runReindexOnDemand();  }
@Test public void testStartReindexScheduling() { given(configurationAccess.getProperties()).willReturn(properties); given(properties.getReindexTimer()).willReturn(CRON_EXPRESSION); given(cronTriggerFactory.create(CRON_EXPRESSION)).willReturn(cronTrigger); underTest.startReindexScheduling(); verify(taskScheduler).schedule(luceneReindexerTask, cronTrigger); }