@Test
public void testDeleteSearchIndex()
{

    // Create a search index key.
    SearchIndexKey searchIndexKey = new SearchIndexKey(SEARCH_INDEX_NAME);
    // Create a search index delete response.
    SearchIndex searchIndex =
        new SearchIndex(searchIndexKey, SEARCH_INDEX_TYPE, SEARCH_INDEX_STATUS, SEARCH_INDEX_DEFAULT_ACTIVE_FLAG, NO_SEARCH_INDEX_STATISTICS, USER_ID,
            CREATED_ON, UPDATED_ON);
    // Mock the call to the search index service.
    when(searchIndexService.deleteSearchIndex(searchIndexKey)).thenReturn(searchIndex);
    // Delete a search index.
    SearchIndex response = searchIndexRestController.deleteSearchIndex(SEARCH_INDEX_NAME);
    // Verify the calls.
    verify(searchIndexService, times(1)).deleteSearchIndex(new SearchIndexKey(SEARCH_INDEX_NAME));
    // Validate the returned object.
    assertEquals(searchIndex, response);
}