@Test
public void testCreateSearchIndex()
{

    // Create a search index create request.
    SearchIndexCreateRequest searchIndexCreateRequest = new SearchIndexCreateRequest(SEARCH_INDEX_TYPE);
    // Create a search index create response.
    SearchIndex searchIndex =
        new SearchIndex(new SearchIndexKey(SEARCH_INDEX_NAME), 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.createSearchIndex(searchIndexCreateRequest)).thenReturn(searchIndex);
    // Create a search index.
    SearchIndex response = searchIndexRestController.createSearchIndex(searchIndexCreateRequest);
    // Verify the calls.
    verify(searchIndexService, times(1)).createSearchIndex(searchIndexCreateRequest);
    // Validate the returned object.
    assertEquals(searchIndex, response);
}