@Test public final void testAfterPropertiesScheduleReindexing() throws Exception { //GIVEN in setup //WHEN underTest.afterPropertiesSet(); //THEN verify(indexTaskScheduler).startReindexScheduling(); }
/** * This method reads in property file of wilma-message-search. * @throws Exception {@link PropertyLoader}, {@link ApplicationContext} can throw different exceptions. */ @PostConstruct void afterPropertiesSet() throws Exception { propertyLoader.loadProperties(); loadProperties(); startUpMessageGenerator.logStartUpMessage(); jmsConnectionConfigurer.setBrokerUrl(); indexTaskScheduler = applicationContext.getBean("indexTaskScheduler", IndexTaskScheduler.class); indexTaskScheduler.runReindexOnDemand(); indexTaskScheduler.startReindexScheduling(); }
@Test public void testStartReindexScheduling() { //GIVEN given(configurationAccess.getProperties()).willReturn(properties); given(properties.getReindexTimer()).willReturn(CRON_EXPRESSION); given(cronTriggerFactory.create(CRON_EXPRESSION)).willReturn(cronTrigger); //WHEN underTest.startReindexScheduling(); //THEN verify(taskScheduler).schedule(luceneReindexerTask, cronTrigger); }