@Test
public void testIndexSearch()
{

    // Create an index search request.
    final IndexSearchRequest indexSearchRequest =
        new IndexSearchRequest(SEARCH_TERM, NO_INDEX_SEARCH_FILTERS, NO_INDEX_SEARCH_FACET_FIELDS, NO_ENABLE_HIT_HIGHLIGHTING);
    // Create an index search response.
    IndexSearchResponse indexSearchResponse = new IndexSearchResponse(LONG_VALUE, new ArrayList<>(), new ArrayList<>());
    // Create a set of search optional fields.
    Set<String> fields = Sets.newHashSet(FIELD_SHORT_DESCRIPTION);
    // Create a set of search match fields.
    Set<String> match = Sets.newHashSet(MATCH_COLUMN);
    // Mock the external calls.
    when(indexSearchService.indexSearch(indexSearchRequest, fields, match)).thenReturn(indexSearchResponse);
    // Call the method under test.
    IndexSearchResponse result = indexSearchRestController.indexSearch(fields, match, indexSearchRequest);
    // Verify the external calls.
    verify(indexSearchService).indexSearch(indexSearchRequest, fields, match);
    verifyNoMoreInteractions(indexSearchService);
    // Validate the result.
    assertEquals(indexSearchResponse, result);
}