SearchIndexServiceImpl implements SearchIndexService { protected void deleteSearchIndexHelper(String searchIndexName) { if (indexFunctionsDao.isIndexExists(searchIndexName)) { indexFunctionsDao.deleteIndex(searchIndexName); } }  @Override SearchIndex createSearchIndex(SearchIndexCreateRequest request); @Override SearchIndex deleteSearchIndex(SearchIndexKey searchIndexKey); @Override SearchIndex getSearchIndex(SearchIndexKey searchIndexKey); @Override SearchIndexKeys getSearchIndexes();  }
@Test public void testDeleteSearchIndexHelperIndexAlreadyExists() { when(indexFunctionDao.isIndexExists(SEARCH_INDEX_NAME)).thenReturn(true); doNothing().when(indexFunctionDao).deleteIndex(SEARCH_INDEX_NAME); searchIndexServiceImpl.deleteSearchIndexHelper(SEARCH_INDEX_NAME); verify(indexFunctionDao).isIndexExists(SEARCH_INDEX_NAME); verify(indexFunctionDao).deleteIndex(SEARCH_INDEX_NAME); verifyNoMoreInteractions(alternateKeyHelper, businessObjectDefinitionDao, businessObjectDefinitionHelper, configurationDaoHelper, configurationHelper, indexFunctionDao, searchIndexDao, searchIndexDaoHelper, searchIndexHelperService, searchIndexStatusDaoHelper, searchIndexTypeDaoHelper); }
@Test public void testDeleteSearchIndexHelperIndexNoExists() { when(indexFunctionDao.isIndexExists(SEARCH_INDEX_NAME)).thenReturn(false); searchIndexServiceImpl.deleteSearchIndexHelper(SEARCH_INDEX_NAME); verify(indexFunctionDao).isIndexExists(SEARCH_INDEX_NAME); verifyNoMoreInteractions(alternateKeyHelper, businessObjectDefinitionDao, businessObjectDefinitionHelper, configurationDaoHelper, configurationHelper, indexFunctionDao, searchIndexDao, searchIndexDaoHelper, searchIndexHelperService, searchIndexStatusDaoHelper, searchIndexTypeDaoHelper); }