mirror of https://github.com/apache/jclouds.git
Merge pull request #1118 from jclouds/fluentiterable-deprecation
moved off deprecated FluentIterable methods
This commit is contained in:
commit
b8b258d462
|
@ -85,7 +85,7 @@ public class MetricApiExpectTest extends BaseCloudWatchApiExpectTest {
|
|||
CloudWatchApi apiWhenMetricsDontExist = requestSendsResponse(
|
||||
listMetrics, listMetricsResponse);
|
||||
|
||||
assertEquals(apiWhenMetricsDontExist.getMetricApiForRegion(null).list().get(0).toImmutableSet(), ImmutableSet.of());
|
||||
assertEquals(apiWhenMetricsDontExist.getMetricApiForRegion(null).list().get(0).toSet(), ImmutableSet.of());
|
||||
}
|
||||
|
||||
public void testListMetrics2PagesWhenResponseIs2xx() throws Exception {
|
||||
|
|
|
@ -166,7 +166,7 @@ public class TagApiExpectTest extends BaseEC2ApiExpectTest<EC2Api> {
|
|||
EC2Api apiWhenDontExist = requestSendsResponse(
|
||||
list, listResponse);
|
||||
|
||||
assertEquals(apiWhenDontExist.getTagApi().get().list().toImmutableSet(), ImmutableSet.of());
|
||||
assertEquals(apiWhenDontExist.getTagApi().get().list().toSet(), ImmutableSet.of());
|
||||
}
|
||||
|
||||
HttpRequest filter =
|
||||
|
@ -212,7 +212,7 @@ public class TagApiExpectTest extends BaseEC2ApiExpectTest<EC2Api> {
|
|||
assertEquals(apiWhenDontExist.getTagApi().get().filter(ImmutableMultimap.<String, String> builder()
|
||||
.put("resource-type", "instance")
|
||||
.put("key", "stack")
|
||||
.build()).toImmutableSet(), ImmutableSet.of());
|
||||
.build()).toSet(), ImmutableSet.of());
|
||||
}
|
||||
|
||||
HttpRequest delete = HttpRequest.builder()
|
||||
|
|
|
@ -94,7 +94,7 @@ public abstract class BaseTagApiLiveTest extends BaseEC2ApiLiveTest {
|
|||
public boolean apply(Tag in) {
|
||||
return in.getResourceId().equals(resource.id);
|
||||
}
|
||||
}).toImmutableSet().equals(input);
|
||||
}).toSet().equals(input);
|
||||
}
|
||||
|
||||
}, 600, 200, 200, TimeUnit.MILLISECONDS).apply(ImmutableSet.of(tag, tag2)));
|
||||
|
|
|
@ -60,7 +60,7 @@ public class SnapshotApiExpectTest extends BaseCinderApiExpectTest {
|
|||
HttpResponse.builder().statusCode(200).payload(payloadFromResource("/snapshot_list_simple.json")).build()
|
||||
).getSnapshotApiForZone("RegionOne");
|
||||
|
||||
Set<? extends Snapshot> snapshots = api.list().toImmutableSet();
|
||||
Set<? extends Snapshot> snapshots = api.list().toSet();
|
||||
assertEquals(snapshots, ImmutableSet.of(testSnapshot()));
|
||||
}
|
||||
|
||||
|
@ -73,7 +73,7 @@ public class SnapshotApiExpectTest extends BaseCinderApiExpectTest {
|
|||
HttpResponse.builder().statusCode(404).build()
|
||||
).getSnapshotApiForZone("RegionOne");
|
||||
|
||||
Set<? extends Snapshot> snapshots = api.list().toImmutableSet();
|
||||
Set<? extends Snapshot> snapshots = api.list().toSet();
|
||||
assertTrue(snapshots.isEmpty());
|
||||
}
|
||||
|
||||
|
@ -86,7 +86,7 @@ public class SnapshotApiExpectTest extends BaseCinderApiExpectTest {
|
|||
HttpResponse.builder().statusCode(200).payload(payloadFromResource("/snapshot_list_details.json")).build()
|
||||
).getSnapshotApiForZone("RegionOne");
|
||||
|
||||
Set<? extends Snapshot> snapshots = api.listInDetail().toImmutableSet();
|
||||
Set<? extends Snapshot> snapshots = api.listInDetail().toSet();
|
||||
assertEquals(snapshots, ImmutableSet.of(testSnapshot()));
|
||||
|
||||
// double-check individual fields
|
||||
|
@ -108,7 +108,7 @@ public class SnapshotApiExpectTest extends BaseCinderApiExpectTest {
|
|||
HttpResponse.builder().statusCode(404).build()
|
||||
).getSnapshotApiForZone("RegionOne");
|
||||
|
||||
Set<? extends Snapshot> snapshots = api.listInDetail().toImmutableSet();
|
||||
Set<? extends Snapshot> snapshots = api.listInDetail().toSet();
|
||||
assertTrue(snapshots.isEmpty());
|
||||
}
|
||||
|
||||
|
|
|
@ -92,7 +92,7 @@ public class VolumeAndSnapshotApiLiveTest extends BaseCinderApiLiveTest {
|
|||
|
||||
@Test(dependsOnMethods = "testCreateVolume")
|
||||
public void testListVolumes() {
|
||||
Set<? extends Volume> volumes = volumeApi.list().toImmutableSet();
|
||||
Set<? extends Volume> volumes = volumeApi.list().toSet();
|
||||
assertNotNull(volumes);
|
||||
boolean foundIt = false;
|
||||
for (Volume vol : volumes) {
|
||||
|
@ -107,7 +107,7 @@ public class VolumeAndSnapshotApiLiveTest extends BaseCinderApiLiveTest {
|
|||
|
||||
@Test(dependsOnMethods = "testCreateVolume")
|
||||
public void testListVolumesInDetail() {
|
||||
Set<? extends Volume> volumes = volumeApi.listInDetail().toImmutableSet();
|
||||
Set<? extends Volume> volumes = volumeApi.listInDetail().toSet();
|
||||
assertNotNull(volumes);
|
||||
boolean foundIt = false;
|
||||
for (Volume vol : volumes) {
|
||||
|
@ -146,7 +146,7 @@ public class VolumeAndSnapshotApiLiveTest extends BaseCinderApiLiveTest {
|
|||
|
||||
@Test(dependsOnMethods = "testCreateSnapshot")
|
||||
public void testListSnapshots() {
|
||||
Set<? extends Snapshot> snapshots = snapshotApi.list().toImmutableSet();
|
||||
Set<? extends Snapshot> snapshots = snapshotApi.list().toSet();
|
||||
assertNotNull(snapshots);
|
||||
boolean foundIt = false;
|
||||
for (Snapshot snap : snapshots) {
|
||||
|
@ -163,7 +163,7 @@ public class VolumeAndSnapshotApiLiveTest extends BaseCinderApiLiveTest {
|
|||
|
||||
@Test(dependsOnMethods = "testCreateSnapshot")
|
||||
public void testListSnapshotsInDetail() {
|
||||
Set<? extends Snapshot> snapshots = snapshotApi.listInDetail().toImmutableSet();
|
||||
Set<? extends Snapshot> snapshots = snapshotApi.listInDetail().toSet();
|
||||
assertNotNull(snapshots);
|
||||
boolean foundIt = false;
|
||||
for (Snapshot snap : snapshots) {
|
||||
|
|
|
@ -59,7 +59,7 @@ public class VolumeApiExpectTest extends BaseCinderApiExpectTest {
|
|||
HttpResponse.builder().statusCode(200).payload(payloadFromResource("/volume_list_simple.json")).build()
|
||||
).getVolumeApiForZone("RegionOne");
|
||||
|
||||
Set<? extends Volume> volumes = api.list().toImmutableSet();
|
||||
Set<? extends Volume> volumes = api.list().toSet();
|
||||
assertEquals(volumes, ImmutableSet.of(testVolume()));
|
||||
}
|
||||
|
||||
|
@ -72,7 +72,7 @@ public class VolumeApiExpectTest extends BaseCinderApiExpectTest {
|
|||
HttpResponse.builder().statusCode(404).build()
|
||||
).getVolumeApiForZone("RegionOne");
|
||||
|
||||
Set<? extends Volume> volumes = api.list().toImmutableSet();
|
||||
Set<? extends Volume> volumes = api.list().toSet();
|
||||
assertTrue(volumes.isEmpty());
|
||||
}
|
||||
|
||||
|
@ -85,7 +85,7 @@ public class VolumeApiExpectTest extends BaseCinderApiExpectTest {
|
|||
HttpResponse.builder().statusCode(200).payload(payloadFromResource("/volume_list_details.json")).build()
|
||||
).getVolumeApiForZone("RegionOne");
|
||||
|
||||
Set<? extends Volume> volumes = api.listInDetail().toImmutableSet();
|
||||
Set<? extends Volume> volumes = api.listInDetail().toSet();
|
||||
assertEquals(volumes, ImmutableSet.of(testVolume()));
|
||||
}
|
||||
|
||||
|
@ -98,7 +98,7 @@ public class VolumeApiExpectTest extends BaseCinderApiExpectTest {
|
|||
HttpResponse.builder().statusCode(404).build()
|
||||
).getVolumeApiForZone("RegionOne");
|
||||
|
||||
Set<? extends Volume> volumes = api.listInDetail().toImmutableSet();
|
||||
Set<? extends Volume> volumes = api.listInDetail().toSet();
|
||||
assertTrue(volumes.isEmpty());
|
||||
}
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ public class VolumeTypeApiExpectTest extends BaseCinderApiExpectTest {
|
|||
HttpResponse.builder().statusCode(200).payload(payloadFromResource("/volume_type_list_simple.json")).build()
|
||||
).getVolumeTypeApiForZone("RegionOne");
|
||||
|
||||
Set<? extends VolumeType> types = api.list().toImmutableSet();
|
||||
Set<? extends VolumeType> types = api.list().toSet();
|
||||
assertEquals(types, ImmutableSet.of(testVolumeType()));
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ public class VolumeTypeApiLiveTest extends BaseCinderApiLiveTest {
|
|||
}
|
||||
|
||||
public void testListAndGetVolumeTypes() {
|
||||
Set<? extends VolumeType> volumeTypes = volumeTypeApi.list().toImmutableSet();
|
||||
Set<? extends VolumeType> volumeTypes = volumeTypeApi.list().toSet();
|
||||
assertNotNull(volumeTypes);
|
||||
|
||||
for (VolumeType vt : volumeTypes) {
|
||||
|
|
|
@ -95,7 +95,7 @@ public class LocationIdToURIFromAccessForTypeAndVersion implements Supplier<Map<
|
|||
@Override
|
||||
public Map<String, Supplier<URI>> get() {
|
||||
FluentIterable<Service> services = FluentIterable.from(access.get()).filter(apiTypeEquals);
|
||||
if (services.toImmutableSet().size() == 0)
|
||||
if (services.toSet().size() == 0)
|
||||
throw new NoSuchElementException(String.format("apiType %s not found in catalog %s", apiType, services));
|
||||
|
||||
Iterable<Endpoint> endpoints = concat(services);
|
||||
|
|
|
@ -61,7 +61,7 @@ public class TenantApiExpectTest extends BaseKeystoneRestApiExpectTest<KeystoneA
|
|||
payloadFromResourceWithContentType("/tenant_list.json", APPLICATION_JSON)).build())
|
||||
.getTenantApi().get();
|
||||
|
||||
assertEquals(api.list().concat().toImmutableSet(), expectedTenants);
|
||||
assertEquals(api.list().concat().toSet(), expectedTenants);
|
||||
}
|
||||
|
||||
public void testListTenantsPage() {
|
||||
|
@ -72,7 +72,7 @@ public class TenantApiExpectTest extends BaseKeystoneRestApiExpectTest<KeystoneA
|
|||
HttpResponse.builder().statusCode(200).payload(
|
||||
payloadFromResourceWithContentType("/tenant_list.json", APPLICATION_JSON)).build())
|
||||
.getTenantApi().get();
|
||||
Set<? extends Tenant> tenants = api.list(new PaginationOptions()).toImmutableSet();
|
||||
Set<? extends Tenant> tenants = api.list(new PaginationOptions()).toSet();
|
||||
assertNotNull(tenants);
|
||||
assertFalse(tenants.isEmpty());
|
||||
|
||||
|
@ -93,7 +93,7 @@ public class TenantApiExpectTest extends BaseKeystoneRestApiExpectTest<KeystoneA
|
|||
|
||||
Set<Tenant> expected = ImmutableSet.of(Tenant.builder().name("this-is-a-test").id("14").description("None").build());
|
||||
|
||||
assertEquals(api.list().concat().toImmutableSet(), expected);
|
||||
assertEquals(api.list().concat().toSet(), expected);
|
||||
}
|
||||
|
||||
// this is not a compatible format of json per:
|
||||
|
|
|
@ -38,7 +38,7 @@ public class TenantApiLiveTest extends BaseKeystoneApiLiveTest {
|
|||
|
||||
public void testTenants() {
|
||||
TenantApi api = keystoneContext.getApi().getTenantApi().get();
|
||||
Set<? extends Tenant> result = api.list().concat().toImmutableSet();
|
||||
Set<? extends Tenant> result = api.list().concat().toSet();
|
||||
assertNotNull(result);
|
||||
assertFalse(result.isEmpty());
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ public class UserApiExpectTest extends BaseKeystoneRestApiExpectTest<KeystoneApi
|
|||
HttpResponse.builder().statusCode(200).payload(payloadFromResourceWithContentType("/user_list.json", APPLICATION_JSON)).build())
|
||||
.getUserApi().get();
|
||||
|
||||
assertEquals(api.list().concat().toImmutableSet(), expectedUsers);
|
||||
assertEquals(api.list().concat().toSet(), expectedUsers);
|
||||
}
|
||||
|
||||
public void testListUsersPage() {
|
||||
|
@ -80,7 +80,7 @@ public class UserApiExpectTest extends BaseKeystoneRestApiExpectTest<KeystoneApi
|
|||
assertFalse(users.isEmpty());
|
||||
|
||||
|
||||
assertEquals(users.toImmutableSet(), expectedUsers);
|
||||
assertEquals(users.toSet(), expectedUsers);
|
||||
}
|
||||
|
||||
public void testListUsersNotFound() {
|
||||
|
|
|
@ -41,7 +41,7 @@ public class UserApiLiveTest extends BaseKeystoneApiLiveTest {
|
|||
public void testUsers() {
|
||||
|
||||
UserApi api = keystoneContext.getApi().getUserApi().get();
|
||||
Set<? extends User> users = api.list().concat().toImmutableSet();
|
||||
Set<? extends User> users = api.list().concat().toSet();
|
||||
assertNotNull(users);
|
||||
assertFalse(users.isEmpty());
|
||||
for (User user : users) {
|
||||
|
@ -54,7 +54,7 @@ public class UserApiLiveTest extends BaseKeystoneApiLiveTest {
|
|||
public void testUserRolesOnTenant() {
|
||||
|
||||
UserApi api = keystoneContext.getApi().getUserApi().get();
|
||||
Set<? extends Tenant> tenants = keystoneContext.getApi().getTenantApi().get().list().concat().toImmutableSet();
|
||||
Set<? extends Tenant> tenants = keystoneContext.getApi().getTenantApi().get().list().concat().toSet();
|
||||
|
||||
for (User user : api.list().concat()) {
|
||||
for (Tenant tenant : tenants) {
|
||||
|
|
|
@ -159,7 +159,7 @@ public class NovaComputeServiceAdapter implements
|
|||
Set<String> zones = zoneIds.get();
|
||||
checkState(zones.size() > 0, "no zones found in supplier %s", zoneIds);
|
||||
for (final String zoneId : zones) {
|
||||
Set<? extends Image> images = novaApi.getImageApiForZone(zoneId).listInDetail().concat().toImmutableSet();
|
||||
Set<? extends Image> images = novaApi.getImageApiForZone(zoneId).listInDetail().concat().toSet();
|
||||
if (images.size() == 0) {
|
||||
logger.debug("no images found in zone %s", zoneId);
|
||||
continue;
|
||||
|
|
|
@ -52,7 +52,7 @@ public class FloatingIPApiLiveTest extends BaseNovaApiLiveTest {
|
|||
if (!apiOption.isPresent())
|
||||
continue;
|
||||
FloatingIPApi api = apiOption.get();
|
||||
Set<? extends FloatingIP> response = api.list().toImmutableSet();
|
||||
Set<? extends FloatingIP> response = api.list().toSet();
|
||||
assert null != response;
|
||||
assertTrue(response.size() >= 0);
|
||||
for (FloatingIP ip : response) {
|
||||
|
@ -77,7 +77,7 @@ public class FloatingIPApiLiveTest extends BaseNovaApiLiveTest {
|
|||
FloatingIP floatingIP = api.create();
|
||||
assertNotNull(floatingIP);
|
||||
|
||||
Set<? extends FloatingIP> response = api.list().toImmutableSet();
|
||||
Set<? extends FloatingIP> response = api.list().toSet();
|
||||
boolean ipInSet = false;
|
||||
for (FloatingIP ip : response) {
|
||||
if (ip.getId().equals(floatingIP.getId()))
|
||||
|
@ -87,7 +87,7 @@ public class FloatingIPApiLiveTest extends BaseNovaApiLiveTest {
|
|||
|
||||
api.delete(floatingIP.getId());
|
||||
|
||||
response = api.list().toImmutableSet();
|
||||
response = api.list().toSet();
|
||||
ipInSet = false;
|
||||
for (FloatingIP ip : response) {
|
||||
if (ip.getId().equals(floatingIP.getId())) {
|
||||
|
|
|
@ -59,7 +59,7 @@ public class HostAdministrationApiExpectTest extends BaseNovaApiExpectTest {
|
|||
|
||||
Host expected = Host.builder().name("ubuntu").service("compute").build();
|
||||
|
||||
Set<? extends Host> result = api.list().toImmutableSet();
|
||||
Set<? extends Host> result = api.list().toSet();
|
||||
Host host = Iterables.getOnlyElement(result);
|
||||
assertEquals(host.getName(), "ubuntu");
|
||||
assertEquals(host.getService(), "compute");
|
||||
|
@ -84,7 +84,7 @@ public class HostAdministrationApiExpectTest extends BaseNovaApiExpectTest {
|
|||
HostResourceUsage.builder().memoryMb(6144).project("f8535069c3fb404cb61c873b1a0b4921").cpu(3).diskGb(80).host("ubuntu").build()
|
||||
);
|
||||
|
||||
assertEquals(api.listResourceUsage("xyz").toImmutableSet(), expected);
|
||||
assertEquals(api.listResourceUsage("xyz").toSet(), expected);
|
||||
}
|
||||
|
||||
public void testEnableHost() {
|
||||
|
|
|
@ -65,7 +65,7 @@ public class HostAdministrationApiLiveTest extends BaseNovaApiLiveTest {
|
|||
public void testListAndGet() throws Exception {
|
||||
if (optApi.isPresent()) {
|
||||
HostAdministrationApi api = optApi.get();
|
||||
Set<? extends Host> hosts = api.list().toImmutableSet();
|
||||
Set<? extends Host> hosts = api.list().toSet();
|
||||
assertNotNull(hosts);
|
||||
for (Host host : hosts) {
|
||||
for (HostResourceUsage usage : api.listResourceUsage(host.getName())) {
|
||||
|
|
|
@ -78,7 +78,7 @@ public class HostAggregateApiLiveTest extends BaseNovaApiLiveTest {
|
|||
public void testListAndGetAggregate() {
|
||||
if (apiOption.isPresent()) {
|
||||
HostAggregateApi api = apiOption.get();
|
||||
Set<? extends HostAggregate> aggregates = api.list().toImmutableSet();
|
||||
Set<? extends HostAggregate> aggregates = api.list().toSet();
|
||||
for (HostAggregate aggregate : aggregates) {
|
||||
assertNotNull(aggregate.getId());
|
||||
assertNotNull(aggregate.getName());
|
||||
|
|
|
@ -44,7 +44,7 @@ public class SecurityGroupApiLiveTest extends BaseNovaApiLiveTest {
|
|||
public void list() throws Exception {
|
||||
for (String zoneId : novaContext.getApi().getConfiguredZones()) {
|
||||
SecurityGroupApi api = novaContext.getApi().getSecurityGroupExtensionForZone(zoneId).get();
|
||||
Set<? extends SecurityGroup> securityGroupsList = api.list().toImmutableSet();
|
||||
Set<? extends SecurityGroup> securityGroupsList = api.list().toSet();
|
||||
assertNotNull(securityGroupsList);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ public class SimpleTenantUsageApiExpectTest extends BaseNovaApiExpectTest {
|
|||
.payload(payloadFromResource("/simple_tenant_usages.json")).build())
|
||||
.getSimpleTenantUsageExtensionForZone("az-1.region-a.geo-1").get();
|
||||
|
||||
Set<? extends SimpleTenantUsage> results = api.list().toImmutableSet();
|
||||
Set<? extends SimpleTenantUsage> results = api.list().toSet();
|
||||
|
||||
SimpleTenantUsage usage = Iterables.getOnlyElement(results);
|
||||
assertEquals(usage.getTenantId(), "f8535069c3fb404cb61c873b1a0b4921");
|
||||
|
|
|
@ -41,7 +41,7 @@ public class SimpleTenantUsageApiLiveTest extends BaseNovaApiLiveTest {
|
|||
Optional<? extends SimpleTenantUsageApi> optApi = novaContext.getApi().getSimpleTenantUsageExtensionForZone(zoneId);
|
||||
if (optApi.isPresent() && identity.endsWith(":admin")) {
|
||||
SimpleTenantUsageApi api = optApi.get();
|
||||
Set<? extends SimpleTenantUsage> usages = api.list().toImmutableSet();
|
||||
Set<? extends SimpleTenantUsage> usages = api.list().toSet();
|
||||
assertNotNull(usages);
|
||||
for (SimpleTenantUsage usage : usages) {
|
||||
SimpleTenantUsage details = api.get(usage.getTenantId());
|
||||
|
|
|
@ -55,7 +55,7 @@ public class VirtualInterfaceApiLiveTest extends BaseNovaApiLiveTest {
|
|||
Server testServer = null;
|
||||
try {
|
||||
testServer = createServerInZone(zone);
|
||||
Set<? extends VirtualInterface> results = apiOption.get().listOnServer(testServer.getId()).toImmutableSet();
|
||||
Set<? extends VirtualInterface> results = apiOption.get().listOnServer(testServer.getId()).toSet();
|
||||
for (VirtualInterface vif : results) {
|
||||
assertNotNull(vif.getId());
|
||||
assertNotNull(vif.getMacAddress());
|
||||
|
|
|
@ -62,7 +62,7 @@ public class VolumeApiExpectTest extends BaseNovaApiExpectTest {
|
|||
HttpResponse.builder().statusCode(200).payload(payloadFromResource("/volume_list.json")).build()
|
||||
).getVolumeExtensionForZone("az-1.region-a.geo-1").get();
|
||||
|
||||
Set<? extends Volume> volumes = api.list().toImmutableSet();
|
||||
Set<? extends Volume> volumes = api.list().toSet();
|
||||
assertEquals(volumes, ImmutableSet.of(testVolume()));
|
||||
}
|
||||
|
||||
|
@ -75,7 +75,7 @@ public class VolumeApiExpectTest extends BaseNovaApiExpectTest {
|
|||
HttpResponse.builder().statusCode(404).build()
|
||||
).getVolumeExtensionForZone("az-1.region-a.geo-1").get();
|
||||
|
||||
Set<? extends Volume> volumes = api.list().toImmutableSet();
|
||||
Set<? extends Volume> volumes = api.list().toSet();
|
||||
assertTrue(volumes.isEmpty());
|
||||
}
|
||||
|
||||
|
@ -88,7 +88,7 @@ public class VolumeApiExpectTest extends BaseNovaApiExpectTest {
|
|||
HttpResponse.builder().statusCode(200).payload(payloadFromResource("/volume_list_detail.json")).build()
|
||||
).getVolumeExtensionForZone("az-1.region-a.geo-1").get();
|
||||
|
||||
Set<? extends Volume> volumes = api.listInDetail().toImmutableSet();
|
||||
Set<? extends Volume> volumes = api.listInDetail().toSet();
|
||||
assertEquals(volumes, ImmutableSet.of(testVolume()));
|
||||
}
|
||||
|
||||
|
@ -101,7 +101,7 @@ public class VolumeApiExpectTest extends BaseNovaApiExpectTest {
|
|||
HttpResponse.builder().statusCode(404).build()
|
||||
).getVolumeExtensionForZone("az-1.region-a.geo-1").get();
|
||||
|
||||
Set<? extends Volume> volumes = api.listInDetail().toImmutableSet();
|
||||
Set<? extends Volume> volumes = api.listInDetail().toSet();
|
||||
assertTrue(volumes.isEmpty());
|
||||
}
|
||||
|
||||
|
@ -203,7 +203,7 @@ public class VolumeApiExpectTest extends BaseNovaApiExpectTest {
|
|||
HttpResponse.builder().statusCode(200).payload(payloadFromResource("/attachment_list.json")).build()
|
||||
).getVolumeExtensionForZone("az-1.region-a.geo-1").get();
|
||||
|
||||
Set<? extends VolumeAttachment> attachments = api.listAttachmentsOnServer("instance-1").toImmutableSet();
|
||||
Set<? extends VolumeAttachment> attachments = api.listAttachmentsOnServer("instance-1").toSet();
|
||||
assertEquals(attachments, ImmutableSet.of(testAttachment()));
|
||||
// double-check individual fields
|
||||
VolumeAttachment attachment = Iterables.getOnlyElement(attachments);
|
||||
|
@ -312,7 +312,7 @@ public class VolumeApiExpectTest extends BaseNovaApiExpectTest {
|
|||
HttpResponse.builder().statusCode(200).payload(payloadFromResource("/snapshot_list.json")).build()
|
||||
).getVolumeExtensionForZone("az-1.region-a.geo-1").get();
|
||||
|
||||
Set<? extends VolumeSnapshot> snapshots = api.listSnapshots().toImmutableSet();
|
||||
Set<? extends VolumeSnapshot> snapshots = api.listSnapshots().toSet();
|
||||
assertEquals(snapshots, ImmutableSet.of(testSnapshot()));
|
||||
}
|
||||
|
||||
|
@ -325,7 +325,7 @@ public class VolumeApiExpectTest extends BaseNovaApiExpectTest {
|
|||
HttpResponse.builder().statusCode(404).build()
|
||||
).getVolumeExtensionForZone("az-1.region-a.geo-1").get();
|
||||
|
||||
Set<? extends VolumeSnapshot> snapshots = api.listSnapshots().toImmutableSet();
|
||||
Set<? extends VolumeSnapshot> snapshots = api.listSnapshots().toSet();
|
||||
assertTrue(snapshots.isEmpty());
|
||||
}
|
||||
|
||||
|
@ -363,7 +363,7 @@ public class VolumeApiExpectTest extends BaseNovaApiExpectTest {
|
|||
HttpResponse.builder().statusCode(200).payload(payloadFromResource("/snapshot_list_detail.json")).build()
|
||||
).getVolumeExtensionForZone("az-1.region-a.geo-1").get();
|
||||
|
||||
Set<? extends VolumeSnapshot> snapshots = api.listSnapshotsInDetail().toImmutableSet();
|
||||
Set<? extends VolumeSnapshot> snapshots = api.listSnapshotsInDetail().toSet();
|
||||
assertEquals(snapshots, ImmutableSet.of(testSnapshot()));
|
||||
|
||||
// double-check individual fields
|
||||
|
@ -385,7 +385,7 @@ public class VolumeApiExpectTest extends BaseNovaApiExpectTest {
|
|||
HttpResponse.builder().statusCode(404).build()
|
||||
).getVolumeExtensionForZone("az-1.region-a.geo-1").get();
|
||||
|
||||
Set<? extends VolumeSnapshot> snapshots = api.listSnapshotsInDetail().toImmutableSet();
|
||||
Set<? extends VolumeSnapshot> snapshots = api.listSnapshotsInDetail().toSet();
|
||||
assertTrue(snapshots.isEmpty());
|
||||
}
|
||||
|
||||
|
|
|
@ -108,7 +108,7 @@ public class VolumeApiLiveTest extends BaseNovaApiLiveTest {
|
|||
@Test(dependsOnMethods = "testCreateVolume")
|
||||
public void testListVolumes() {
|
||||
if (volumeOption.isPresent()) {
|
||||
Set<? extends Volume> volumes = volumeOption.get().list().toImmutableSet();
|
||||
Set<? extends Volume> volumes = volumeOption.get().list().toSet();
|
||||
assertNotNull(volumes);
|
||||
boolean foundIt = false;
|
||||
for (Volume vol : volumes) {
|
||||
|
@ -125,7 +125,7 @@ public class VolumeApiLiveTest extends BaseNovaApiLiveTest {
|
|||
@Test(dependsOnMethods = "testCreateVolume")
|
||||
public void testListVolumesInDetail() {
|
||||
if (volumeOption.isPresent()) {
|
||||
Set<? extends Volume> volumes = volumeOption.get().listInDetail().toImmutableSet();
|
||||
Set<? extends Volume> volumes = volumeOption.get().listInDetail().toSet();
|
||||
assertNotNull(volumes);
|
||||
boolean foundIt = false;
|
||||
for (Volume vol : volumes) {
|
||||
|
@ -174,7 +174,7 @@ public class VolumeApiLiveTest extends BaseNovaApiLiveTest {
|
|||
@Test(dependsOnMethods = "testCreateSnapshot")
|
||||
public void testListSnapshots() {
|
||||
if (volumeOption.isPresent()) {
|
||||
Set<? extends VolumeSnapshot> snapshots = volumeOption.get().listSnapshots().toImmutableSet();
|
||||
Set<? extends VolumeSnapshot> snapshots = volumeOption.get().listSnapshots().toSet();
|
||||
assertNotNull(snapshots);
|
||||
boolean foundIt = false;
|
||||
for (VolumeSnapshot snap : snapshots) {
|
||||
|
@ -193,7 +193,7 @@ public class VolumeApiLiveTest extends BaseNovaApiLiveTest {
|
|||
@Test(dependsOnMethods = "testCreateSnapshot")
|
||||
public void testListSnapshotsInDetail() {
|
||||
if (volumeOption.isPresent()) {
|
||||
Set<? extends VolumeSnapshot> snapshots = volumeOption.get().listSnapshotsInDetail().toImmutableSet();
|
||||
Set<? extends VolumeSnapshot> snapshots = volumeOption.get().listSnapshotsInDetail().toSet();
|
||||
assertNotNull(snapshots);
|
||||
boolean foundIt = false;
|
||||
for (VolumeSnapshot snap : snapshots) {
|
||||
|
@ -225,7 +225,7 @@ public class VolumeApiLiveTest extends BaseNovaApiLiveTest {
|
|||
try {
|
||||
final String serverId = server_id = createServerInZone(zone).getId();
|
||||
|
||||
Set<? extends VolumeAttachment> attachments = volumeOption.get().listAttachmentsOnServer(serverId).toImmutableSet();
|
||||
Set<? extends VolumeAttachment> attachments = volumeOption.get().listAttachmentsOnServer(serverId).toSet();
|
||||
assertNotNull(attachments);
|
||||
final int before = attachments.size();
|
||||
|
||||
|
@ -241,7 +241,7 @@ public class VolumeApiLiveTest extends BaseNovaApiLiveTest {
|
|||
}
|
||||
}, 60 * 1000L).apply(volumeOption.get()));
|
||||
|
||||
attachments = volumeOption.get().listAttachmentsOnServer(serverId).toImmutableSet();
|
||||
attachments = volumeOption.get().listAttachmentsOnServer(serverId).toSet();
|
||||
assertNotNull(attachments);
|
||||
assertEquals(attachments.size(), before + 1);
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ public class VolumeAttachmentApiExpectTest extends BaseNovaApiExpectTest {
|
|||
HttpResponse.builder().statusCode(200).payload(payloadFromResource("/attachment_list.json")).build()
|
||||
).getVolumeAttachmentExtensionForZone("az-1.region-a.geo-1").get();
|
||||
|
||||
Set<? extends VolumeAttachment> attachments = api.listAttachmentsOnServer("instance-1").toImmutableSet();
|
||||
Set<? extends VolumeAttachment> attachments = api.listAttachmentsOnServer("instance-1").toSet();
|
||||
assertEquals(attachments, ImmutableSet.of(testAttachment()));
|
||||
// double-check individual fields
|
||||
VolumeAttachment attachment = Iterables.getOnlyElement(attachments);
|
||||
|
|
|
@ -105,7 +105,7 @@ public class VolumeAttachmentApiLiveTest extends BaseNovaApiLiveTest {
|
|||
final String serverId = server_id = createServerInZone(zone).getId();
|
||||
|
||||
Set<? extends VolumeAttachment> attachments =
|
||||
volumeAttachmentApi.get().listAttachmentsOnServer(serverId).toImmutableSet();
|
||||
volumeAttachmentApi.get().listAttachmentsOnServer(serverId).toSet();
|
||||
assertNotNull(attachments);
|
||||
final int before = attachments.size();
|
||||
|
||||
|
@ -121,7 +121,7 @@ public class VolumeAttachmentApiLiveTest extends BaseNovaApiLiveTest {
|
|||
}
|
||||
}, 60 * 1000L).apply(volumeAttachmentApi.get()));
|
||||
|
||||
attachments = volumeAttachmentApi.get().listAttachmentsOnServer(serverId).toImmutableSet();
|
||||
attachments = volumeAttachmentApi.get().listAttachmentsOnServer(serverId).toSet();
|
||||
assertNotNull(attachments);
|
||||
assertEquals(attachments.size(), before + 1);
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ public class VolumeTypeApiExpectTest extends BaseNovaApiExpectTest {
|
|||
HttpResponse.builder().statusCode(200).payload(payloadFromResource("/volume_type_list.json")).build()
|
||||
).getVolumeTypeExtensionForZone("az-1.region-a.geo-1").get();
|
||||
|
||||
Set<? extends VolumeType> types = api.list().toImmutableSet();
|
||||
Set<? extends VolumeType> types = api.list().toSet();
|
||||
assertEquals(types, ImmutableSet.of(testVolumeType()));
|
||||
}
|
||||
|
||||
|
|
|
@ -97,7 +97,7 @@ public class VolumeTypeApiLiveTest extends BaseNovaApiLiveTest {
|
|||
@Test(dependsOnMethods = "testCreateVolumeType")
|
||||
public void testListVolumeTypes() {
|
||||
if (volumeTypeOption.isPresent()) {
|
||||
Set<? extends VolumeType> volumeTypes = volumeTypeOption.get().list().toImmutableSet();
|
||||
Set<? extends VolumeType> volumeTypes = volumeTypeOption.get().list().toSet();
|
||||
assertNotNull(volumeTypes);
|
||||
boolean foundIt = false;
|
||||
for (VolumeType vt : volumeTypes) {
|
||||
|
|
|
@ -47,7 +47,7 @@ public class FlavorApiLiveTest extends BaseNovaApiLiveTest {
|
|||
public void testListFlavors() throws Exception {
|
||||
for (String zoneId : zones) {
|
||||
FlavorApi api = novaContext.getApi().getFlavorApiForZone(zoneId);
|
||||
Set<? extends Resource> response = api.list().concat().toImmutableSet();
|
||||
Set<? extends Resource> response = api.list().concat().toSet();
|
||||
assertNotNull(response);
|
||||
assertFalse(response.isEmpty());
|
||||
for (Resource flavor : response) {
|
||||
|
@ -67,7 +67,7 @@ public class FlavorApiLiveTest extends BaseNovaApiLiveTest {
|
|||
public void testListFlavorsInDetail() throws Exception {
|
||||
for (String zoneId : zones) {
|
||||
FlavorApi api = novaContext.getApi().getFlavorApiForZone(zoneId);
|
||||
Set<? extends Flavor> response = api.listInDetail().concat().toImmutableSet();
|
||||
Set<? extends Flavor> response = api.listInDetail().concat().toSet();
|
||||
assertNotNull(response);
|
||||
assertFalse(response.isEmpty());
|
||||
for (Flavor flavor : response) {
|
||||
|
@ -90,7 +90,7 @@ public class FlavorApiLiveTest extends BaseNovaApiLiveTest {
|
|||
public void testGetFlavorById() throws Exception {
|
||||
for (String zoneId : zones) {
|
||||
FlavorApi api = novaContext.getApi().getFlavorApiForZone(zoneId);
|
||||
Set<? extends Flavor> response = api.listInDetail().concat().toImmutableSet();
|
||||
Set<? extends Flavor> response = api.listInDetail().concat().toSet();
|
||||
for (Flavor flavor : response) {
|
||||
Flavor details = api.get(flavor.getId());
|
||||
assertNotNull(details);
|
||||
|
|
|
@ -42,7 +42,7 @@ public class ImageApiLiveTest extends BaseNovaApiLiveTest {
|
|||
public void testListImages() throws Exception {
|
||||
for (String zoneId : zones) {
|
||||
ImageApi api = novaContext.getApi().getImageApiForZone(zoneId);
|
||||
Set<? extends Resource> response = api.list().concat().toImmutableSet();
|
||||
Set<? extends Resource> response = api.list().concat().toSet();
|
||||
assertNotNull(response);
|
||||
assertFalse(response.isEmpty());
|
||||
for (Resource image : response) {
|
||||
|
@ -57,7 +57,7 @@ public class ImageApiLiveTest extends BaseNovaApiLiveTest {
|
|||
public void testListImagesInDetail() throws Exception {
|
||||
for (String zoneId : novaContext.getApi().getConfiguredZones()) {
|
||||
ImageApi api = novaContext.getApi().getImageApiForZone(zoneId);
|
||||
Set<? extends Image> response = api.listInDetail().concat().toImmutableSet();
|
||||
Set<? extends Image> response = api.listInDetail().concat().toSet();
|
||||
assertNotNull(response);
|
||||
assertFalse(response.isEmpty());
|
||||
for (Image image : response) {
|
||||
|
@ -81,7 +81,7 @@ public class ImageApiLiveTest extends BaseNovaApiLiveTest {
|
|||
public void testGetImageById() throws Exception {
|
||||
for (String zoneId : novaContext.getApi().getConfiguredZones()) {
|
||||
ImageApi api = novaContext.getApi().getImageApiForZone(zoneId);
|
||||
Set<? extends Image> response = api.listInDetail().concat().toImmutableSet();
|
||||
Set<? extends Image> response = api.listInDetail().concat().toSet();
|
||||
for (Image image : response) {
|
||||
Image details = api.get(image.getId());
|
||||
assertNotNull(details);
|
||||
|
|
|
@ -54,7 +54,7 @@ public class LoadBalancerApiExpectTest extends BaseCloudLoadBalancerApiExpectTes
|
|||
HttpResponse.builder().statusCode(200).payload(payloadFromResource("/loadbalancers-list.json")).build()
|
||||
).getLoadBalancerApiForZone("DFW");
|
||||
|
||||
Set<LoadBalancer> loadBalancers = api.list().concat().toImmutableSet();
|
||||
Set<LoadBalancer> loadBalancers = api.list().concat().toSet();
|
||||
assertEquals(loadBalancers, testLoadBalancers());
|
||||
}
|
||||
|
||||
|
|
|
@ -106,7 +106,7 @@ public class LoadBalancerApiLiveTest extends BaseCloudLoadBalancersApiLiveTest {
|
|||
public void testListLoadBalancers() throws Exception {
|
||||
for (String zone: clbApi.getConfiguredZones()) {
|
||||
|
||||
Set<LoadBalancer> response = clbApi.getLoadBalancerApiForZone(zone).list().concat().toImmutableSet();
|
||||
Set<LoadBalancer> response = clbApi.getLoadBalancerApiForZone(zone).list().concat().toSet();
|
||||
|
||||
assertNotNull(response);
|
||||
assertTrue(response.size() >= 0);
|
||||
|
|
|
@ -51,7 +51,7 @@ public class NodeApiExpectTest extends BaseCloudLoadBalancerApiExpectTest<CloudL
|
|||
HttpResponse.builder().statusCode(200).payload(payloadFromResource("/nodes-list.json")).build()
|
||||
).getNodeApiForZoneAndLoadBalancer("DFW", 2000);
|
||||
|
||||
Set<Node> nodes = api.list().concat().toImmutableSet();
|
||||
Set<Node> nodes = api.list().concat().toSet();
|
||||
assertEquals(nodes, testNodes());
|
||||
}
|
||||
|
||||
|
|
|
@ -105,7 +105,7 @@ public class NodeApiLiveTest extends BaseCloudLoadBalancersApiLiveTest {
|
|||
@Test(dependsOnMethods = "testModifyNode")
|
||||
public void testListNodes() throws Exception {
|
||||
for (LoadBalancer lb : nodes.keySet()) {
|
||||
Set<Node> response = clbApi.getNodeApiForZoneAndLoadBalancer(lb.getRegion(), lb.getId()).list().concat().toImmutableSet();
|
||||
Set<Node> response = clbApi.getNodeApiForZoneAndLoadBalancer(lb.getRegion(), lb.getId()).list().concat().toSet();
|
||||
assert null != response;
|
||||
assertTrue(response.size() >= 0);
|
||||
for (Node n : response) {
|
||||
|
|
|
@ -111,7 +111,7 @@ public class BulkMessageApiLiveTest extends BaseSQSApiLiveTest {
|
|||
}
|
||||
|
||||
protected Set<Message> collectMessages(MessageApi api) {
|
||||
return SQS.receiveAllAtRate(api, idPayload.size(), attribute("None").visibilityTimeout(5)).toImmutableSet();
|
||||
return SQS.receiveAllAtRate(api, idPayload.size(), attribute("None").visibilityTimeout(5)).toSet();
|
||||
}
|
||||
|
||||
@Test(dependsOnMethods = "testChangeMessageVisibility")
|
||||
|
|
|
@ -86,7 +86,7 @@ public class ConcurrentOpenSocketFinder implements OpenSocketFinder {
|
|||
public HostAndPort apply(String from) {
|
||||
return HostAndPort.fromParts(from, port);
|
||||
}
|
||||
}).toImmutableSet();
|
||||
}).toSet();
|
||||
|
||||
// Specify a retry period of 1s, expressed in the same time units.
|
||||
long period = timeUnits.convert(1, TimeUnit.SECONDS);
|
||||
|
|
|
@ -49,7 +49,7 @@ public class TransformingSetSupplier<F, T> implements Supplier<Set<? extends T>>
|
|||
.filter(notNull())
|
||||
.transform(converter)
|
||||
.filter(notNull())
|
||||
.toImmutableSet();
|
||||
.toSet();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -58,7 +58,7 @@ public final class Bundles {
|
|||
.filter(Predicates.notNull())
|
||||
.transform(instantiateIfPossible(type))
|
||||
.filter(Predicates.notNull())
|
||||
.toImmutableSet();
|
||||
.toSet();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -70,7 +70,7 @@ public class AdvanceUntilEmptyIterableTest {
|
|||
|
||||
AdvanceUntilEmptyIterable<String> iterable = new AdvanceUntilEmptyIterable<String>(nextIterable);
|
||||
|
||||
Assert.assertEquals(iterable.concat().toImmutableSet(),
|
||||
Assert.assertEquals(iterable.concat().toSet(),
|
||||
ImmutableSet.of("foo", "bar", "boo", "baz", "ham", "cheeze"));
|
||||
|
||||
EasyMock.verify(nextIterable);
|
||||
|
|
|
@ -18,7 +18,7 @@ public class IterableWithMarkersTest {
|
|||
public void testElementsEqual() {
|
||||
|
||||
IterableWithMarker<String> initial = IterableWithMarkers.from(ImmutableSet.of("foo", "bar"));
|
||||
Assert.assertEquals(initial.toImmutableSet(), ImmutableSet.of("foo", "bar"));
|
||||
Assert.assertEquals(initial.toSet(), ImmutableSet.of("foo", "bar"));
|
||||
Assert.assertEquals(initial.nextMarker(), Optional.absent());
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,7 @@ public class IterableWithMarkersTest {
|
|||
public void testMarkerEqual() {
|
||||
|
||||
IterableWithMarker<String> initial = IterableWithMarkers.from(ImmutableSet.of("foo", "bar"), "MARKER");
|
||||
Assert.assertEquals(initial.toImmutableSet(), ImmutableSet.of("foo", "bar"));
|
||||
Assert.assertEquals(initial.toSet(), ImmutableSet.of("foo", "bar"));
|
||||
Assert.assertEquals(initial.nextMarker(), Optional.of("MARKER"));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -68,7 +68,7 @@ public class PagedIterablesTest {
|
|||
|
||||
PagedIterable<String> iterable = PagedIterables.advance(initial, markerToNext);
|
||||
|
||||
Assert.assertEquals(iterable.concat().toImmutableSet(),
|
||||
Assert.assertEquals(iterable.concat().toSet(),
|
||||
ImmutableSet.of("foo", "bar", "boo", "baz", "ham", "cheeze"));
|
||||
|
||||
EasyMock.verify(markerToNext);
|
||||
|
|
|
@ -144,7 +144,7 @@ public class LoadBalancerApiExpectTest extends BaseELBApiExpectTest {
|
|||
LoadBalancer lb1 = new GetLoadBalancerResponseTest().expected().toBuilder().name("my-load-balancer-1").build();
|
||||
LoadBalancer lb2 = new GetLoadBalancerResponseTest().expected();
|
||||
|
||||
assertEquals(apiWhenExist.getLoadBalancerApi().list().concat().toImmutableSet(), ImmutableSet.of(lb1, lb2));
|
||||
assertEquals(apiWhenExist.getLoadBalancerApi().list().concat().toSet(), ImmutableSet.of(lb1, lb2));
|
||||
}
|
||||
|
||||
public void testList2PagesWhenResponseIs2xxInEU() throws Exception {
|
||||
|
@ -203,7 +203,7 @@ public class LoadBalancerApiExpectTest extends BaseELBApiExpectTest {
|
|||
ELBApi apiWhenDontExist = requestSendsResponse(
|
||||
list, listResponse);
|
||||
|
||||
assertEquals(apiWhenDontExist.getLoadBalancerApi().list().get(0).toImmutableSet(), ImmutableSet.of());
|
||||
assertEquals(apiWhenDontExist.getLoadBalancerApi().list().get(0).toSet(), ImmutableSet.of());
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -149,7 +149,7 @@ public class UserApiExpectTest extends BaseIAMApiExpectTest {
|
|||
|
||||
IAMApi apiWhenExist = requestsSendResponses(list, listResponse, list2, list2Response);
|
||||
|
||||
assertEquals(apiWhenExist.getUserApi().list().concat().toImmutableList(),
|
||||
assertEquals(apiWhenExist.getUserApi().list().concat().toList(),
|
||||
ImmutableList.copyOf(Iterables.concat(new ListUsersResponseTest().expected(), new ListUsersResponseTest().expected())));
|
||||
}
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ public class ImageApiLiveTest extends BaseGlanceApiLiveTest {
|
|||
public void testList() throws Exception {
|
||||
for (String zoneId : glanceContext.getApi().getConfiguredZones()) {
|
||||
ImageApi api = glanceContext.getApi().getImageApiForZone(zoneId);
|
||||
Set<? extends Image> response = api.list().concat().toImmutableSet();
|
||||
Set<? extends Image> response = api.list().concat().toSet();
|
||||
assert null != response;
|
||||
for (Image image : response) {
|
||||
checkImage(image);
|
||||
|
@ -67,7 +67,7 @@ public class ImageApiLiveTest extends BaseGlanceApiLiveTest {
|
|||
public void testListInDetail() throws Exception {
|
||||
for (String zoneId : glanceContext.getApi().getConfiguredZones()) {
|
||||
ImageApi api = glanceContext.getApi().getImageApiForZone(zoneId);
|
||||
Set<? extends ImageDetails> response = api.listInDetail().concat().toImmutableSet();
|
||||
Set<? extends ImageDetails> response = api.listInDetail().concat().toSet();
|
||||
assert null != response;
|
||||
for (ImageDetails image : response) {
|
||||
checkImage(image);
|
||||
|
|
|
@ -55,7 +55,7 @@ public class NetworkApiExpectTest extends BaseQuantumApiExpectTest {
|
|||
HttpResponse.builder().statusCode(200).payload(payloadFromResourceWithContentType("/list_network_refs.json", APPLICATION_JSON)).build())
|
||||
.getNetworkApiForZone("region-a.geo-1");
|
||||
|
||||
Set<? extends Reference> nets = api.listReferences().toImmutableSet();
|
||||
Set<? extends Reference> nets = api.listReferences().toSet();
|
||||
assertEquals(nets, listOfNetworkRefs());
|
||||
}
|
||||
|
||||
|
@ -76,7 +76,7 @@ public class NetworkApiExpectTest extends BaseQuantumApiExpectTest {
|
|||
HttpResponse.builder().statusCode(200).payload(payloadFromResourceWithContentType("/list_networks.json", APPLICATION_JSON)).build())
|
||||
.getNetworkApiForZone("region-a.geo-1");
|
||||
|
||||
Set<? extends Network> nets = api.list().toImmutableSet();
|
||||
Set<? extends Network> nets = api.list().toSet();
|
||||
assertEquals(nets, listOfNetworks());
|
||||
}
|
||||
|
||||
|
|
|
@ -42,8 +42,8 @@ public class NetworkApiLiveTest extends BaseQuantumApiLiveTest {
|
|||
|
||||
public void testListNetworks() {
|
||||
for (String zoneId : quantumContext.getApi().getConfiguredZones()) {
|
||||
Set<? extends Reference> ids = quantumContext.getApi().getNetworkApiForZone(zoneId).listReferences().toImmutableSet();
|
||||
Set<? extends Network> networks = quantumContext.getApi().getNetworkApiForZone(zoneId).list().toImmutableSet();
|
||||
Set<? extends Reference> ids = quantumContext.getApi().getNetworkApiForZone(zoneId).listReferences().toSet();
|
||||
Set<? extends Network> networks = quantumContext.getApi().getNetworkApiForZone(zoneId).list().toSet();
|
||||
assertNotNull(ids);
|
||||
assertEquals(ids.size(), networks.size());
|
||||
for (Network network : networks) {
|
||||
|
|
|
@ -56,7 +56,7 @@ public class PortApiExpectTest extends BaseQuantumApiExpectTest {
|
|||
HttpResponse.builder().statusCode(200).payload(payloadFromStringWithContentType("{\"ports\": [{\"id\": \"a6058a59-fa8c-46cc-bac8-08904e6ff0a5\"}]}", APPLICATION_JSON)).build())
|
||||
.getPortApiForZoneAndNetwork("region-a.geo-1", "1a104cf5-cb18-4d35-9407-2fd2646d9d0b");
|
||||
|
||||
Set<? extends Reference> nets = api.listReferences().toImmutableSet();
|
||||
Set<? extends Reference> nets = api.listReferences().toSet();
|
||||
assertEquals(nets, ImmutableSet.of(Reference.builder().id("a6058a59-fa8c-46cc-bac8-08904e6ff0a5").build()));
|
||||
}
|
||||
|
||||
|
@ -77,7 +77,7 @@ public class PortApiExpectTest extends BaseQuantumApiExpectTest {
|
|||
HttpResponse.builder().statusCode(200).payload(payloadFromStringWithContentType("{\"ports\": [{\"state\": \"DOWN\", \"id\": \"814ae4bb-33d9-425f-8ee2-13a5c90b1465\"}]}", APPLICATION_JSON)).build())
|
||||
.getPortApiForZoneAndNetwork("region-a.geo-1", "1a104cf5-cb18-4d35-9407-2fd2646d9d0b");
|
||||
|
||||
Set<? extends Port> nets = api.list().toImmutableSet();
|
||||
Set<? extends Port> nets = api.list().toSet();
|
||||
assertEquals(nets, ImmutableSet.of(Port.builder().state(Port.State.DOWN).id("814ae4bb-33d9-425f-8ee2-13a5c90b1465").build()));
|
||||
}
|
||||
|
||||
|
|
|
@ -46,11 +46,11 @@ public class PortApiLiveTest extends BaseQuantumApiLiveTest {
|
|||
public void testListPorts() {
|
||||
for (String zoneId : quantumContext.getApi().getConfiguredZones()) {
|
||||
NetworkApi netApi = quantumContext.getApi().getNetworkApiForZone(zoneId);
|
||||
Set<? extends Reference> nets = netApi.listReferences().toImmutableSet();
|
||||
Set<? extends Reference> nets = netApi.listReferences().toSet();
|
||||
for(Reference net : nets) {
|
||||
PortApi portApi = quantumContext.getApi().getPortApiForZoneAndNetwork(zoneId, net.getId());
|
||||
Set<? extends Reference> portRefs = portApi.listReferences().toImmutableSet();
|
||||
Set<? extends Port> ports = portApi.list().toImmutableSet();
|
||||
Set<? extends Reference> portRefs = portApi.listReferences().toSet();
|
||||
Set<? extends Port> ports = portApi.list().toSet();
|
||||
|
||||
assertEquals(portRefs.size(), ports.size());
|
||||
for (Port port : ports) {
|
||||
|
|
|
@ -68,7 +68,7 @@ public class ContainerApiExpectTest extends BaseSwiftApiExpectTest {
|
|||
SwiftApi apiWhenNoContainersExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
|
||||
responseWithKeystoneAccess, list, listResponse);
|
||||
|
||||
assertEquals(apiWhenNoContainersExist.getContainerApiForRegion("region-a.geo-1").list().toImmutableSet(),
|
||||
assertEquals(apiWhenNoContainersExist.getContainerApiForRegion("region-a.geo-1").list().toSet(),
|
||||
ImmutableSet.of());
|
||||
|
||||
}
|
||||
|
|
|
@ -141,7 +141,7 @@ public class InstanceApiExpectTest extends BaseRDSApiExpectTest {
|
|||
RDSApi apiWhenExist = requestsSendResponses(
|
||||
list, listResponse, list2, list2Response);
|
||||
|
||||
assertEquals(apiWhenExist.getInstanceApi().list().concat().toImmutableList(),
|
||||
assertEquals(apiWhenExist.getInstanceApi().list().concat().toList(),
|
||||
ImmutableList.copyOf(Iterables.concat(new DescribeDBInstancesResponseTest().expected(),
|
||||
new DescribeDBInstancesResponseTest().expected())));
|
||||
}
|
||||
|
|
|
@ -195,7 +195,7 @@ public class SecurityGroupApiExpectTest extends BaseRDSApiExpectTest {
|
|||
RDSApi apiWhenExist = requestsSendResponses(
|
||||
list, listResponse, list2, list2Response);
|
||||
|
||||
assertEquals(apiWhenExist.getSecurityGroupApi().list().concat().toImmutableList(),
|
||||
assertEquals(apiWhenExist.getSecurityGroupApi().list().concat().toList(),
|
||||
ImmutableList.copyOf(Iterables.concat(new DescribeDBSecurityGroupsResponseTest().expected(),
|
||||
new DescribeDBSecurityGroupsResponseTest().expected())));
|
||||
}
|
||||
|
|
|
@ -141,7 +141,7 @@ public class SubnetGroupApiExpectTest extends BaseRDSApiExpectTest {
|
|||
RDSApi apiWhenExist = requestsSendResponses(
|
||||
list, listResponse, list2, list2Response);
|
||||
|
||||
assertEquals(apiWhenExist.getSubnetGroupApi().list().concat().toImmutableList(),
|
||||
assertEquals(apiWhenExist.getSubnetGroupApi().list().concat().toList(),
|
||||
ImmutableList.copyOf(Iterables.concat(new DescribeDBSubnetGroupsResponseTest().expected(),
|
||||
new DescribeDBSubnetGroupsResponseTest().expected())));
|
||||
}
|
||||
|
|
|
@ -206,7 +206,7 @@ public class GleSYSComputeServiceAdapter implements ComputeServiceAdapter<Server
|
|||
|
||||
@Override
|
||||
public Set<OSTemplate> listImages() {
|
||||
return api.getServerApi().listTemplates().toImmutableSet();
|
||||
return api.getServerApi().listTemplates().toSet();
|
||||
}
|
||||
|
||||
// cheat until we have a getTemplate command
|
||||
|
|
|
@ -55,7 +55,7 @@ public class ArchiveApiExpectTest extends BaseGleSYSApiExpectTest {
|
|||
Set<Archive> expected = ImmutableSet.of(
|
||||
Archive.builder().username("xxxxx_test1").freeSize("20 GB").totalSize("30 GB").locked(false).build());
|
||||
|
||||
assertEquals(api.list().toImmutableSet(), expected);
|
||||
assertEquals(api.list().toSet(), expected);
|
||||
}
|
||||
|
||||
public void testListArchivesWhenResponseIs4xxReturnsEmpty() {
|
||||
|
|
|
@ -69,7 +69,7 @@ public class EmailAccountApiExpectTest extends BaseGleSYSApiExpectTest {
|
|||
.modified(dateService.iso8601SecondsDateParse("2012-06-24T11:53:48+02:00")).build()
|
||||
);
|
||||
|
||||
Set<EmailAccount> actual = api.listDomain("cl13016.test.jclouds.org").toImmutableSet();
|
||||
Set<EmailAccount> actual = api.listDomain("cl13016.test.jclouds.org").toSet();
|
||||
assertEquals(actual, expected);
|
||||
assertEquals(Iterables.get(actual, 0).toString(), Iterables.get(expected, 0).toString());
|
||||
}
|
||||
|
|
|
@ -158,7 +158,7 @@ public class IpApiExpectTest extends BaseGleSYSApiExpectTest {
|
|||
HttpResponse.builder().statusCode(200).payload(payloadFromResource("/ip_list_free.json")).build())
|
||||
.getIpApi();
|
||||
|
||||
assertEquals(api.listFree(4, "Falkenberg", "OpenVZ").toImmutableSet(), ParseIpAddressFromResponseTest.EXPECTED_IPS);
|
||||
assertEquals(api.listFree(4, "Falkenberg", "OpenVZ").toSet(), ParseIpAddressFromResponseTest.EXPECTED_IPS);
|
||||
}
|
||||
|
||||
public void testListFreeWhenResponseIs404ReturnsEmptySet() {
|
||||
|
@ -169,7 +169,7 @@ public class IpApiExpectTest extends BaseGleSYSApiExpectTest {
|
|||
HttpResponse.builder().statusCode(404).build())
|
||||
.getIpApi();
|
||||
|
||||
assertEquals(api.listFree(6, "Falkenberg", "OpenVZ").toImmutableSet(), ImmutableSet.of());
|
||||
assertEquals(api.listFree(6, "Falkenberg", "OpenVZ").toSet(), ImmutableSet.of());
|
||||
}
|
||||
|
||||
public void testAddWhenResponseIs2xx() {
|
||||
|
|
|
@ -73,7 +73,7 @@ public class ServerApiExpectTest extends BaseGleSYSApiExpectTest {
|
|||
HttpResponse.builder().statusCode(204).payload(payloadFromResource("/server_list.json")).build()).getServerApi();
|
||||
Server expected = Server.builder().id("vz1541880").hostname("mammamia").datacenter("Falkenberg").platform("OpenVZ").build();
|
||||
|
||||
assertEquals(api.list().toImmutableSet(), ImmutableSet.<Server>of(expected));
|
||||
assertEquals(api.list().toSet(), ImmutableSet.<Server>of(expected));
|
||||
}
|
||||
|
||||
public void testListServersWhenReponseIs404IsEmpty() {
|
||||
|
@ -162,7 +162,7 @@ public class ServerApiExpectTest extends BaseGleSYSApiExpectTest {
|
|||
expectedBuilder.add(OSTemplate.builder().name(name).minDiskSize(20).minMemSize(1024).os("windows").platform("Xen").build());
|
||||
}
|
||||
|
||||
assertEquals(api.listTemplates().toImmutableSet(), expectedBuilder.build());
|
||||
assertEquals(api.listTemplates().toSet(), expectedBuilder.build());
|
||||
}
|
||||
|
||||
public void testGetServerDetailsWhenResponseIs2xx() throws Exception {
|
||||
|
|
Loading…
Reference in New Issue