@Test
public void testValidateParentTagEntityWithTagEntityEqualToParentTagEntity()
{

    // Create a tag type entity
    TagTypeEntity tagTypeEntity = new TagTypeEntity();
    tagTypeEntity.setCode(TAG_TYPE_CODE);
    // Create a tag entity
    TagEntity tagEntity = new TagEntity();
    tagEntity.setTagType(tagTypeEntity);
    tagEntity.setTagCode(TAG_CODE);
    tagEntity.setDisplayName(TAG_DISPLAY_NAME);
    // Setup when clauses
    when(configurationHelper.getProperty(ConfigurationValue.MAX_ALLOWED_TAG_NESTING, Integer.class)).thenReturn(0);
    // Call the method under test
    try
    {
        tagDaoHelper.validateParentTagEntity(tagEntity, tagEntity);
        fail("Expected to throw an exception.");
    }
    catch (IllegalArgumentException illegalArgumentException)
    {
        // Confirm the exception message is correct
        assertThat("Exception message is not correct.", illegalArgumentException.getMessage(),
            is(equalTo("Parent tag key cannot be the requested tag key or any of its children’s tag keys.")));
    }
    // Setup verify clauses
    verify(configurationHelper).getProperty(ConfigurationValue.MAX_ALLOWED_TAG_NESTING, Integer.class);
    verifyNoMoreInteractions(configurationHelper, tagDao);
}