DataProviderRestController { @RequestMapping(value = "/dataProviders", method = RequestMethod.GET) @Secured(SecurityFunctions.FN_DATA_PROVIDERS_ALL_GET) public DataProviderKeys getDataProviders() { return dataProviderService.getDataProviders(); }  @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 testGetDataProviders() throws Exception { DataProviderKeys dataProviderKeys = new DataProviderKeys(Arrays.asList(new DataProviderKey(DATA_PROVIDER_NAME), new DataProviderKey(DATA_PROVIDER_NAME_2))); when(dataProviderService.getDataProviders()).thenReturn(dataProviderKeys); DataProviderKeys resultDataProviderKeys = dataProviderRestController.getDataProviders(); verify(dataProviderService).getDataProviders(); verifyNoMoreInteractions(dataProviderService); assertEquals(dataProviderKeys, resultDataProviderKeys); }