@Test
public void testSafeObjectMapperWriteValueAsString()
{

    // Create a tag entity.
    final TagEntity tagEntity = tagDaoTestHelper.createTagEntity(TAG_TYPE, TAG_CODE, TAG_DISPLAY_NAME, TAG_DESCRIPTION);
    // Mock the external calls.
    when(jsonHelper.objectToJson(any())).thenReturn(JSON_STRING);
    // Call the method being tested.
    String result = tagHelper.safeObjectMapperWriteValueAsString(tagEntity);
    // Verify the external calls.
    verify(jsonHelper).objectToJson(any());
    verifyNoMoreInteractions(alternateKeyHelper, jsonHelper);
    // Validate the returned object.
    assertEquals(JSON_STRING, result);
}