@Test
public void testGetGlobalAttributeDefinitionEntityEntityNoExists()
{

    // Create a global attribute definition key.
    GlobalAttributeDefinitionKey globalAttributeDefinitionKey =
        new GlobalAttributeDefinitionKey(GLOBAL_ATTRIBUTE_DEFINITON_LEVEL, GLOBAL_ATTRIBUTE_DEFINITON_NAME);
    // Mock calls to external methods.
    when(globalAttributeDefinitionDao.getGlobalAttributeDefinitionByKey(globalAttributeDefinitionKey)).thenReturn(null);
    // Try to call the method under test.
    try
    {
        globalAttributeDefinitionDaoHelper.getGlobalAttributeDefinitionEntity(globalAttributeDefinitionKey);
        fail();
    }
    catch (ObjectNotFoundException e)
    {
        assertEquals(String.format("Global attribute definition with level \"%s\" doesn't exist for global attribute definition name \"%s\".",
            globalAttributeDefinitionKey.getGlobalAttributeDefinitionLevel(), globalAttributeDefinitionKey.getGlobalAttributeDefinitionName()),
            e.getMessage());
    }
    // Verify the external calls.
    verify(globalAttributeDefinitionDao).getGlobalAttributeDefinitionByKey(globalAttributeDefinitionKey);
    verifyNoMoreInteractions(globalAttributeDefinitionDao);
}