@Test
public void testSearchTagTypes()
{

    TagTypeSearchResponse tagTypeSearchResponse = new TagTypeSearchResponse(Arrays
        .asList(new TagType(new TagTypeKey(TAG_TYPE_2), TAG_TYPE_DISPLAY_NAME_2, TAG_TYPE_ORDER, TAG_TYPE_DESCRIPTION_2),
            new TagType(new TagTypeKey(TAG_TYPE), TAG_TYPE_DISPLAY_NAME, TAG_TYPE_ORDER_2, TAG_TYPE_DESCRIPTION)));
    Set<String> searchFields =
        Sets.newHashSet(TagTypeServiceImpl.DISPLAY_NAME_FIELD, TagTypeServiceImpl.TAG_TYPE_ORDER_FIELD, TagTypeServiceImpl.DESCRIPTION_FIELD);
    when(tagTypeService.searchTagTypes(new TagTypeSearchRequest(), searchFields)).thenReturn(tagTypeSearchResponse);
    // Search tag types.
    TagTypeSearchResponse resultTagTypeSearchResponse = tagTypeRestController.searchTagTypes(new TagTypeSearchRequest(), searchFields);
    // Verify the external calls.
    verify(tagTypeService).searchTagTypes(new TagTypeSearchRequest(), searchFields);
    verifyNoMoreInteractions(tagTypeService);
    // Validate the returned object.
    assertEquals(tagTypeSearchResponse, resultTagTypeSearchResponse);
}