@Test
public void testUpdateExternalInterface()
{

    when(alternateKeyHelper.validateStringParameter(anyString(), anyString(), anyString())).thenReturn(EXTERNAL_INTERFACE);
    when(alternateKeyHelper.validateStringParameter(anyString(), anyString())).thenReturn(DISPLAY_NAME_FIELD);
    when(externalInterfaceDaoHelper.getExternalInterfaceEntity(EXTERNAL_INTERFACE)).thenReturn(EXTERNAL_INTERFACE_ENTITY);
    when(externalInterfaceDao.saveAndRefresh(any(ExternalInterfaceEntity.class))).thenReturn(EXTERNAL_INTERFACE_ENTITY);
    ExternalInterface externalInterface = externalInterfaceService.updateExternalInterface(EXTERNAL_INTERFACE_KEY, EXTERNAL_INTERFACE_UPDATE_REQUEST);
    assertEquals(DISPLAY_NAME_FIELD, externalInterface.getDisplayName());
    verify(alternateKeyHelper).validateStringParameter("An", "external interface name", EXTERNAL_INTERFACE_KEY.getExternalInterfaceName());
    verify(alternateKeyHelper).validateStringParameter("display name", DISPLAY_NAME_FIELD);
    verify(externalInterfaceDaoHelper).getExternalInterfaceEntity(EXTERNAL_INTERFACE);
    verify(externalInterfaceDao).saveAndRefresh(any(ExternalInterfaceEntity.class));
    verifyNoMoreInteractionsHelper();
}