@Test
public void testValidateAndTrimExternalInterfaceKeyExtraSpaces()
{

    when(alternateKeyHelper.validateStringParameter(anyString(), anyString(), anyString())).thenReturn(EXTERNAL_INTERFACE);
    ExternalInterfaceKey externalInterfaceKeyWithExtraSpacesInName = new ExternalInterfaceKey(EXTERNAL_INTERFACE_NAME_WITH_EXTRA_SPACES);
    assertEquals(EXTERNAL_INTERFACE_NAME_WITH_EXTRA_SPACES, externalInterfaceKeyWithExtraSpacesInName.getExternalInterfaceName());
    externalInterfaceService.validateAndTrimExternalInterfaceKey(externalInterfaceKeyWithExtraSpacesInName);
    // White space should be trimmed now
    assertEquals(EXTERNAL_INTERFACE, externalInterfaceKeyWithExtraSpacesInName.getExternalInterfaceName());
}