@Test
public void testValidateTagKey()
{

    // Create a tag key.
    TagKey tagKey = new TagKey(TAG_TYPE, TAG_CODE);
    // Mock the external calls.
    when(alternateKeyHelper.validateStringParameter("tag type code", TAG_TYPE)).thenReturn(TAG_TYPE);
    when(alternateKeyHelper.validateStringParameter("tag code", TAG_CODE)).thenReturn(TAG_CODE);
    // Validate and trim a tag key.
    tagHelper.validateTagKey(tagKey);
    // Verify the external calls.
    verify(alternateKeyHelper).validateStringParameter("tag type code", TAG_TYPE);
    verify(alternateKeyHelper).validateStringParameter("tag code", TAG_CODE);
    verifyNoMoreInteractions(alternateKeyHelper, jsonHelper);
    // Validate the tag key.
    assertEquals(new TagKey(TAG_TYPE, TAG_CODE), tagKey);
}