@Test
public void testCreateGlobalAttributeDefinition()
{

    // Create a global attribute definition key.
    GlobalAttributeDefinitionKey globalAttributeDefinitionKey =
        new GlobalAttributeDefinitionKey(GLOBAL_ATTRIBUTE_DEFINITON_LEVEL, GLOBAL_ATTRIBUTE_DEFINITON_NAME);
    // Create a global attribute definition create request.
    GlobalAttributeDefinitionCreateRequest request = new GlobalAttributeDefinitionCreateRequest(globalAttributeDefinitionKey, attributeValueListKeyNull);
    // Create a global attribute definition.
    GlobalAttributeDefinition globalAttributeDefinition = new GlobalAttributeDefinition();
    // Mock calls to external methods.
    when(globalAttributeDefinitionService.createGlobalAttributeDefinition(request)).thenReturn(globalAttributeDefinition);
    // Call the method under  test.
    GlobalAttributeDefinition response = globalAttributeDefinitionRestController.createGlobalAttributeDefinition(request);
    // Verify the external calls.
    verify(globalAttributeDefinitionService).createGlobalAttributeDefinition(request);
    verifyNoMoreInteractions(globalAttributeDefinitionService);
    // Validate the response.
    assertEquals(globalAttributeDefinition, response);
}