@Test
public void testGetTagEntityWithNullTagEntity()
{

    // Create a tag key
    TagKey tagKey = new TagKey(TAG_TYPE_CODE, TAG_CODE);
    // Setup when clauses
    when(tagDao.getTagByKey(tagKey)).thenReturn(null);
    // Call method under test
    try
    {
        tagDaoHelper.getTagEntity(tagKey);
        fail("Expected to throw an exception.");
    }
    catch (ObjectNotFoundException objectNotFoundException)
    {
        // Confirm the exception message is correct
        assertThat("Exception message is not correct.", objectNotFoundException.getMessage(),
            is(equalTo(String.format("Tag with code \"%s\" doesn't exist for tag type \"%s\".", tagKey.getTagCode(), tagKey.getTagTypeCode()))));
    }
    // Setup verify clauses
    verify(tagDao).getTagByKey(tagKey);
    verifyNoMoreInteractions(configurationHelper, tagDao);
}