@Test
public void testDeleteSearchIndexHelperIndexAlreadyExists()
{

    // Mock the external calls.
    when(indexFunctionDao.isIndexExists(SEARCH_INDEX_NAME)).thenReturn(true);
    doNothing().when(indexFunctionDao).deleteIndex(SEARCH_INDEX_NAME);
    // Call a delete index method when a search index exists.
    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);
}