DataProviderRestController { @RequestMapping(value = "/dataProviders/{dataProviderName}", method = RequestMethod.DELETE) @Secured(SecurityFunctions.FN_DATA_PROVIDERS_DELETE) public DataProvider deleteDataProvider(@PathVariable("dataProviderName") String dataProviderName) { return dataProviderService.deleteDataProvider(new DataProviderKey(dataProviderName)); }  @RequestMapping(value = "/dataProviders", method = RequestMethod.POST, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_DATA_PROVIDERS_POST) DataProvider createDataProvider(@RequestBody DataProviderCreateRequest request); @RequestMapping(value = "/dataProviders/{dataProviderName}", method = RequestMethod.GET) @Secured(SecurityFunctions.FN_DATA_PROVIDERS_GET) DataProvider getDataProvider(@PathVariable("dataProviderName") String dataProviderName); @RequestMapping(value = "/dataProviders/{dataProviderName}", method = RequestMethod.DELETE) @Secured(SecurityFunctions.FN_DATA_PROVIDERS_DELETE) DataProvider deleteDataProvider(@PathVariable("dataProviderName") String dataProviderName); @RequestMapping(value = "/dataProviders", method = RequestMethod.GET) @Secured(SecurityFunctions.FN_DATA_PROVIDERS_ALL_GET) DataProviderKeys getDataProviders();  }
@Test public void testDeleteDataProvider() throws Exception { DataProviderKey dataProviderKey = new DataProviderKey(DATA_PROVIDER_NAME); DataProvider dataProvider = new DataProvider(DATA_PROVIDER_NAME); when(dataProviderService.deleteDataProvider(dataProviderKey)).thenReturn(dataProvider); DataProvider deletedDataProvider = dataProviderRestController.deleteDataProvider(DATA_PROVIDER_NAME); verify(dataProviderService).deleteDataProvider(dataProviderKey); verifyNoMoreInteractions(dataProviderService); assertEquals(dataProvider, deletedDataProvider); }