ElasticsearchEngineConfigurator extends BaseSearchEngineConfigurator { @Activate protected void activate(ComponentContext componentContext) { _bundleContext = componentContext.getBundleContext(); setSearchEngines(_searchEngines); initialize(); }    }
@Test public void testDestroyMustNotCreateDestinationsAgain() { SearchDestinationHelper searchDestinationHelper = createSearchDestinationHelper(); ElasticsearchEngineConfigurator elasticsearchEngineConfigurator = createElasticsearchEngineConfigurator(searchDestinationHelper); elasticsearchEngineConfigurator.activate( Mockito.mock(ComponentContext.class)); elasticsearchEngineConfigurator.destroy(); Mockito.verify( searchDestinationHelper, Mockito.times(1) ).createSearchReaderDestination( Mockito.anyString() ); Mockito.verify( searchDestinationHelper, Mockito.times(1) ).createSearchWriterDestination( Mockito.anyString() ); }