@Test
public void testCreateTag()
{

    TagKey tagKey = new TagKey(TAG_TYPE, TAG_CODE);
    TagCreateRequest request = new TagCreateRequest(tagKey, TAG_DISPLAY_NAME, TAG_SEARCH_SCORE_MULTIPLIER, TAG_DESCRIPTION, NO_PARENT_TAG_KEY);
    Tag tag = getNewTag(tagKey);
    when(tagService.createTag(request)).thenReturn(tag);
    // Create a tag.
    Tag resultTag = tagRestController.createTag(request);
    // Verify the external calls.
    verify(tagService).createTag(request);
    verifyNoMoreInteractions(tagService);
    // Validate the returned object.
    assertEquals(tag, resultTag);
}