ExternalInterfaceRestController { @RequestMapping(value = EXTERNAL_INTERFACE_URI_PREFIX + "/{externalInterfaceName}", method = RequestMethod.PUT, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_EXTERNAL_INTERFACES_PUT) public ExternalInterface updateExternalInterface(@PathVariable("externalInterfaceName") String externalInterfaceName, @RequestBody ExternalInterfaceUpdateRequest request) { return externalInterfaceService.updateExternalInterface(new ExternalInterfaceKey(externalInterfaceName), request); }  @RequestMapping(value = EXTERNAL_INTERFACE_URI_PREFIX, method = RequestMethod.POST, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_EXTERNAL_INTERFACES_POST) ExternalInterface createExternalInterface(@RequestBody ExternalInterfaceCreateRequest request); @RequestMapping(value = EXTERNAL_INTERFACE_URI_PREFIX + "/{externalInterfaceName}", method = RequestMethod.DELETE) @Secured(SecurityFunctions.FN_EXTERNAL_INTERFACES_DELETE) ExternalInterface deleteExternalInterface(@PathVariable("externalInterfaceName") String externalInterfaceName); @RequestMapping(value = EXTERNAL_INTERFACE_URI_PREFIX + "/{externalInterfaceName}", method = RequestMethod.GET) @Secured(SecurityFunctions.FN_EXTERNAL_INTERFACES_GET) ExternalInterface getExternalInterface(@PathVariable("externalInterfaceName") String externalInterfaceName); @RequestMapping(value = EXTERNAL_INTERFACE_URI_PREFIX, method = RequestMethod.GET) @Secured(SecurityFunctions.FN_EXTERNAL_INTERFACES_ALL_GET) ExternalInterfaceKeys getExternalInterfaces(); @RequestMapping(value = EXTERNAL_INTERFACE_URI_PREFIX + "/{externalInterfaceName}", method = RequestMethod.PUT, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_EXTERNAL_INTERFACES_PUT) ExternalInterface updateExternalInterface(@PathVariable("externalInterfaceName") String externalInterfaceName,
        @RequestBody ExternalInterfaceUpdateRequest request);  }
@Test public void testUpdateExternalInterface() { ExternalInterfaceKey externalInterfaceKey = new ExternalInterfaceKey(EXTERNAL_INTERFACE); ExternalInterfaceUpdateRequest externalInterfaceUpdateRequest = new ExternalInterfaceUpdateRequest(DISPLAY_NAME_FIELD, DESCRIPTION); ExternalInterface externalInterface = new ExternalInterface(externalInterfaceKey, DISPLAY_NAME_FIELD, DESCRIPTION); when(externalInterfaceService.updateExternalInterface(externalInterfaceKey, externalInterfaceUpdateRequest)).thenReturn(externalInterface); ExternalInterface resultExternalInterface = externalInterfaceRestController.updateExternalInterface(EXTERNAL_INTERFACE, externalInterfaceUpdateRequest); assertEquals(new ExternalInterface(externalInterfaceKey, DISPLAY_NAME_FIELD, DESCRIPTION), resultExternalInterface); verify(externalInterfaceService).updateExternalInterface(externalInterfaceKey, externalInterfaceUpdateRequest); verifyNoMoreInteractions(externalInterfaceService); assertEquals(externalInterface, resultExternalInterface); }