@Test
public void testCreateTagType() throws Exception
{

    TagTypeCreateRequest request = new TagTypeCreateRequest(new TagTypeKey(TAG_TYPE), TAG_TYPE_DISPLAY_NAME, TAG_TYPE_ORDER, TAG_TYPE_DESCRIPTION);
    TagType tagType = new TagType(new TagTypeKey(TAG_TYPE), TAG_TYPE_DISPLAY_NAME, TAG_TYPE_ORDER, TAG_TYPE_DESCRIPTION);
    when(tagTypeService.createTagType(request)).thenReturn(tagType);
    // Create a tag type.
    TagType resultTagType = tagTypeRestController
        .createTagType(new TagTypeCreateRequest(new TagTypeKey(TAG_TYPE), TAG_TYPE_DISPLAY_NAME, TAG_TYPE_ORDER, TAG_TYPE_DESCRIPTION));
    // Verify the external calls.
    verify(tagTypeService).createTagType(request);
    verifyNoMoreInteractions(tagTypeService);
    // Validate the returned object.
    assertEquals(tagType, resultTagType);
}