### Question:
SearchServerManager implements Initializable { @Override public void shutdown() { cleanup(); started.set(false); } protected  SearchServerManager(PropertiesManager propManager); BaseSearchManager getSearchServer(); static SearchServerManager getInstance(); static SearchServerManager getInstance(PropertiesManager propertiesManager); @Override void initialize(); @Override void shutdown(); @Override boolean isStarted(); static final String SOLR; static final String ELASTICSEARCH; }### Answer:
@Test public void testShutdown() { LOG.info("shutdown"); PropertiesManager propertiesManager = Mockito.mock(PropertiesManager.class); Mockito.when(propertiesManager.getValue(Mockito.eq(PropertiesManager.KEY_SEARCH_SERVER))).thenReturn(SearchServerManager.ELASTICSEARCH); Mockito.when(propertiesManager.getValue(Mockito.eq(PropertiesManager.KEY_SEARCH_SERVER), Mockito.anyString())).thenReturn(SearchServerManager.ELASTICSEARCH); Mockito.when(propertiesManager.getValue(Mockito.eq(PropertiesManager.KEY_ELASTIC_SEARCH_POOL), Mockito.anyString())).thenReturn("40"); Mockito.when(propertiesManager.getValue(Mockito.eq(PropertiesManager.KEY_ELASTIC_HOST), Mockito.anyString())).thenReturn("dummy"); Mockito.when(propertiesManager.getValue(Mockito.eq(PropertiesManager.KEY_ELASTIC_PORT), Mockito.anyString())).thenReturn("9200"); SearchServerManager instance = new SearchServerManager(propertiesManager); instance.initialize(); instance.shutdown(); if (instance.isStarted()) { fail("Expected to not be started"); } }