@Test
public void testSearchTags()
{

    TagSearchResponse tagSearchResponse = new TagSearchResponse(Arrays.asList(
        new Tag(NO_ID, new TagKey(TAG_TYPE, TAG_CODE_3), TAG_DISPLAY_NAME_2, TAG_SEARCH_SCORE_MULTIPLIER_3, TAG_DESCRIPTION_3, NO_USER_ID, NO_USER_ID,
            NO_UPDATED_TIME, new TagKey(TAG_TYPE, TAG_CODE), TAG_HAS_NO_CHILDREN),
        new Tag(NO_ID, new TagKey(TAG_TYPE, TAG_CODE_2), TAG_DISPLAY_NAME_3, TAG_SEARCH_SCORE_MULTIPLIER_2, TAG_DESCRIPTION_2, NO_USER_ID, NO_USER_ID,
            NO_UPDATED_TIME, new TagKey(TAG_TYPE, TAG_CODE), TAG_HAS_NO_CHILDREN)));
    Set<String> searchFields = Sets.newHashSet(TagServiceImpl.DISPLAY_NAME_FIELD, TagServiceImpl.DESCRIPTION_FIELD, TagServiceImpl.PARENT_TAG_KEY_FIELD,
        TagServiceImpl.HAS_CHILDREN_FIELD);
    TagSearchRequest tagSearchRequest =
        new TagSearchRequest(Arrays.asList(new TagSearchFilter(Arrays.asList(new TagSearchKey(TAG_TYPE, TAG_CODE, NO_IS_PARENT_TAG_NULL_FLAG)))));
    when(tagService.searchTags(tagSearchRequest, searchFields)).thenReturn(tagSearchResponse);
    // Search the tags.
    TagSearchResponse resultTagSearchResponse = tagRestController.searchTags(tagSearchRequest, searchFields);
    // Verify the external calls.
    verify(tagService).searchTags(tagSearchRequest, searchFields);
    verifyNoMoreInteractions(tagService);
    // Validate the returned object.
    assertEquals(tagSearchResponse, resultTagSearchResponse);
}