public T fromResource(Resource in) { return this .id(in.getId()) .name(in.getName()) .links(in.getLinks()); } }
@Test(description = "GET /v${apiVersion}/{tenantId}/images") public void testListImages() throws Exception { for (String zoneId : zones) { ImageApi imageApi = api.getImageApiForZone(zoneId); Set<? extends Resource> response = imageApi.list().concat().toSet(); assertNotNull(response); assertFalse(response.isEmpty()); for (Resource image : response) { assertNotNull(image.getId()); assertNotNull(image.getName()); assertNotNull(image.getLinks()); } } }
public T fromResource(Resource in) { return this .id(in.getId()) .name(in.getName()) .links(in.getLinks()); } }
public T fromResource(Resource in) { return this .id(in.getId()) .name(in.getName()) .links(in.getLinks()); } }
public T fromResource(Resource in) { return this .id(in.getId()) .name(in.getName()) .links(in.getLinks()); } }
public T fromResource(Resource in) { return this .id(in.getId()) .name(in.getName()) .links(in.getLinks()); } }
public T fromResource(Resource in) { return this .id(in.getId()) .name(in.getName()) .links(in.getLinks()); } }
public T fromResource(Resource in) { return this .id(in.getId()) .name(in.getName()) .links(in.getLinks()); } }
@Test(description = "GET /v${apiVersion}/{tenantId}/images") public void testListImages() throws Exception { for (String regionId : regions) { ImageApi imageApi = api.getImageApi(regionId); Set<? extends Resource> response = imageApi.list().concat().toSet(); assertNotNull(response); assertFalse(response.isEmpty()); for (Resource image : response) { assertNotNull(image.getId()); assertNotNull(image.getName()); assertNotNull(image.getLinks()); } } }
/** * Tests the listing of Flavors. * * @throws Exception */ @Test(description = "GET /v${apiVersion}/{tenantId}/flavors") public void testListFlavors() throws Exception { for (String zoneId : zones) { FlavorApi flavorApi = api.getFlavorApiForZone(zoneId); Set<? extends Resource> response = flavorApi.list().concat().toSet(); assertNotNull(response); assertFalse(response.isEmpty()); for (Resource flavor : response) { assertNotNull(flavor.getId()); assertNotNull(flavor.getName()); assertNotNull(flavor.getLinks()); } } }
/** * Tests the listing of Flavors. * * @throws Exception */ @Test(description = "GET /v${apiVersion}/{tenantId}/flavors") public void testListFlavors() throws Exception { for (String regionId : regions) { FlavorApi flavorApi = api.getFlavorApi(regionId); Set<? extends Resource> response = flavorApi.list().concat().toSet(); assertNotNull(response); assertFalse(response.isEmpty()); for (Resource flavor : response) { assertNotNull(flavor.getId()); assertNotNull(flavor.getName()); assertNotNull(flavor.getLinks()); } } }
@Test(description = "GET /v${apiVersion}/{tenantId}/servers/{id}", dependsOnMethods = { "testListServersInDetail" }) public void testGetServerById() throws Exception { for (String zoneId : zones) { ServerApi serverApi = api.getServerApiForZone(zoneId); for (Resource server : serverApi.list().concat()) { Server details = serverApi.get(server.getId()); assertEquals(details.getId(), server.getId()); assertEquals(details.getName(), server.getName()); assertEquals(details.getLinks(), server.getLinks()); checkServer(details); } } }
@Test(description = "GET /v${apiVersion}/{tenantId}/servers/{id}", dependsOnMethods = {"testListServersInDetail"}) public void testGetServerById() throws Exception { for (String regionId : regions) { ServerApi serverApi = api.getServerApi(regionId); for (Resource server : serverApi.list().concat()) { Server details = serverApi.get(server.getId()); assertEquals(details.getId(), server.getId()); assertEquals(details.getName(), server.getName()); assertEquals(details.getLinks(), server.getLinks()); checkServer(details); } } }