StoragePlatformRestController extends HerdBaseController { @RequestMapping(value = "/storagePlatforms", method = RequestMethod.GET) @Secured(SecurityFunctions.FN_STORAGE_PLATFORMS_ALL_GET) public StoragePlatforms getStoragePlatforms() { return storagePlatformService.getStoragePlatforms(); }  @RequestMapping(value = "/storagePlatforms/{name}", method = RequestMethod.GET) @Secured(SecurityFunctions.FN_STORAGE_PLATFORMS_GET) StoragePlatform getStoragePlatform(@PathVariable("name") String name); @RequestMapping(value = "/storagePlatforms", method = RequestMethod.GET) @Secured(SecurityFunctions.FN_STORAGE_PLATFORMS_ALL_GET) StoragePlatforms getStoragePlatforms();  }
@Test public void testGetStoragePlatforms() throws Exception { StoragePlatforms storagePlatforms = new StoragePlatforms(Arrays.asList(new StoragePlatform())); when(storagePlatformService.getStoragePlatforms()).thenReturn(storagePlatforms); StoragePlatforms resultStoragePlatforms = storagePlatformRestController.getStoragePlatforms(); assertNotNull(storagePlatforms); logger.info("Total number of storage platforms: " + storagePlatforms.getStoragePlatforms().size()); assertTrue(storagePlatforms.getStoragePlatforms().size() >= 1); verify(storagePlatformService).getStoragePlatforms(); verifyNoMoreInteractions(storagePlatformService); assertEquals(storagePlatforms, resultStoragePlatforms); }