@Test
public void testSearchBusinessObjectDefinitionDescriptionSuggestions()
{

    // Create the business object definition description suggestion search request.
    BusinessObjectDefinitionDescriptionSuggestionSearchKey businessObjectDefinitionDescriptionSuggestionSearchKey =
        new BusinessObjectDefinitionDescriptionSuggestionSearchKey(NAMESPACE, BDEF_NAME, BDEF_DESCRIPTION_SUGGESTION_STATUS);
    BusinessObjectDefinitionDescriptionSuggestionSearchFilter businessObjectDefinitionDescriptionSuggestionSearchFilter =
        new BusinessObjectDefinitionDescriptionSuggestionSearchFilter(Lists.newArrayList(businessObjectDefinitionDescriptionSuggestionSearchKey));
    BusinessObjectDefinitionDescriptionSuggestionSearchRequest request =
        new BusinessObjectDefinitionDescriptionSuggestionSearchRequest(Lists.newArrayList(businessObjectDefinitionDescriptionSuggestionSearchFilter));
    // Create a business object definition description suggestion key.
    BusinessObjectDefinitionDescriptionSuggestionKey key = new BusinessObjectDefinitionDescriptionSuggestionKey(NAMESPACE, BDEF_NAME, USER_ID);
    // Create the business object definition description suggestion.
    BusinessObjectDefinitionDescriptionSuggestion businessObjectDefinitionDescriptionSuggestion =
        new BusinessObjectDefinitionDescriptionSuggestion(ID, key, DESCRIPTION_SUGGESTION, BDEF_DESCRIPTION_SUGGESTION_STATUS, USER_ID, CREATED_ON);
    // Create the business object definition description suggestion search response.
    BusinessObjectDefinitionDescriptionSuggestionSearchResponse businessObjectDefinitionDescriptionSuggestionSearchResponse =
        new BusinessObjectDefinitionDescriptionSuggestionSearchResponse(Lists.newArrayList(businessObjectDefinitionDescriptionSuggestion));
    // Build the fields set
    Set<String> fields = new HashSet<>();
    fields.add(CREATED_BY_USER_ID_FIELD);
    fields.add(DESCRIPTION_SUGGESTION_FIELD);
    fields.add(STATUS_FIELD);
    // Mock calls to external method.
    when(businessObjectDefinitionDescriptionSuggestionService.searchBusinessObjectDefinitionDescriptionSuggestions(request, fields))
        .thenReturn(businessObjectDefinitionDescriptionSuggestionSearchResponse);
    // Search business object definition description suggestions.
    BusinessObjectDefinitionDescriptionSuggestionSearchResponse response =
        businessObjectDefinitionDescriptionSuggestionRestController.searchBusinessObjectDefinitionDescriptionSuggestions(fields, request);
    // Verify the external calls.
    verify(businessObjectDefinitionDescriptionSuggestionService).searchBusinessObjectDefinitionDescriptionSuggestions(request, fields);
    verifyNoMoreInteractions(businessObjectDefinitionDescriptionSuggestionService);
    // Validate the returned object.
    assertEquals(businessObjectDefinitionDescriptionSuggestionSearchResponse, response);
}