diff --git a/gcloud-java-compute/src/main/java/com/google/gcloud/compute/Address.java b/gcloud-java-compute/src/main/java/com/google/gcloud/compute/Address.java index e1e70def80d5..c76e75f13da3 100644 --- a/gcloud-java-compute/src/main/java/com/google/gcloud/compute/Address.java +++ b/gcloud-java-compute/src/main/java/com/google/gcloud/compute/Address.java @@ -80,8 +80,8 @@ public Builder description(String description) { } @Override - Builder id(String id) { - infoBuilder.id(id); + Builder generatedId(String generatedId) { + infoBuilder.generatedId(generatedId); return this; } diff --git a/gcloud-java-compute/src/main/java/com/google/gcloud/compute/AddressInfo.java b/gcloud-java-compute/src/main/java/com/google/gcloud/compute/AddressInfo.java index 249f8462d401..a18123027989 100644 --- a/gcloud-java-compute/src/main/java/com/google/gcloud/compute/AddressInfo.java +++ b/gcloud-java-compute/src/main/java/com/google/gcloud/compute/AddressInfo.java @@ -68,7 +68,7 @@ public Address apply(AddressInfo addressInfo) { private final String address; private final Long creationTimestamp; private final String description; - private final String id; + private final String generatedId; private final AddressId addressId; private final Status status; private final Usage usage; @@ -296,7 +296,7 @@ public abstract static class Builder { */ public abstract Builder description(String description); - abstract Builder id(String id); + abstract Builder generatedId(String generatedId); public abstract Builder addressId(AddressId addressId); @@ -315,7 +315,7 @@ static final class BuilderImpl extends Builder { private String address; private Long creationTimestamp; private String description; - private String id; + private String generatedId; private AddressId addressId; private Status status; private Usage usage; @@ -326,7 +326,7 @@ static final class BuilderImpl extends Builder { this.address = addressInfo.address; this.creationTimestamp = addressInfo.creationTimestamp; this.description = addressInfo.description; - this.id = addressInfo.id; + this.generatedId = addressInfo.generatedId; this.addressId = addressInfo.addressId; this.status = addressInfo.status; this.usage = addressInfo.usage; @@ -344,7 +344,7 @@ static final class BuilderImpl extends Builder { } description = addressPb.getDescription(); if (addressPb.getId() != null) { - id = addressPb.getId().toString(); + generatedId = addressPb.getId().toString(); } if (addressPb.getStatus() != null) { status = Status.valueOf(addressPb.getStatus()); @@ -373,8 +373,8 @@ public BuilderImpl description(String description) { } @Override - BuilderImpl id(String id) { - this.id = id; + BuilderImpl generatedId(String generatedId) { + this.generatedId = generatedId; return this; } @@ -406,7 +406,7 @@ public AddressInfo build() { address = builder.address; creationTimestamp = builder.creationTimestamp; description = builder.description; - id = builder.id; + generatedId = builder.generatedId; addressId = checkNotNull(builder.addressId); status = builder.status; usage = builder.usage; @@ -434,10 +434,10 @@ public String description() { } /** - * Returns the unique identifier for the address; defined by the service. + * Returns the service-generated unique identifier for the address. */ - public String id() { - return id; + public String generatedId() { + return generatedId; } /** @@ -481,7 +481,7 @@ public String toString() { .add("address", address) .add("creationTimestamp", creationTimestamp) .add("description", description) - .add("id", id) + .add("generatedId", generatedId) .add("addressId", addressId) .add("status", status) .add("usage", usage) @@ -490,7 +490,8 @@ public String toString() { @Override public int hashCode() { - return Objects.hash(address, creationTimestamp, description, id, addressId, status, usage); + return Objects.hash(address, creationTimestamp, description, generatedId, addressId, status, + usage); } @Override @@ -514,8 +515,8 @@ Address toPb() { addressPb.setCreationTimestamp(TIMESTAMP_FORMATTER.print(creationTimestamp)); } addressPb.setDescription(description); - if (id != null) { - addressPb.setId(new BigInteger(id)); + if (generatedId != null) { + addressPb.setId(new BigInteger(generatedId)); } addressPb.setName(addressId.address()); if (addressId.type() == AddressId.Type.REGION) { diff --git a/gcloud-java-compute/src/main/java/com/google/gcloud/compute/Disk.java b/gcloud-java-compute/src/main/java/com/google/gcloud/compute/Disk.java index 265996a56af6..9904f49b819e 100644 --- a/gcloud-java-compute/src/main/java/com/google/gcloud/compute/Disk.java +++ b/gcloud-java-compute/src/main/java/com/google/gcloud/compute/Disk.java @@ -60,8 +60,8 @@ public static class Builder extends DiskInfo.Builder { } @Override - Builder id(String id) { - infoBuilder.id(id); + Builder generatedId(String generatedId) { + infoBuilder.generatedId(generatedId); return this; } diff --git a/gcloud-java-compute/src/main/java/com/google/gcloud/compute/DiskImageConfiguration.java b/gcloud-java-compute/src/main/java/com/google/gcloud/compute/DiskImageConfiguration.java index 51b6cb912272..259ff0ef9fc3 100644 --- a/gcloud-java-compute/src/main/java/com/google/gcloud/compute/DiskImageConfiguration.java +++ b/gcloud-java-compute/src/main/java/com/google/gcloud/compute/DiskImageConfiguration.java @@ -95,8 +95,9 @@ public DiskId sourceDisk() { } /** - * Returns the id of the disk used to create this image. This value may be used to determine - * whether the image was taken from the current or a previous instance of a given disk name. + * Returns the service-generated unique id of the disk used to create this image. This value may + * be used to determine whether the image was taken from the current or a previous instance of a + * given disk name. */ public String sourceDiskId() { return sourceDiskId; diff --git a/gcloud-java-compute/src/main/java/com/google/gcloud/compute/DiskInfo.java b/gcloud-java-compute/src/main/java/com/google/gcloud/compute/DiskInfo.java index 1f55b4256a30..bfe7d21911e6 100644 --- a/gcloud-java-compute/src/main/java/com/google/gcloud/compute/DiskInfo.java +++ b/gcloud-java-compute/src/main/java/com/google/gcloud/compute/DiskInfo.java @@ -58,7 +58,7 @@ public Disk apply(DiskInfo diskType) { private static final long serialVersionUID = -7173418340679279619L; private static final DateTimeFormatter TIMESTAMP_FORMATTER = ISODateTimeFormat.dateTime(); - private final String id; + private final String generatedId; private final DiskId diskId; private final DiskConfiguration configuration; private final Long creationTimestamp; @@ -99,7 +99,7 @@ public enum CreationStatus { */ public abstract static class Builder { - abstract Builder id(String id); + abstract Builder generatedId(String generatedId); /** * Sets the disk configuration. @@ -136,7 +136,7 @@ public abstract static class Builder { static final class BuilderImpl extends Builder { - private String id; + private String generatedId; private DiskId diskId; private DiskConfiguration configuration; private Long creationTimestamp; @@ -153,7 +153,7 @@ static final class BuilderImpl extends Builder { } BuilderImpl(DiskInfo diskInfo) { - this.id = diskInfo.id; + this.generatedId = diskInfo.generatedId; this.configuration = diskInfo.configuration; this.creationTimestamp = diskInfo.creationTimestamp; this.creationStatus = diskInfo.creationStatus; @@ -167,7 +167,7 @@ static final class BuilderImpl extends Builder { BuilderImpl(Disk diskPb) { if (diskPb.getId() != null) { - this.id = diskPb.getId().toString(); + this.generatedId = diskPb.getId().toString(); } this.configuration = DiskConfiguration.fromPb(diskPb); if (diskPb.getCreationTimestamp() != null) { @@ -193,8 +193,8 @@ static final class BuilderImpl extends Builder { } @Override - BuilderImpl id(String id) { - this.id = id; + BuilderImpl generatedId(String generatedId) { + this.generatedId = generatedId; return this; } @@ -260,7 +260,7 @@ public DiskInfo build() { } DiskInfo(BuilderImpl builder) { - this.id = builder.id; + this.generatedId = builder.generatedId; this.configuration = builder.configuration; this.creationTimestamp = builder.creationTimestamp; this.creationStatus = builder.creationStatus; @@ -280,10 +280,10 @@ public Long creationTimestamp() { } /** - * Returns the unique identifier for the disk; defined by the service. + * Returns the service-generated unique identifier for the disk. */ - public String id() { - return id; + public String generatedId() { + return generatedId; } /** @@ -353,7 +353,7 @@ public Builder toBuilder() { @Override public String toString() { return MoreObjects.toStringHelper(this) - .add("id", id) + .add("generatedId", generatedId) .add("diskId", diskId) .add("configuration", configuration) .add("creationTimestamp", creationTimestamp) @@ -408,8 +408,8 @@ DiskInfo setProjectId(String projectId) { Disk toPb() { Disk diskPb = configuration.toPb(); - if (id != null) { - diskPb.setId(new BigInteger(id)); + if (generatedId != null) { + diskPb.setId(new BigInteger(generatedId)); } if (creationTimestamp != null) { diskPb.setCreationTimestamp(TIMESTAMP_FORMATTER.print(creationTimestamp)); diff --git a/gcloud-java-compute/src/main/java/com/google/gcloud/compute/DiskType.java b/gcloud-java-compute/src/main/java/com/google/gcloud/compute/DiskType.java index f6c8342a0f1c..2e245f438508 100644 --- a/gcloud-java-compute/src/main/java/com/google/gcloud/compute/DiskType.java +++ b/gcloud-java-compute/src/main/java/com/google/gcloud/compute/DiskType.java @@ -52,7 +52,7 @@ public com.google.api.services.compute.model.DiskType apply(DiskType diskType) { private static final long serialVersionUID = -944042261695072026L; private static final DateTimeFormatter TIMESTAMP_FORMATTER = ISODateTimeFormat.dateTime(); - private final String id; + private final String generatedId; private final DiskTypeId diskTypeId; private final Long creationTimestamp; private final String description; @@ -62,7 +62,7 @@ public com.google.api.services.compute.model.DiskType apply(DiskType diskType) { static final class Builder { - private String id; + private String generatedId; private DiskTypeId diskTypeId; private Long creationTimestamp; private String description; @@ -72,8 +72,8 @@ static final class Builder { private Builder() {} - Builder id(String id) { - this.id = id; + Builder generatedId(String generatedId) { + this.generatedId = generatedId; return this; } @@ -113,7 +113,7 @@ DiskType build() { } private DiskType(Builder builder) { - this.id = builder.id; + this.generatedId = builder.generatedId; this.creationTimestamp = builder.creationTimestamp; this.diskTypeId = builder.diskTypeId; this.description = builder.description; @@ -137,10 +137,10 @@ public DiskTypeId diskTypeId() { } /** - * Returns the unique identifier for the disk type; defined by the service. + * Returns the service-generated unique identifier for the disk type. */ - public String id() { - return id; + public String generatedId() { + return generatedId; } /** @@ -176,7 +176,7 @@ public DeprecationStatus deprecationStatus() { @Override public String toString() { return MoreObjects.toStringHelper(this) - .add("id", id) + .add("generatedId", generatedId) .add("creationTimestamp", creationTimestamp) .add("description", description) .add("validDiskSize", validDiskSize) @@ -198,8 +198,8 @@ public final boolean equals(Object obj) { com.google.api.services.compute.model.DiskType toPb() { com.google.api.services.compute.model.DiskType diskTypePb = new com.google.api.services.compute.model.DiskType(); - if (id != null) { - diskTypePb.setId(new BigInteger(id)); + if (generatedId != null) { + diskTypePb.setId(new BigInteger(generatedId)); } if (creationTimestamp != null) { diskTypePb.setCreationTimestamp(TIMESTAMP_FORMATTER.print(creationTimestamp)); @@ -222,7 +222,7 @@ static Builder builder() { static DiskType fromPb(com.google.api.services.compute.model.DiskType diskTypePb) { Builder builder = builder(); if (diskTypePb.getId() != null) { - builder.id(diskTypePb.getId().toString()); + builder.generatedId(diskTypePb.getId().toString()); } if (diskTypePb.getCreationTimestamp() != null) { builder.creationTimestamp(TIMESTAMP_FORMATTER.parseMillis(diskTypePb.getCreationTimestamp())); diff --git a/gcloud-java-compute/src/main/java/com/google/gcloud/compute/Image.java b/gcloud-java-compute/src/main/java/com/google/gcloud/compute/Image.java index 7815929f3bf3..a68febb01c7e 100644 --- a/gcloud-java-compute/src/main/java/com/google/gcloud/compute/Image.java +++ b/gcloud-java-compute/src/main/java/com/google/gcloud/compute/Image.java @@ -65,8 +65,8 @@ public static class Builder extends ImageInfo.Builder { } @Override - Builder id(String id) { - infoBuilder.id(id); + Builder generatedId(String generatedId) { + infoBuilder.generatedId(generatedId); return this; } diff --git a/gcloud-java-compute/src/main/java/com/google/gcloud/compute/ImageDiskConfiguration.java b/gcloud-java-compute/src/main/java/com/google/gcloud/compute/ImageDiskConfiguration.java index c738251bf7ac..5961f94c80d4 100644 --- a/gcloud-java-compute/src/main/java/com/google/gcloud/compute/ImageDiskConfiguration.java +++ b/gcloud-java-compute/src/main/java/com/google/gcloud/compute/ImageDiskConfiguration.java @@ -108,10 +108,11 @@ public ImageId sourceImage() { } /** - * Returns the ID value of the image used to create this disk. This value identifies the exact - * image that was used to create this persistent disk. For example, if you created the persistent - * disk from an image that was later deleted and recreated under the same name, the source image - * ID would identify the exact version of the image that was used. + * Returns the service-generated unique id of the image used to create this disk. This value + * identifies the exact image that was used to create this persistent disk. For example, if you + * created the persistent disk from an image that was later deleted and recreated under the same + * name, the source image service-generated id would identify the exact version of the image that + * was used. */ public String sourceImageId() { return sourceImageId; diff --git a/gcloud-java-compute/src/main/java/com/google/gcloud/compute/ImageInfo.java b/gcloud-java-compute/src/main/java/com/google/gcloud/compute/ImageInfo.java index c243154cec4e..6de9c52b455b 100644 --- a/gcloud-java-compute/src/main/java/com/google/gcloud/compute/ImageInfo.java +++ b/gcloud-java-compute/src/main/java/com/google/gcloud/compute/ImageInfo.java @@ -63,7 +63,7 @@ public Image apply(ImageInfo image) { private static final long serialVersionUID = -1061916352807358977L; private static final DateTimeFormatter TIMESTAMP_FORMATTER = ISODateTimeFormat.dateTime(); - private final String id; + private final String generatedId; private final ImageId imageId; private final Long creationTimestamp; private final String description; @@ -99,7 +99,7 @@ public enum Status { */ public abstract static class Builder { - abstract Builder id(String id); + abstract Builder generatedId(String generatedId); abstract Builder creationTimestamp(Long creationTimestamp); @@ -136,7 +136,7 @@ public abstract static class Builder { static final class BuilderImpl extends Builder { - private String id; + private String generatedId; private Long creationTimestamp; private ImageId imageId; private String description; @@ -149,7 +149,7 @@ static final class BuilderImpl extends Builder { BuilderImpl() {} BuilderImpl(ImageInfo imageInfo) { - this.id = imageInfo.id; + this.generatedId = imageInfo.generatedId; this.creationTimestamp = imageInfo.creationTimestamp; this.imageId = imageInfo.imageId; this.description = imageInfo.description; @@ -162,7 +162,7 @@ static final class BuilderImpl extends Builder { BuilderImpl(Image imagePb) { if (imagePb.getId() != null) { - this.id = imagePb.getId().toString(); + this.generatedId = imagePb.getId().toString(); } if (imagePb.getCreationTimestamp() != null) { this.creationTimestamp = TIMESTAMP_FORMATTER.parseMillis(imagePb.getCreationTimestamp()); @@ -184,8 +184,8 @@ static final class BuilderImpl extends Builder { } @Override - BuilderImpl id(String id) { - this.id = id; + BuilderImpl generatedId(String generatedId) { + this.generatedId = generatedId; return this; } @@ -244,7 +244,7 @@ public ImageInfo build() { } ImageInfo(BuilderImpl builder) { - this.id = builder.id; + this.generatedId = builder.generatedId; this.creationTimestamp = builder.creationTimestamp; this.imageId = checkNotNull(builder.imageId); this.description = builder.description; @@ -256,10 +256,10 @@ public ImageInfo build() { } /** - * Returns the unique identifier for the image; defined by the service. + * Returns the service-generated unique identifier for the image. */ - public String id() { - return id; + public String generatedId() { + return generatedId; } /** @@ -335,7 +335,7 @@ public Builder toBuilder() { @Override public String toString() { return MoreObjects.toStringHelper(this) - .add("id", id) + .add("generatedId", generatedId) .add("creationTimestamp", creationTimestamp) .add("imageId", imageId) .add("description", description) @@ -348,7 +348,7 @@ public String toString() { @Override public int hashCode() { - return Objects.hash(id, creationTimestamp, imageId, description, configuration, status, + return Objects.hash(generatedId, creationTimestamp, imageId, description, configuration, status, diskSizeGb, licenses); } @@ -368,8 +368,8 @@ ImageInfo setProjectId(String projectId) { Image toPb() { Image imagePb = configuration.toPb(); - if (id != null) { - imagePb.setId(new BigInteger(id)); + if (generatedId != null) { + imagePb.setId(new BigInteger(generatedId)); } if (creationTimestamp != null) { imagePb.setCreationTimestamp(TIMESTAMP_FORMATTER.print(creationTimestamp)); diff --git a/gcloud-java-compute/src/main/java/com/google/gcloud/compute/Instance.java b/gcloud-java-compute/src/main/java/com/google/gcloud/compute/Instance.java index 5f9aee0dd840..7c84d11d71d7 100644 --- a/gcloud-java-compute/src/main/java/com/google/gcloud/compute/Instance.java +++ b/gcloud-java-compute/src/main/java/com/google/gcloud/compute/Instance.java @@ -70,8 +70,8 @@ public static class Builder extends InstanceInfo.Builder { } @Override - Builder id(String id) { - this.infoBuilder.id(id); + Builder generatedId(String generatedId) { + this.infoBuilder.generatedId(generatedId); return this; } diff --git a/gcloud-java-compute/src/main/java/com/google/gcloud/compute/InstanceInfo.java b/gcloud-java-compute/src/main/java/com/google/gcloud/compute/InstanceInfo.java index 0ce3e8f1bb76..67b0568e2ebc 100644 --- a/gcloud-java-compute/src/main/java/com/google/gcloud/compute/InstanceInfo.java +++ b/gcloud-java-compute/src/main/java/com/google/gcloud/compute/InstanceInfo.java @@ -71,7 +71,7 @@ public Instance apply(InstanceInfo instance) { private static final long serialVersionUID = -6601223112628977168L; private static final DateTimeFormatter TIMESTAMP_FORMATTER = ISODateTimeFormat.dateTime(); - private final String id; + private final String generatedId; private final InstanceId instanceId; private final Long creationTimestamp; private final String description; @@ -125,7 +125,7 @@ public enum Status { */ public abstract static class Builder { - abstract Builder id(String id); + abstract Builder generatedId(String generatedId); /** * Sets the identity of the virtual machine instance. @@ -219,7 +219,7 @@ public abstract static class Builder { public static final class BuilderImpl extends Builder { - private String id; + private String generatedId; private InstanceId instanceId; private Long creationTimestamp; private String description; @@ -240,7 +240,7 @@ public static final class BuilderImpl extends Builder { } BuilderImpl(InstanceInfo instance) { - this.id = instance.id; + this.generatedId = instance.generatedId; this.instanceId = instance.instanceId; this.creationTimestamp = instance.creationTimestamp; this.description = instance.description; @@ -259,7 +259,7 @@ public static final class BuilderImpl extends Builder { BuilderImpl(Instance instancePb) { if (instancePb.getId() != null) { - this.id = instancePb.getId().toString(); + this.generatedId = instancePb.getId().toString(); } this.instanceId = InstanceId.fromUrl(instancePb.getSelfLink()); if (instancePb.getCreationTimestamp() != null) { @@ -298,8 +298,8 @@ public static final class BuilderImpl extends Builder { } @Override - Builder id(String id) { - this.id = id; + Builder generatedId(String generatedId) { + this.generatedId = generatedId; return this; } @@ -408,7 +408,7 @@ public InstanceInfo build() { } InstanceInfo(BuilderImpl builder) { - this.id = builder.id; + this.generatedId = builder.generatedId; this.instanceId = builder.instanceId; this.creationTimestamp = builder.creationTimestamp; this.description = builder.description; @@ -426,10 +426,10 @@ public InstanceInfo build() { } /** - * Returns the unique identifier for the instance; defined by the service. + * Returns the service-generated unique identifier for the instance. */ - public String id() { - return id; + public String generatedId() { + return generatedId; } /** @@ -551,7 +551,7 @@ public Builder toBuilder() { @Override public String toString() { return MoreObjects.toStringHelper(this) - .add("id", id) + .add("generatedId", generatedId) .add("instanceId", instanceId) .add("creationTimestamp", creationTimestamp) .add("description", description) @@ -571,9 +571,9 @@ public String toString() { @Override public int hashCode() { - return Objects.hash(id, instanceId, creationTimestamp, description, status, statusMessage, tags, - machineType, canIpForward, networkInterfaces, attachedDisks, metadata, serviceAccounts, - schedulingOptions, cpuPlatform); + return Objects.hash(generatedId, instanceId, creationTimestamp, description, status, + statusMessage, tags, machineType, canIpForward, networkInterfaces, attachedDisks, metadata, + serviceAccounts, schedulingOptions, cpuPlatform); } @Override @@ -605,8 +605,8 @@ public AttachedDisk apply(AttachedDisk attachedDisk) { Instance toPb() { Instance instancePb = new Instance(); - if (id != null) { - instancePb.setId(new BigInteger(id)); + if (generatedId != null) { + instancePb.setId(new BigInteger(generatedId)); } if (creationTimestamp != null) { instancePb.setCreationTimestamp(TIMESTAMP_FORMATTER.print(creationTimestamp)); diff --git a/gcloud-java-compute/src/main/java/com/google/gcloud/compute/MachineType.java b/gcloud-java-compute/src/main/java/com/google/gcloud/compute/MachineType.java index a381ec1de6b4..cab5ecb1bded 100644 --- a/gcloud-java-compute/src/main/java/com/google/gcloud/compute/MachineType.java +++ b/gcloud-java-compute/src/main/java/com/google/gcloud/compute/MachineType.java @@ -59,7 +59,7 @@ public com.google.api.services.compute.model.MachineType apply(MachineType type) private static final long serialVersionUID = -4210962597502860450L; private final MachineTypeId machineTypeId; - private final String id; + private final String generatedId; private final Long creationTimestamp; private final String description; private final Integer cpus; @@ -72,7 +72,7 @@ public com.google.api.services.compute.model.MachineType apply(MachineType type) static final class Builder { private MachineTypeId machineTypeId; - private String id; + private String generatedId; private Long creationTimestamp; private String description; private Integer cpus; @@ -89,8 +89,8 @@ Builder machineTypeId(MachineTypeId machineTypeId) { return this; } - Builder id(String id) { - this.id = id; + Builder generatedId(String generatedId) { + this.generatedId = generatedId; return this; } @@ -141,7 +141,7 @@ MachineType build() { private MachineType(Builder builder) { this.machineTypeId = builder.machineTypeId; - this.id = builder.id; + this.generatedId = builder.generatedId; this.creationTimestamp = builder.creationTimestamp; this.description = builder.description; this.cpus = builder.cpus; @@ -160,10 +160,10 @@ public MachineTypeId machineTypeId() { } /** - * Returns the unique identifier for the machine type; defined by the service. + * Returns the service-generated unique identifier for the machine type. */ - public String id() { - return id; + public String generatedId() { + return generatedId; } /** @@ -229,7 +229,7 @@ public DeprecationStatus deprecationStatus() { public String toString() { return MoreObjects.toStringHelper(this) .add("machineTypeId", machineTypeId) - .add("id", id) + .add("generatedId", generatedId) .add("creationTimestamp", creationTimestamp) .add("description", description) .add("cpus", cpus) @@ -254,8 +254,8 @@ public final boolean equals(Object obj) { com.google.api.services.compute.model.MachineType toPb() { com.google.api.services.compute.model.MachineType machineTypePb = new com.google.api.services.compute.model.MachineType(); - if (id != null) { - machineTypePb.setId(new BigInteger(id)); + if (generatedId != null) { + machineTypePb.setId(new BigInteger(generatedId)); } if (creationTimestamp != null) { machineTypePb.setCreationTimestamp(TIMESTAMP_FORMATTER.print(creationTimestamp)); @@ -291,7 +291,7 @@ static MachineType fromPb(com.google.api.services.compute.model.MachineType mach Builder builder = builder(); builder.machineTypeId(MachineTypeId.fromUrl(machineTypePb.getSelfLink())); if (machineTypePb.getId() != null) { - builder.id(machineTypePb.getId().toString()); + builder.generatedId(machineTypePb.getId().toString()); } if (machineTypePb.getCreationTimestamp() != null) { builder.creationTimestamp( diff --git a/gcloud-java-compute/src/main/java/com/google/gcloud/compute/Network.java b/gcloud-java-compute/src/main/java/com/google/gcloud/compute/Network.java index f438f2b8d3df..854cb72ce7d1 100644 --- a/gcloud-java-compute/src/main/java/com/google/gcloud/compute/Network.java +++ b/gcloud-java-compute/src/main/java/com/google/gcloud/compute/Network.java @@ -63,8 +63,8 @@ public static class Builder extends NetworkInfo.Builder { } @Override - Builder id(String id) { - infoBuilder.id(id); + Builder generatedId(String generatedId) { + infoBuilder.generatedId(generatedId); return this; } diff --git a/gcloud-java-compute/src/main/java/com/google/gcloud/compute/NetworkInfo.java b/gcloud-java-compute/src/main/java/com/google/gcloud/compute/NetworkInfo.java index d3e1cddcd6be..fc5d0464d534 100644 --- a/gcloud-java-compute/src/main/java/com/google/gcloud/compute/NetworkInfo.java +++ b/gcloud-java-compute/src/main/java/com/google/gcloud/compute/NetworkInfo.java @@ -60,7 +60,7 @@ public Network apply(NetworkInfo network) { private static final long serialVersionUID = 4336912581538114026L; private static final DateTimeFormatter TIMESTAMP_FORMATTER = ISODateTimeFormat.dateTime(); - private final String id; + private final String generatedId; private final NetworkId networkId; private final Long creationTimestamp; private final String description; @@ -71,7 +71,7 @@ public Network apply(NetworkInfo network) { */ public abstract static class Builder { - abstract Builder id(String id); + abstract Builder generatedId(String generatedId); abstract Builder creationTimestamp(Long creationTimestamp); @@ -101,7 +101,7 @@ public abstract static class Builder { static final class BuilderImpl extends Builder { - private String id; + private String generatedId; private NetworkId networkId; private Long creationTimestamp; private String description; @@ -113,7 +113,7 @@ static final class BuilderImpl extends Builder { } BuilderImpl(NetworkInfo networkInfo) { - this.id = networkInfo.id; + this.generatedId = networkInfo.generatedId; this.creationTimestamp = networkInfo.creationTimestamp; this.networkId = networkInfo.networkId; this.description = networkInfo.description; @@ -122,7 +122,7 @@ static final class BuilderImpl extends Builder { BuilderImpl(Network networkPb) { if (networkPb.getId() != null) { - this.id = networkPb.getId().toString(); + this.generatedId = networkPb.getId().toString(); } if (networkPb.getCreationTimestamp() != null) { this.creationTimestamp = TIMESTAMP_FORMATTER.parseMillis(networkPb.getCreationTimestamp()); @@ -133,8 +133,8 @@ static final class BuilderImpl extends Builder { } @Override - BuilderImpl id(String id) { - this.id = id; + BuilderImpl generatedId(String generatedId) { + this.generatedId = generatedId; return this; } @@ -169,7 +169,7 @@ public NetworkInfo build() { } NetworkInfo(BuilderImpl builder) { - this.id = builder.id; + this.generatedId = builder.generatedId; this.creationTimestamp = builder.creationTimestamp; this.networkId = builder.networkId; this.description = builder.description; @@ -177,10 +177,10 @@ public NetworkInfo build() { } /** - * Returns the unique identifier for the subnetwork; defined by the service. + * Returns the service-generated unique identifier for the network. */ - public String id() { - return id; + public String generatedId() { + return generatedId; } /** @@ -224,7 +224,7 @@ public Builder toBuilder() { @Override public String toString() { return MoreObjects.toStringHelper(this) - .add("id", id) + .add("generatedId", generatedId) .add("creationTimestamp", creationTimestamp) .add("networkId", networkId) .add("description", description) @@ -234,7 +234,7 @@ public String toString() { @Override public int hashCode() { - return Objects.hash(id, networkId, creationTimestamp, description, configuration); + return Objects.hash(generatedId, networkId, creationTimestamp, description, configuration); } @Override @@ -253,8 +253,8 @@ NetworkInfo setProjectId(String projectId) { Network toPb() { Network networkPb = configuration.toPb(); - if (id != null) { - networkPb.setId(new BigInteger(id)); + if (generatedId != null) { + networkPb.setId(new BigInteger(generatedId)); } if (creationTimestamp != null) { networkPb.setCreationTimestamp(TIMESTAMP_FORMATTER.print(creationTimestamp)); diff --git a/gcloud-java-compute/src/main/java/com/google/gcloud/compute/Operation.java b/gcloud-java-compute/src/main/java/com/google/gcloud/compute/Operation.java index 2b35dac3fd2b..3e4935dbb859 100644 --- a/gcloud-java-compute/src/main/java/com/google/gcloud/compute/Operation.java +++ b/gcloud-java-compute/src/main/java/com/google/gcloud/compute/Operation.java @@ -50,7 +50,7 @@ public class Operation implements Serializable { private transient Compute compute; private final ComputeOptions options; - private final String id; + private final String generatedId; private final OperationId operationId; private final String clientOperationId; private final String operationType; @@ -294,7 +294,7 @@ public int hashCode() { static final class Builder { private Compute compute; - private String id; + private String generatedId; private OperationId operationId; private String clientOperationId; private String operationType; @@ -320,7 +320,7 @@ static final class Builder { Builder(Compute compute, com.google.api.services.compute.model.Operation operationPb) { this.compute = compute; if (operationPb.getId() != null) { - id = operationPb.getId().toString(); + generatedId = operationPb.getId().toString(); } if (RegionOperationId.matchesUrl(operationPb.getSelfLink())) { operationId = RegionOperationId.fromUrl(operationPb.getSelfLink()); @@ -362,8 +362,8 @@ static final class Builder { description = operationPb.getDescription(); } - Builder id(String id) { - this.id = id; + Builder generatedId(String generatedId) { + this.generatedId = generatedId; return this; } @@ -460,7 +460,7 @@ Operation build() { private Operation(Builder builder) { this.compute = checkNotNull(builder.compute); this.options = compute.options(); - this.id = builder.id; + this.generatedId = builder.generatedId; this.operationId = checkNotNull(builder.operationId); this.clientOperationId = builder.clientOperationId; this.operationType = builder.operationType; @@ -488,10 +488,10 @@ public Compute compute() { } /** - * Returns the service-defined unique identifier for the operation. + * Returns the service-generated unique identifier for the operation. */ - public String id() { - return id; + public String generatedId() { + return generatedId; } /** @@ -683,7 +683,7 @@ public boolean delete() throws ComputeException { @Override public String toString() { return MoreObjects.toStringHelper(this) - .add("id", id) + .add("generatedId", generatedId) .add("operationsId", operationId) .add("clientOperationId", clientOperationId) .add("operationType", operationType) @@ -706,7 +706,7 @@ public String toString() { @Override public final int hashCode() { - return Objects.hash(id); + return Objects.hash(operationId); } @Override @@ -719,8 +719,8 @@ public final boolean equals(Object obj) { com.google.api.services.compute.model.Operation toPb() { com.google.api.services.compute.model.Operation operationPb = new com.google.api.services.compute.model.Operation(); - if (id != null) { - operationPb.setId(new BigInteger(id)); + if (generatedId != null) { + operationPb.setId(new BigInteger(generatedId)); } operationPb.setName(operationId.operation()); operationPb.setClientOperationId(clientOperationId); diff --git a/gcloud-java-compute/src/main/java/com/google/gcloud/compute/Region.java b/gcloud-java-compute/src/main/java/com/google/gcloud/compute/Region.java index fb7890187a14..afc761df2e0d 100644 --- a/gcloud-java-compute/src/main/java/com/google/gcloud/compute/Region.java +++ b/gcloud-java-compute/src/main/java/com/google/gcloud/compute/Region.java @@ -55,7 +55,7 @@ public com.google.api.services.compute.model.Region apply(Region region) { private static final DateTimeFormatter TIMESTAMP_FORMATTER = ISODateTimeFormat.dateTime(); private final RegionId regionId; - private final String id; + private final String generatedId; private final Long creationTimestamp; private final String description; private final Status status; @@ -166,7 +166,7 @@ static Quota fromPb(com.google.api.services.compute.model.Quota quotaPb) { static final class Builder { private RegionId regionId; - private String id; + private String generatedId; private Long creationTimestamp; private String description; @@ -182,8 +182,8 @@ Builder regionId(RegionId regionId) { return this; } - Builder id(String id) { - this.id = id; + Builder generatedId(String generatedId) { + this.generatedId = generatedId; return this; } @@ -224,7 +224,7 @@ Region build() { private Region(Builder builder) { this.regionId = builder.regionId; - this.id = builder.id; + this.generatedId = builder.generatedId; this.creationTimestamp = builder.creationTimestamp; this.description = builder.description; this.status = builder.status; @@ -241,10 +241,10 @@ public RegionId regionId() { } /** - * Returns the unique identifier for the region; defined by the service. + * Returns the service-generated unique identifier for the region. */ - public String id() { - return id; + public String generatedId() { + return generatedId; } /** @@ -295,7 +295,7 @@ public DeprecationStatus deprecationStatus() { public String toString() { return MoreObjects.toStringHelper(this) .add("regionId", regionId) - .add("id", id) + .add("generatedId", generatedId) .add("creationTimestamp", creationTimestamp) .add("description", description) .add("status", status) @@ -318,8 +318,8 @@ public final boolean equals(Object obj) { com.google.api.services.compute.model.Region toPb() { com.google.api.services.compute.model.Region regionPb = new com.google.api.services.compute.model.Region(); - if (id != null) { - regionPb.setId(new BigInteger(id)); + if (generatedId != null) { + regionPb.setId(new BigInteger(generatedId)); } if (creationTimestamp != null) { regionPb.setCreationTimestamp(TIMESTAMP_FORMATTER.print(creationTimestamp)); @@ -350,7 +350,7 @@ static Region fromPb(com.google.api.services.compute.model.Region regionPb) { Builder builder = builder(); builder.regionId(RegionId.fromUrl(regionPb.getSelfLink())); if (regionPb.getId() != null) { - builder.id(regionPb.getId().toString()); + builder.generatedId(regionPb.getId().toString()); } if (regionPb.getCreationTimestamp() != null) { builder.creationTimestamp(TIMESTAMP_FORMATTER.parseMillis(regionPb.getCreationTimestamp())); diff --git a/gcloud-java-compute/src/main/java/com/google/gcloud/compute/Snapshot.java b/gcloud-java-compute/src/main/java/com/google/gcloud/compute/Snapshot.java index e93a419d5b4a..a12404a9fd4f 100644 --- a/gcloud-java-compute/src/main/java/com/google/gcloud/compute/Snapshot.java +++ b/gcloud-java-compute/src/main/java/com/google/gcloud/compute/Snapshot.java @@ -65,8 +65,8 @@ public static class Builder extends SnapshotInfo.Builder { } @Override - Builder id(String id) { - infoBuilder.id(id); + Builder generatedId(String generatedId) { + infoBuilder.generatedId(generatedId); return this; } diff --git a/gcloud-java-compute/src/main/java/com/google/gcloud/compute/SnapshotDiskConfiguration.java b/gcloud-java-compute/src/main/java/com/google/gcloud/compute/SnapshotDiskConfiguration.java index 1bdc319e30c5..178c54f0038e 100644 --- a/gcloud-java-compute/src/main/java/com/google/gcloud/compute/SnapshotDiskConfiguration.java +++ b/gcloud-java-compute/src/main/java/com/google/gcloud/compute/SnapshotDiskConfiguration.java @@ -113,10 +113,10 @@ public SnapshotId sourceSnapshot() { } /** - * Returns the unique ID of the snapshot used to create this disk. This value identifies the exact - * snapshot that was used to create the persistent disk. For example, if you created the - * persistent disk from a snapshot that was later deleted and recreated under the same name, the - * source snapshot ID would identify the exact version of the snapshot that was used. + * Returns the service-generated unique id of the snapshot used to create this disk. This value + * identifies the exact snapshot that was used to create the persistent disk. For example, if you + * created the persistent disk from a snapshot that was later deleted and recreated under the same + * name, the source snapshot ID would identify the exact version of the snapshot that was used. */ public String sourceSnapshotId() { return sourceSnapshotId; diff --git a/gcloud-java-compute/src/main/java/com/google/gcloud/compute/SnapshotInfo.java b/gcloud-java-compute/src/main/java/com/google/gcloud/compute/SnapshotInfo.java index fe567988d82c..34f6c53884bf 100644 --- a/gcloud-java-compute/src/main/java/com/google/gcloud/compute/SnapshotInfo.java +++ b/gcloud-java-compute/src/main/java/com/google/gcloud/compute/SnapshotInfo.java @@ -61,7 +61,7 @@ public Snapshot apply(SnapshotInfo snapshot) { private static final long serialVersionUID = 1065513502131159769L; private static final DateTimeFormatter TIMESTAMP_FORMATTER = ISODateTimeFormat.dateTime(); - private final String id; + private final String generatedId; private final SnapshotId snapshotId; private final Long creationTimestamp; private final String description; @@ -125,7 +125,7 @@ public enum StorageBytesStatus { */ public abstract static class Builder { - abstract Builder id(String id); + abstract Builder generatedId(String generatedId); abstract Builder creationTimestamp(Long creationTimestamp); @@ -164,7 +164,7 @@ public abstract static class Builder { static final class BuilderImpl extends Builder { - private String id; + private String generatedId; private Long creationTimestamp; private SnapshotId snapshotId; private String description; @@ -179,7 +179,7 @@ static final class BuilderImpl extends Builder { BuilderImpl() {} BuilderImpl(SnapshotInfo snapshotInfo) { - this.id = snapshotInfo.id; + this.generatedId = snapshotInfo.generatedId; this.creationTimestamp = snapshotInfo.creationTimestamp; this.snapshotId = snapshotInfo.snapshotId; this.description = snapshotInfo.description; @@ -194,7 +194,7 @@ static final class BuilderImpl extends Builder { BuilderImpl(Snapshot snapshotPb) { if (snapshotPb.getId() != null) { - this.id = snapshotPb.getId().toString(); + this.generatedId = snapshotPb.getId().toString(); } if (snapshotPb.getCreationTimestamp() != null) { this.creationTimestamp = TIMESTAMP_FORMATTER.parseMillis(snapshotPb.getCreationTimestamp()); @@ -219,8 +219,8 @@ static final class BuilderImpl extends Builder { } @Override - BuilderImpl id(String id) { - this.id = id; + BuilderImpl generatedId(String generatedId) { + this.generatedId = generatedId; return this; } @@ -291,7 +291,7 @@ public SnapshotInfo build() { } SnapshotInfo(BuilderImpl builder) { - this.id = builder.id; + this.generatedId = builder.generatedId; this.creationTimestamp = builder.creationTimestamp; this.snapshotId = checkNotNull(builder.snapshotId); this.description = builder.description; @@ -305,10 +305,10 @@ public SnapshotInfo build() { } /** - * Returns the unique identifier for the snapshot; defined by the service. + * Returns the service-generated unique identifier for the snapshot. */ - public String id() { - return id; + public String generatedId() { + return generatedId; } /** @@ -363,9 +363,9 @@ public DiskId sourceDisk() { } /** - * Returns the id value of the disk used to create this snapshot. This value may be used to - * determine whether the snapshot was taken from the current or a previous instance of a given - * disk name. + * Returns the service-generated unique id of the disk used to create this snapshot. This value + * may be used to determine whether the snapshot was taken from the current or a previous instance + * of a given disk name. */ public String sourceDiskId() { return sourceDiskId; @@ -399,7 +399,7 @@ public Builder toBuilder() { @Override public String toString() { return MoreObjects.toStringHelper(this) - .add("id", id) + .add("generatedId", generatedId) .add("creationTimestamp", creationTimestamp) .add("snapshotId", snapshotId) .add("description", description) @@ -415,7 +415,7 @@ public String toString() { @Override public int hashCode() { - return Objects.hash(id, creationTimestamp, snapshotId, description, status, diskSizeGb, + return Objects.hash(generatedId, creationTimestamp, snapshotId, description, status, diskSizeGb, licenses, sourceDisk, sourceDiskId, storageBytes, storageBytesStatus); } @@ -435,8 +435,8 @@ SnapshotInfo setProjectId(String projectId) { Snapshot toPb() { Snapshot snapshotPb = new Snapshot(); - if (id != null) { - snapshotPb.setId(new BigInteger(id)); + if (generatedId != null) { + snapshotPb.setId(new BigInteger(generatedId)); } if (creationTimestamp != null) { snapshotPb.setCreationTimestamp(TIMESTAMP_FORMATTER.print(creationTimestamp)); diff --git a/gcloud-java-compute/src/main/java/com/google/gcloud/compute/Subnetwork.java b/gcloud-java-compute/src/main/java/com/google/gcloud/compute/Subnetwork.java index 6a42d8663ea3..035af9f829c2 100644 --- a/gcloud-java-compute/src/main/java/com/google/gcloud/compute/Subnetwork.java +++ b/gcloud-java-compute/src/main/java/com/google/gcloud/compute/Subnetwork.java @@ -63,8 +63,8 @@ public static class Builder extends SubnetworkInfo.Builder { } @Override - Builder id(String id) { - infoBuilder.id(id); + Builder generatedId(String generatedId) { + infoBuilder.generatedId(generatedId); return this; } diff --git a/gcloud-java-compute/src/main/java/com/google/gcloud/compute/SubnetworkInfo.java b/gcloud-java-compute/src/main/java/com/google/gcloud/compute/SubnetworkInfo.java index d6988ee7eea8..e61a2c82b5de 100644 --- a/gcloud-java-compute/src/main/java/com/google/gcloud/compute/SubnetworkInfo.java +++ b/gcloud-java-compute/src/main/java/com/google/gcloud/compute/SubnetworkInfo.java @@ -56,7 +56,7 @@ public Subnetwork apply(SubnetworkInfo subnetwork) { private static final long serialVersionUID = 7491176262675441579L; private static final DateTimeFormatter TIMESTAMP_FORMATTER = ISODateTimeFormat.dateTime(); - private final String id; + private final String generatedId; private final SubnetworkId subnetworkId; private final Long creationTimestamp; private final String description; @@ -69,7 +69,7 @@ public Subnetwork apply(SubnetworkInfo subnetwork) { */ public abstract static class Builder { - abstract Builder id(String id); + abstract Builder generatedId(String generatedId); abstract Builder creationTimestamp(Long creationTimestamp); @@ -108,7 +108,7 @@ public abstract static class Builder { static final class BuilderImpl extends Builder { - private String id; + private String generatedId; private SubnetworkId subnetworkId; private Long creationTimestamp; private String description; @@ -123,7 +123,7 @@ static final class BuilderImpl extends Builder { } BuilderImpl(SubnetworkInfo subnetworkInfo) { - this.id = subnetworkInfo.id; + this.generatedId = subnetworkInfo.generatedId; this.creationTimestamp = subnetworkInfo.creationTimestamp; this.subnetworkId = subnetworkInfo.subnetworkId; this.description = subnetworkInfo.description; @@ -134,7 +134,7 @@ static final class BuilderImpl extends Builder { BuilderImpl(Subnetwork subnetworkPb) { if (subnetworkPb.getId() != null) { - this.id = subnetworkPb.getId().toString(); + this.generatedId = subnetworkPb.getId().toString(); } if (subnetworkPb.getCreationTimestamp() != null) { this.creationTimestamp = @@ -150,8 +150,8 @@ static final class BuilderImpl extends Builder { } @Override - BuilderImpl id(String id) { - this.id = id; + BuilderImpl generatedId(String generatedId) { + this.generatedId = generatedId; return this; } @@ -198,7 +198,7 @@ public SubnetworkInfo build() { } SubnetworkInfo(BuilderImpl builder) { - this.id = builder.id; + this.generatedId = builder.generatedId; this.creationTimestamp = builder.creationTimestamp; this.subnetworkId = checkNotNull(builder.subnetworkId); this.description = builder.description; @@ -208,10 +208,10 @@ public SubnetworkInfo build() { } /** - * Returns the unique identifier for the subnetwork; defined by the service. + * Returns the service-generated unique identifier for the subnetwork. */ - public String id() { - return id; + public String generatedId() { + return generatedId; } /** @@ -271,7 +271,7 @@ public Builder toBuilder() { @Override public String toString() { return MoreObjects.toStringHelper(this) - .add("id", id) + .add("generatedId", generatedId) .add("creationTimestamp", creationTimestamp) .add("subnetworkId", subnetworkId) .add("description", description) @@ -283,8 +283,8 @@ public String toString() { @Override public int hashCode() { - return Objects.hash(id, creationTimestamp, subnetworkId, description, gatewayAddress, network, - ipRange); + return Objects.hash(generatedId, creationTimestamp, subnetworkId, description, gatewayAddress, + network, ipRange); } @Override @@ -304,8 +304,8 @@ SubnetworkInfo setProjectId(String projectId) { Subnetwork toPb() { Subnetwork subnetworkPb = new Subnetwork(); - if (id != null) { - subnetworkPb.setId(new BigInteger(id)); + if (generatedId != null) { + subnetworkPb.setId(new BigInteger(generatedId)); } if (creationTimestamp != null) { subnetworkPb.setCreationTimestamp(TIMESTAMP_FORMATTER.print(creationTimestamp)); diff --git a/gcloud-java-compute/src/main/java/com/google/gcloud/compute/Zone.java b/gcloud-java-compute/src/main/java/com/google/gcloud/compute/Zone.java index 80a6c08f4db1..ff5ed877408c 100644 --- a/gcloud-java-compute/src/main/java/com/google/gcloud/compute/Zone.java +++ b/gcloud-java-compute/src/main/java/com/google/gcloud/compute/Zone.java @@ -52,7 +52,7 @@ public com.google.api.services.compute.model.Zone apply(Zone region) { private static final DateTimeFormatter TIMESTAMP_FORMATTER = ISODateTimeFormat.dateTime(); private final ZoneId zoneId; - private final String id; + private final String generatedId; private final Long creationTimestamp; private final String description; private final Status status; @@ -70,7 +70,7 @@ public enum Status { static final class Builder { private ZoneId zoneId; - private String id; + private String generatedId; private Long creationTimestamp; private String description; @@ -85,8 +85,8 @@ Builder zoneId(ZoneId zoneId) { return this; } - Builder id(String id) { - this.id = id; + Builder generatedId(String generatedId) { + this.generatedId = generatedId; return this; } @@ -122,7 +122,7 @@ Zone build() { private Zone(Builder builder) { this.zoneId = builder.zoneId; - this.id = builder.id; + this.generatedId = builder.generatedId; this.creationTimestamp = builder.creationTimestamp; this.description = builder.description; this.status = builder.status; @@ -152,10 +152,10 @@ public String description() { } /** - * Returns the unique identifier for the zone; defined by the service. + * Returns the service-generated unique identifier for the zone. */ - public String id() { - return id; + public String generatedId() { + return generatedId; } /** @@ -185,7 +185,7 @@ public DeprecationStatus deprecationStatus() { public String toString() { return MoreObjects.toStringHelper(this) .add("zoneId", zoneId) - .add("id", id) + .add("generatedId", generatedId) .add("creationTimestamp", creationTimestamp) .add("description", description) .add("status", status) @@ -207,8 +207,8 @@ public final boolean equals(Object obj) { com.google.api.services.compute.model.Zone toPb() { com.google.api.services.compute.model.Zone zonePb = new com.google.api.services.compute.model.Zone(); - if (id != null) { - zonePb.setId(new BigInteger(id)); + if (generatedId != null) { + zonePb.setId(new BigInteger(generatedId)); } if (creationTimestamp != null) { zonePb.setCreationTimestamp(TIMESTAMP_FORMATTER.print(creationTimestamp)); @@ -236,7 +236,7 @@ static Zone fromPb(com.google.api.services.compute.model.Zone zonePb) { Builder builder = builder(); builder.zoneId(ZoneId.fromUrl(zonePb.getSelfLink())); if (zonePb.getId() != null) { - builder.id(zonePb.getId().toString()); + builder.generatedId(zonePb.getId().toString()); } if (zonePb.getCreationTimestamp() != null) { builder.creationTimestamp(TIMESTAMP_FORMATTER.parseMillis(zonePb.getCreationTimestamp())); diff --git a/gcloud-java-compute/src/test/java/com/google/gcloud/compute/AddressInfoTest.java b/gcloud-java-compute/src/test/java/com/google/gcloud/compute/AddressInfoTest.java index cb4ba3678c30..d476cf275268 100644 --- a/gcloud-java-compute/src/test/java/com/google/gcloud/compute/AddressInfoTest.java +++ b/gcloud-java-compute/src/test/java/com/google/gcloud/compute/AddressInfoTest.java @@ -33,7 +33,7 @@ public class AddressInfoTest { private static final String ADDRESS = "192.168.1.1"; private static final Long CREATION_TIMESTAMP = 1452602400000L; private static final String DESCRIPTION = "description"; - private static final String ID = "42"; + private static final String GENERATED_ID = "42"; private static final GlobalAddressId GLOBAL_ADDRESS_ID = GlobalAddressId.of("project", "address"); private static final RegionAddressId REGION_ADDRESS_ID = RegionAddressId.of("project", "region", "address"); @@ -54,7 +54,7 @@ public class AddressInfoTest { .address(ADDRESS) .creationTimestamp(CREATION_TIMESTAMP) .description(DESCRIPTION) - .id(ID) + .generatedId(GENERATED_ID) .status(STATUS) .usage(INSTANCE_USAGE) .build(); @@ -63,7 +63,7 @@ public class AddressInfoTest { .address(ADDRESS) .creationTimestamp(CREATION_TIMESTAMP) .description(DESCRIPTION) - .id(ID) + .generatedId(GENERATED_ID) .status(STATUS) .usage(GLOBAL_FORWARDING_USAGE) .build(); @@ -72,7 +72,7 @@ public class AddressInfoTest { .address(ADDRESS) .creationTimestamp(CREATION_TIMESTAMP) .description(DESCRIPTION) - .id(ID) + .generatedId(GENERATED_ID) .status(STATUS) .usage(REGION_FORWARDING_USAGE) .build(); @@ -106,7 +106,7 @@ public void testBuilder() { assertEquals(ADDRESS, INSTANCE_ADDRESS_INFO.address()); assertEquals(CREATION_TIMESTAMP, INSTANCE_ADDRESS_INFO.creationTimestamp()); assertEquals(DESCRIPTION, INSTANCE_ADDRESS_INFO.description()); - assertEquals(ID, INSTANCE_ADDRESS_INFO.id()); + assertEquals(GENERATED_ID, INSTANCE_ADDRESS_INFO.generatedId()); assertEquals(REGION_ADDRESS_ID, INSTANCE_ADDRESS_INFO.addressId()); assertEquals(STATUS, INSTANCE_ADDRESS_INFO.status()); assertEquals(INSTANCE_USAGE, INSTANCE_ADDRESS_INFO.usage()); @@ -115,7 +115,7 @@ public void testBuilder() { assertEquals(ADDRESS, REGION_FORWARDING_ADDRESS_INFO.address()); assertEquals(CREATION_TIMESTAMP, REGION_FORWARDING_ADDRESS_INFO.creationTimestamp()); assertEquals(DESCRIPTION, REGION_FORWARDING_ADDRESS_INFO.description()); - assertEquals(ID, REGION_FORWARDING_ADDRESS_INFO.id()); + assertEquals(GENERATED_ID, REGION_FORWARDING_ADDRESS_INFO.generatedId()); assertEquals(REGION_ADDRESS_ID, REGION_FORWARDING_ADDRESS_INFO.addressId()); assertEquals(STATUS, REGION_FORWARDING_ADDRESS_INFO.status()); assertEquals(REGION_FORWARDING_USAGE, REGION_FORWARDING_ADDRESS_INFO.usage()); @@ -124,7 +124,7 @@ public void testBuilder() { assertEquals(ADDRESS, GLOBAL_FORWARDING_ADDRESS_INFO.address()); assertEquals(CREATION_TIMESTAMP, GLOBAL_FORWARDING_ADDRESS_INFO.creationTimestamp()); assertEquals(DESCRIPTION, GLOBAL_FORWARDING_ADDRESS_INFO.description()); - assertEquals(ID, GLOBAL_FORWARDING_ADDRESS_INFO.id()); + assertEquals(GENERATED_ID, GLOBAL_FORWARDING_ADDRESS_INFO.generatedId()); assertEquals(GLOBAL_ADDRESS_ID, GLOBAL_FORWARDING_ADDRESS_INFO.addressId()); assertEquals(STATUS, GLOBAL_FORWARDING_ADDRESS_INFO.status()); assertEquals(GLOBAL_FORWARDING_USAGE, GLOBAL_FORWARDING_ADDRESS_INFO.usage()); @@ -139,7 +139,7 @@ public void testOf() { assertNull(addressInfo.address()); assertNull(addressInfo.creationTimestamp()); assertNull(addressInfo.description()); - assertNull(addressInfo.id()); + assertNull(addressInfo.generatedId()); assertNull(addressInfo.status()); assertNull(addressInfo.usage()); addressInfo = AddressInfo.of(GLOBAL_ADDRESS_ID); @@ -147,7 +147,7 @@ public void testOf() { assertNull(addressInfo.address()); assertNull(addressInfo.creationTimestamp()); assertNull(addressInfo.description()); - assertNull(addressInfo.id()); + assertNull(addressInfo.generatedId()); assertNull(addressInfo.status()); assertNull(addressInfo.usage()); addressInfo = AddressInfo.of("region", "address"); @@ -155,7 +155,7 @@ public void testOf() { assertNull(addressInfo.address()); assertNull(addressInfo.creationTimestamp()); assertNull(addressInfo.description()); - assertNull(addressInfo.id()); + assertNull(addressInfo.generatedId()); assertNull(addressInfo.status()); assertNull(addressInfo.usage()); addressInfo = AddressInfo.of(RegionId.of("region"), "address"); @@ -163,7 +163,7 @@ public void testOf() { assertNull(addressInfo.address()); assertNull(addressInfo.creationTimestamp()); assertNull(addressInfo.description()); - assertNull(addressInfo.id()); + assertNull(addressInfo.generatedId()); assertNull(addressInfo.status()); assertNull(addressInfo.usage()); } @@ -192,7 +192,7 @@ private void compareAddressInfo(AddressInfo expected, AddressInfo value) { assertEquals(expected.address(), value.address()); assertEquals(expected.creationTimestamp(), value.creationTimestamp()); assertEquals(expected.description(), value.description()); - assertEquals(expected.id(), value.id()); + assertEquals(expected.generatedId(), value.generatedId()); assertEquals(expected.addressId(), value.addressId()); assertEquals(expected.usage(), value.usage()); assertEquals(expected.status(), value.status()); diff --git a/gcloud-java-compute/src/test/java/com/google/gcloud/compute/AddressTest.java b/gcloud-java-compute/src/test/java/com/google/gcloud/compute/AddressTest.java index a9404a90f755..2fe9e516f486 100644 --- a/gcloud-java-compute/src/test/java/com/google/gcloud/compute/AddressTest.java +++ b/gcloud-java-compute/src/test/java/com/google/gcloud/compute/AddressTest.java @@ -39,7 +39,7 @@ public class AddressTest { private static final String ADDRESS = "192.168.1.1"; private static final Long CREATION_TIMESTAMP = 1452602400000L; private static final String DESCRIPTION = "description"; - private static final String ID = "42"; + private static final String GENERATED_ID = "42"; private static final GlobalAddressId GLOBAL_ADDRESS_ID = GlobalAddressId.of("project", "address"); private static final RegionAddressId REGION_ADDRESS_ID = RegionAddressId.of("project", "region", "address"); @@ -72,7 +72,7 @@ private void initializeExpectedAddress(int optionsCalls) { .address(ADDRESS) .creationTimestamp(CREATION_TIMESTAMP) .description(DESCRIPTION) - .id(ID) + .generatedId(GENERATED_ID) .status(STATUS) .usage(INSTANCE_USAGE) .build(); @@ -80,7 +80,7 @@ private void initializeExpectedAddress(int optionsCalls) { .address(ADDRESS) .creationTimestamp(CREATION_TIMESTAMP) .description(DESCRIPTION) - .id(ID) + .generatedId(GENERATED_ID) .status(STATUS) .usage(GLOBAL_FORWARDING_USAGE) .build(); @@ -88,7 +88,7 @@ private void initializeExpectedAddress(int optionsCalls) { .address(ADDRESS) .creationTimestamp(CREATION_TIMESTAMP) .description(DESCRIPTION) - .id(ID) + .generatedId(GENERATED_ID) .status(STATUS) .usage(REGION_FORWARDING_USAGE) .build(); @@ -100,7 +100,7 @@ private void initializeAddress() { .address(ADDRESS) .creationTimestamp(CREATION_TIMESTAMP) .description(DESCRIPTION) - .id(ID) + .generatedId(GENERATED_ID) .status(STATUS) .usage(REGION_FORWARDING_USAGE) .build(); @@ -117,7 +117,7 @@ public void testBuilder() { assertEquals(ADDRESS, instanceAddress.address()); assertEquals(CREATION_TIMESTAMP, instanceAddress.creationTimestamp()); assertEquals(DESCRIPTION, instanceAddress.description()); - assertEquals(ID, instanceAddress.id()); + assertEquals(GENERATED_ID, instanceAddress.generatedId()); assertEquals(REGION_ADDRESS_ID, instanceAddress.addressId()); assertEquals(STATUS, instanceAddress.status()); assertEquals(INSTANCE_USAGE, instanceAddress.usage()); @@ -125,7 +125,7 @@ public void testBuilder() { assertEquals(ADDRESS, regionForwardingAddress.address()); assertEquals(CREATION_TIMESTAMP, regionForwardingAddress.creationTimestamp()); assertEquals(DESCRIPTION, regionForwardingAddress.description()); - assertEquals(ID, regionForwardingAddress.id()); + assertEquals(GENERATED_ID, regionForwardingAddress.generatedId()); assertEquals(REGION_ADDRESS_ID, regionForwardingAddress.addressId()); assertEquals(STATUS, regionForwardingAddress.status()); assertEquals(REGION_FORWARDING_USAGE, regionForwardingAddress.usage()); @@ -133,7 +133,7 @@ public void testBuilder() { assertEquals(ADDRESS, globalForwardingAddress.address()); assertEquals(CREATION_TIMESTAMP, globalForwardingAddress.creationTimestamp()); assertEquals(DESCRIPTION, globalForwardingAddress.description()); - assertEquals(ID, globalForwardingAddress.id()); + assertEquals(GENERATED_ID, globalForwardingAddress.generatedId()); assertEquals(GLOBAL_ADDRESS_ID, globalForwardingAddress.addressId()); assertEquals(STATUS, globalForwardingAddress.status()); assertEquals(GLOBAL_FORWARDING_USAGE, globalForwardingAddress.usage()); @@ -144,7 +144,7 @@ public void testBuilder() { assertNull(address.address()); assertNull(address.creationTimestamp()); assertNull(address.description()); - assertNull(address.id()); + assertNull(address.generatedId()); assertNull(address.status()); assertNull(address.usage()); address = new Address.Builder(serviceMockReturnsOptions, REGION_ADDRESS_ID).build(); @@ -153,7 +153,7 @@ public void testBuilder() { assertNull(address.address()); assertNull(address.creationTimestamp()); assertNull(address.description()); - assertNull(address.id()); + assertNull(address.generatedId()); assertNull(address.status()); assertNull(address.usage()); address = new Address.Builder(serviceMockReturnsOptions, REGION_ADDRESS_ID) @@ -164,7 +164,7 @@ public void testBuilder() { assertNull(address.address()); assertNull(address.creationTimestamp()); assertNull(address.description()); - assertNull(address.id()); + assertNull(address.generatedId()); assertNull(address.status()); assertNull(address.usage()); } @@ -285,7 +285,7 @@ private void compareAddress(Address expected, Address value) { assertEquals(expected.address(), value.address()); assertEquals(expected.creationTimestamp(), value.creationTimestamp()); assertEquals(expected.description(), value.description()); - assertEquals(expected.id(), value.id()); + assertEquals(expected.generatedId(), value.generatedId()); assertEquals(expected.addressId(), value.addressId()); assertEquals(expected.usage(), value.usage()); assertEquals(expected.status(), value.status()); diff --git a/gcloud-java-compute/src/test/java/com/google/gcloud/compute/ComputeImplTest.java b/gcloud-java-compute/src/test/java/com/google/gcloud/compute/ComputeImplTest.java index 023bd7064a3e..32cf4bba12d3 100644 --- a/gcloud-java-compute/src/test/java/com/google/gcloud/compute/ComputeImplTest.java +++ b/gcloud-java-compute/src/test/java/com/google/gcloud/compute/ComputeImplTest.java @@ -105,14 +105,14 @@ public class ComputeImplTest { private static final String PROJECT = "project"; - private static final String ID = "42"; + private static final String GENERATED_ID = "42"; private static final Long CREATION_TIMESTAMP = 1453293540000L; private static final String DESCRIPTION = "description"; private static final String VALID_DISK_SIZE = "10GB-10TB"; private static final Long DEFAULT_DISK_SIZE_GB = 10L; private static final DiskTypeId DISK_TYPE_ID = DiskTypeId.of("project", "zone", "diskType"); private static final DiskType DISK_TYPE = DiskType.builder() - .id(ID) + .generatedId(GENERATED_ID) .diskTypeId(DISK_TYPE_ID) .creationTimestamp(CREATION_TIMESTAMP) .description(DESCRIPTION) @@ -126,7 +126,7 @@ public class ComputeImplTest { private static final Integer MAXIMUM_PERSISTENT_DISKS = 4; private static final Long MAXIMUM_PERSISTENT_DISKS_SIZE_GB = 5L; private static final MachineType MACHINE_TYPE = MachineType.builder() - .id(ID) + .generatedId(GENERATED_ID) .machineTypeId(MACHINE_TYPE_ID) .creationTimestamp(CREATION_TIMESTAMP) .description(DESCRIPTION) @@ -148,7 +148,7 @@ public class ComputeImplTest { private static final List QUOTAS = ImmutableList.of(QUOTA1, QUOTA2); private static final Region REGION = Region.builder() .regionId(REGION_ID) - .id(ID) + .generatedId(GENERATED_ID) .creationTimestamp(CREATION_TIMESTAMP) .description(DESCRIPTION) .status(REGION_STATUS) @@ -159,7 +159,7 @@ public class ComputeImplTest { private static final Zone.Status ZONE_STATUS = Zone.Status.DOWN; private static final Zone ZONE = Zone.builder() .zoneId(ZONE_ID) - .id(ID) + .generatedId(GENERATED_ID) .creationTimestamp(CREATION_TIMESTAMP) .description(DESCRIPTION) .status(ZONE_STATUS) @@ -526,7 +526,7 @@ public void setUp() { .build(); Compute otherService = options.toBuilder().build().service(); globalOperation = new Operation.Builder(otherService) - .id(ID) + .generatedId(GENERATED_ID) .operationId(GLOBAL_OPERATION_ID) .clientOperationId(CLIENT_OPERATION_ID) .operationType(OPERATION_TYPE) @@ -546,7 +546,7 @@ public void setUp() { .description(DESCRIPTION) .build(); zoneOperation = new Operation.Builder(otherService) - .id(ID) + .generatedId(GENERATED_ID) .operationId(ZONE_OPERATION_ID) .clientOperationId(CLIENT_OPERATION_ID) .operationType(OPERATION_TYPE) @@ -566,7 +566,7 @@ public void setUp() { .description(DESCRIPTION) .build(); regionOperation = new Operation.Builder(otherService) - .id(ID) + .generatedId(GENERATED_ID) .operationId(REGION_OPERATION_ID) .clientOperationId(CLIENT_OPERATION_ID) .operationType(OPERATION_TYPE) diff --git a/gcloud-java-compute/src/test/java/com/google/gcloud/compute/DiskInfoTest.java b/gcloud-java-compute/src/test/java/com/google/gcloud/compute/DiskInfoTest.java index 69919a871a49..4011af7eb04f 100644 --- a/gcloud-java-compute/src/test/java/com/google/gcloud/compute/DiskInfoTest.java +++ b/gcloud-java-compute/src/test/java/com/google/gcloud/compute/DiskInfoTest.java @@ -29,7 +29,7 @@ public class DiskInfoTest { - private static final String ID = "42"; + private static final String GENERATED_ID = "42"; private static final DiskId DISK_ID = DiskId.of("project", "zone", "disk"); private static final Long CREATION_TIMESTAMP = 1453293540000L; private static final CreationStatus CREATION_STATUS = CreationStatus.READY; @@ -65,7 +65,7 @@ public class DiskInfoTest { .sourceImageId(IMAGE_ID) .build(); private static final DiskInfo DISK_INFO = DiskInfo.builder(DISK_ID, DISK_CONFIGURATION) - .id(ID) + .generatedId(GENERATED_ID) .creationTimestamp(CREATION_TIMESTAMP) .creationStatus(CREATION_STATUS) .description(DESCRIPTION) @@ -76,7 +76,7 @@ public class DiskInfoTest { .build(); private static final DiskInfo SNAPSHOT_DISK_INFO = DiskInfo.builder(DISK_ID, SNAPSHOT_DISK_CONFIGURATION) - .id(ID) + .generatedId(GENERATED_ID) .creationTimestamp(CREATION_TIMESTAMP) .creationStatus(CREATION_STATUS) .description(DESCRIPTION) @@ -87,7 +87,7 @@ public class DiskInfoTest { .build(); private static final DiskInfo IMAGE_DISK_INFO = DiskInfo.builder(DISK_ID, IMAGE_DISK_CONFIGURATION) - .id(ID) + .generatedId(GENERATED_ID) .creationTimestamp(CREATION_TIMESTAMP) .creationStatus(CREATION_STATUS) .description(DESCRIPTION) @@ -120,7 +120,7 @@ public void testToBuilderIncomplete() { @Test public void testBuilder() { - assertEquals(ID, DISK_INFO.id()); + assertEquals(GENERATED_ID, DISK_INFO.generatedId()); assertEquals(DISK_ID, DISK_INFO.diskId()); assertEquals(DISK_CONFIGURATION, DISK_INFO.configuration()); assertEquals(CREATION_TIMESTAMP, DISK_INFO.creationTimestamp()); @@ -130,7 +130,7 @@ public void testBuilder() { assertEquals(ATTACHED_INSTANCES, DISK_INFO.attachedInstances()); assertEquals(LAST_ATTACH_TIMESTAMP, DISK_INFO.lastAttachTimestamp()); assertEquals(LAST_DETACH_TIMESTAMP, DISK_INFO.lastDetachTimestamp()); - assertEquals(ID, IMAGE_DISK_INFO.id()); + assertEquals(GENERATED_ID, IMAGE_DISK_INFO.generatedId()); assertEquals(DISK_ID, IMAGE_DISK_INFO.diskId()); assertEquals(IMAGE_DISK_CONFIGURATION, IMAGE_DISK_INFO.configuration()); assertEquals(CREATION_TIMESTAMP, IMAGE_DISK_INFO.creationTimestamp()); @@ -140,7 +140,7 @@ public void testBuilder() { assertEquals(ATTACHED_INSTANCES, IMAGE_DISK_INFO.attachedInstances()); assertEquals(LAST_ATTACH_TIMESTAMP, IMAGE_DISK_INFO.lastAttachTimestamp()); assertEquals(LAST_DETACH_TIMESTAMP, IMAGE_DISK_INFO.lastDetachTimestamp()); - assertEquals(ID, SNAPSHOT_DISK_INFO.id()); + assertEquals(GENERATED_ID, SNAPSHOT_DISK_INFO.generatedId()); assertEquals(DISK_ID, SNAPSHOT_DISK_INFO.diskId()); assertEquals(SNAPSHOT_DISK_CONFIGURATION, SNAPSHOT_DISK_INFO.configuration()); assertEquals(CREATION_TIMESTAMP, SNAPSHOT_DISK_INFO.creationTimestamp()); @@ -155,7 +155,7 @@ public void testBuilder() { @Test public void testOf() { DiskInfo diskInfo = DiskInfo.of(DISK_ID, DISK_CONFIGURATION); - assertNull(diskInfo.id()); + assertNull(diskInfo.generatedId()); assertEquals(DISK_ID, diskInfo.diskId()); assertEquals(DISK_CONFIGURATION, diskInfo.configuration()); assertNull(diskInfo.creationTimestamp()); @@ -166,7 +166,7 @@ public void testOf() { assertNull(diskInfo.lastAttachTimestamp()); assertNull(diskInfo.lastDetachTimestamp()); diskInfo = DiskInfo.of(DISK_ID, IMAGE_DISK_CONFIGURATION); - assertNull(diskInfo.id()); + assertNull(diskInfo.generatedId()); assertEquals(DISK_ID, diskInfo.diskId()); assertEquals(IMAGE_DISK_CONFIGURATION, diskInfo.configuration()); assertNull(diskInfo.creationTimestamp()); @@ -177,7 +177,7 @@ public void testOf() { assertNull(diskInfo.lastAttachTimestamp()); assertNull(diskInfo.lastDetachTimestamp()); diskInfo = DiskInfo.of(DISK_ID, SNAPSHOT_DISK_CONFIGURATION); - assertNull(diskInfo.id()); + assertNull(diskInfo.generatedId()); assertEquals(DISK_ID, diskInfo.diskId()); assertEquals(SNAPSHOT_DISK_CONFIGURATION, diskInfo.configuration()); assertNull(diskInfo.creationTimestamp()); @@ -254,7 +254,7 @@ public void testSetProjectId() { public void compareDiskInfo(DiskInfo expected, DiskInfo value) { assertEquals(expected, value); assertEquals(expected.configuration(), value.configuration()); - assertEquals(expected.id(), value.id()); + assertEquals(expected.generatedId(), value.generatedId()); assertEquals(expected.diskId(), value.diskId()); assertEquals(expected.creationTimestamp(), value.creationTimestamp()); assertEquals(expected.creationStatus(), value.creationStatus()); diff --git a/gcloud-java-compute/src/test/java/com/google/gcloud/compute/DiskTest.java b/gcloud-java-compute/src/test/java/com/google/gcloud/compute/DiskTest.java index 8915a7894147..8b54a1ea2715 100644 --- a/gcloud-java-compute/src/test/java/com/google/gcloud/compute/DiskTest.java +++ b/gcloud-java-compute/src/test/java/com/google/gcloud/compute/DiskTest.java @@ -36,7 +36,7 @@ public class DiskTest { - private static final String ID = "42"; + private static final String GENERATED_ID = "42"; private static final DiskId DISK_ID = DiskId.of("project", "zone", "disk"); private static final Long CREATION_TIMESTAMP = 1453293540000L; private static final CreationStatus CREATION_STATUS = CreationStatus.READY; @@ -84,7 +84,7 @@ private void initializeExpectedDisk(int optionsCalls) { expect(serviceMockReturnsOptions.options()).andReturn(mockOptions).times(optionsCalls); replay(serviceMockReturnsOptions); standardDisk = new Disk.Builder(serviceMockReturnsOptions, DISK_ID, DISK_CONFIGURATION) - .id(ID) + .generatedId(GENERATED_ID) .creationTimestamp(CREATION_TIMESTAMP) .creationStatus(CREATION_STATUS) .description(DESCRIPTION) @@ -94,7 +94,7 @@ private void initializeExpectedDisk(int optionsCalls) { .lastDetachTimestamp(LAST_DETACH_TIMESTAMP) .build(); snapshotDisk = new Disk.Builder(serviceMockReturnsOptions, DISK_ID, SNAPSHOT_DISK_CONFIGURATION) - .id(ID) + .generatedId(GENERATED_ID) .creationTimestamp(CREATION_TIMESTAMP) .creationStatus(CREATION_STATUS) .description(DESCRIPTION) @@ -104,7 +104,7 @@ private void initializeExpectedDisk(int optionsCalls) { .lastDetachTimestamp(LAST_DETACH_TIMESTAMP) .build(); imageDisk = new Disk.Builder(serviceMockReturnsOptions, DISK_ID, IMAGE_DISK_CONFIGURATION) - .id(ID) + .generatedId(GENERATED_ID) .creationTimestamp(CREATION_TIMESTAMP) .creationStatus(CREATION_STATUS) .description(DESCRIPTION) @@ -118,7 +118,7 @@ private void initializeExpectedDisk(int optionsCalls) { private void initializeDisk() { disk = new Disk.Builder(compute, DISK_ID, DISK_CONFIGURATION) - .id(ID) + .generatedId(GENERATED_ID) .creationTimestamp(CREATION_TIMESTAMP) .creationStatus(CREATION_STATUS) .description(DESCRIPTION) @@ -157,7 +157,7 @@ public void testToBuilderIncomplete() { public void testBuilder() { initializeExpectedDisk(4); assertEquals(DISK_ID, standardDisk.diskId()); - assertEquals(ID, standardDisk.id()); + assertEquals(GENERATED_ID, standardDisk.generatedId()); assertEquals(DISK_CONFIGURATION, standardDisk.configuration()); assertEquals(CREATION_TIMESTAMP, standardDisk.creationTimestamp()); assertEquals(CREATION_STATUS, standardDisk.creationStatus()); @@ -168,7 +168,7 @@ public void testBuilder() { assertEquals(LAST_DETACH_TIMESTAMP, standardDisk.lastDetachTimestamp()); assertSame(serviceMockReturnsOptions, standardDisk.compute()); assertEquals(DISK_ID, imageDisk.diskId()); - assertEquals(ID, imageDisk.id()); + assertEquals(GENERATED_ID, imageDisk.generatedId()); assertEquals(IMAGE_DISK_CONFIGURATION, imageDisk.configuration()); assertEquals(CREATION_TIMESTAMP, imageDisk.creationTimestamp()); assertEquals(CREATION_STATUS, imageDisk.creationStatus()); @@ -179,7 +179,7 @@ public void testBuilder() { assertEquals(LAST_DETACH_TIMESTAMP, imageDisk.lastDetachTimestamp()); assertSame(serviceMockReturnsOptions, imageDisk.compute()); assertEquals(DISK_ID, snapshotDisk.diskId()); - assertEquals(ID, snapshotDisk.id()); + assertEquals(GENERATED_ID, snapshotDisk.generatedId()); assertEquals(SNAPSHOT_DISK_CONFIGURATION, snapshotDisk.configuration()); assertEquals(CREATION_TIMESTAMP, snapshotDisk.creationTimestamp()); assertEquals(CREATION_STATUS, snapshotDisk.creationStatus()); @@ -194,7 +194,7 @@ public void testBuilder() { .configuration(SNAPSHOT_DISK_CONFIGURATION) .build(); assertEquals(DiskId.of("newProject", "newZone"), disk.diskId()); - assertNull(disk.id()); + assertNull(disk.generatedId()); assertEquals(SNAPSHOT_DISK_CONFIGURATION, disk.configuration()); assertNull(disk.creationTimestamp()); assertNull(disk.creationStatus()); @@ -462,7 +462,7 @@ public void compareDisk(Disk expected, Disk value) { assertEquals(expected.compute().options(), value.compute().options()); assertEquals(expected.diskId(), value.diskId()); assertEquals(expected.configuration(), value.configuration()); - assertEquals(expected.id(), value.id()); + assertEquals(expected.generatedId(), value.generatedId()); assertEquals(expected.creationTimestamp(), value.creationTimestamp()); assertEquals(expected.creationStatus(), value.creationStatus()); assertEquals(expected.description(), value.description()); diff --git a/gcloud-java-compute/src/test/java/com/google/gcloud/compute/DiskTypeTest.java b/gcloud-java-compute/src/test/java/com/google/gcloud/compute/DiskTypeTest.java index 4cbb8351270c..f322a4b05ed0 100644 --- a/gcloud-java-compute/src/test/java/com/google/gcloud/compute/DiskTypeTest.java +++ b/gcloud-java-compute/src/test/java/com/google/gcloud/compute/DiskTypeTest.java @@ -22,7 +22,7 @@ public class DiskTypeTest { - private static final String ID = "42"; + private static final String GENERATED_ID = "42"; private static final Long CREATION_TIMESTAMP = 1453293540000L; private static final String DESCRIPTION = "description"; private static final String VALID_DISK_SIZE = "10GB-10TB"; @@ -31,7 +31,7 @@ public class DiskTypeTest { private static final DeprecationStatus DEPRECATION_STATUS = DeprecationStatus.of(DeprecationStatus.Status.DELETED, DISK_TYPE_ID); private static final DiskType DISK_TYPE = DiskType.builder() - .id(ID) + .generatedId(GENERATED_ID) .diskTypeId(DISK_TYPE_ID) .creationTimestamp(CREATION_TIMESTAMP) .description(DESCRIPTION) @@ -42,7 +42,7 @@ public class DiskTypeTest { @Test public void testBuilder() { - assertEquals(ID, DISK_TYPE.id()); + assertEquals(GENERATED_ID, DISK_TYPE.generatedId()); assertEquals(DISK_TYPE_ID, DISK_TYPE.diskTypeId()); assertEquals(CREATION_TIMESTAMP, DISK_TYPE.creationTimestamp()); assertEquals(DESCRIPTION, DISK_TYPE.description()); @@ -60,7 +60,7 @@ public void testToPbAndFromPb() { private void compareDiskTypes(DiskType expected, DiskType value) { assertEquals(expected, value); - assertEquals(expected.id(), value.id()); + assertEquals(expected.generatedId(), value.generatedId()); assertEquals(expected.diskTypeId(), value.diskTypeId()); assertEquals(expected.creationTimestamp(), value.creationTimestamp()); assertEquals(expected.description(), value.description()); diff --git a/gcloud-java-compute/src/test/java/com/google/gcloud/compute/ImageInfoTest.java b/gcloud-java-compute/src/test/java/com/google/gcloud/compute/ImageInfoTest.java index db6e092b5587..a0c9ca6bc134 100644 --- a/gcloud-java-compute/src/test/java/com/google/gcloud/compute/ImageInfoTest.java +++ b/gcloud-java-compute/src/test/java/com/google/gcloud/compute/ImageInfoTest.java @@ -29,7 +29,7 @@ public class ImageInfoTest { private static final ImageId IMAGE_ID = ImageId.of("project", "image"); - private static final String ID = "42"; + private static final String GENERATED_ID = "42"; private static final Long CREATION_TIMESTAMP = 1453293540000L; private static final String DESCRIPTION = "description"; private static final ImageInfo.Status STATUS = ImageInfo.Status.READY; @@ -58,7 +58,7 @@ public class ImageInfoTest { private static final DeprecationStatus DEPRECATION_STATUS = DeprecationStatus.of(DeprecationStatus.Status.DELETED, IMAGE_ID); private static final ImageInfo STORAGE_IMAGE = ImageInfo.builder(IMAGE_ID, STORAGE_CONFIGURATION) - .id(ID) + .generatedId(GENERATED_ID) .creationTimestamp(CREATION_TIMESTAMP) .description(DESCRIPTION) .status(STATUS) @@ -67,7 +67,7 @@ public class ImageInfoTest { .deprecationStatus(DEPRECATION_STATUS) .build(); private static final ImageInfo DISK_IMAGE = ImageInfo.builder(IMAGE_ID, DISK_CONFIGURATION) - .id(ID) + .generatedId(GENERATED_ID) .creationTimestamp(CREATION_TIMESTAMP) .description(DESCRIPTION) .status(STATUS) @@ -96,7 +96,7 @@ public void testToBuilderIncomplete() { @Test public void testBuilder() { - assertEquals(ID, STORAGE_IMAGE.id()); + assertEquals(GENERATED_ID, STORAGE_IMAGE.generatedId()); assertEquals(IMAGE_ID, STORAGE_IMAGE.imageId()); assertEquals(CREATION_TIMESTAMP, STORAGE_IMAGE.creationTimestamp()); assertEquals(DESCRIPTION, STORAGE_IMAGE.description()); @@ -105,7 +105,7 @@ public void testBuilder() { assertEquals(DISK_SIZE_GB, STORAGE_IMAGE.diskSizeGb()); assertEquals(LICENSES, STORAGE_IMAGE.licenses()); assertEquals(DEPRECATION_STATUS, STORAGE_IMAGE.deprecationStatus()); - assertEquals(ID, DISK_IMAGE.id()); + assertEquals(GENERATED_ID, DISK_IMAGE.generatedId()); assertEquals(IMAGE_ID, DISK_IMAGE.imageId()); assertEquals(CREATION_TIMESTAMP, DISK_IMAGE.creationTimestamp()); assertEquals(DESCRIPTION, DISK_IMAGE.description()); @@ -121,7 +121,7 @@ public void testOf() { ImageInfo imageInfo = ImageInfo.of(IMAGE_ID, STORAGE_CONFIGURATION); assertEquals(IMAGE_ID, imageInfo.imageId()); assertEquals(STORAGE_CONFIGURATION, imageInfo.configuration()); - assertNull(imageInfo.id()); + assertNull(imageInfo.generatedId()); assertNull(imageInfo.creationTimestamp()); assertNull(imageInfo.description()); assertNull(imageInfo.status()); @@ -131,7 +131,7 @@ public void testOf() { imageInfo = ImageInfo.of(IMAGE_ID, DISK_CONFIGURATION); assertEquals(IMAGE_ID, imageInfo.imageId()); assertEquals(DISK_CONFIGURATION, imageInfo.configuration()); - assertNull(imageInfo.id()); + assertNull(imageInfo.generatedId()); assertNull(imageInfo.creationTimestamp()); assertNull(imageInfo.description()); assertNull(imageInfo.status()); @@ -161,7 +161,7 @@ public void testSetProjectId() { public void compareImageInfo(ImageInfo expected, ImageInfo value) { assertEquals(expected, value); - assertEquals(expected.id(), value.id()); + assertEquals(expected.generatedId(), value.generatedId()); assertEquals(expected.imageId(), value.imageId()); assertEquals(expected.creationTimestamp(), value.creationTimestamp()); assertEquals(expected.description(), value.description()); diff --git a/gcloud-java-compute/src/test/java/com/google/gcloud/compute/ImageTest.java b/gcloud-java-compute/src/test/java/com/google/gcloud/compute/ImageTest.java index dcf7e2513e07..43e27d011974 100644 --- a/gcloud-java-compute/src/test/java/com/google/gcloud/compute/ImageTest.java +++ b/gcloud-java-compute/src/test/java/com/google/gcloud/compute/ImageTest.java @@ -38,7 +38,7 @@ public class ImageTest { private static final ImageId IMAGE_ID = ImageId.of("project", "image"); - private static final String ID = "42"; + private static final String GENERATED_ID = "42"; private static final Long CREATION_TIMESTAMP = 1453293540000L; private static final String DESCRIPTION = "description"; private static final ImageInfo.Status STATUS = ImageInfo.Status.READY; @@ -78,7 +78,7 @@ private void initializeExpectedImage(int optionsCalls) { expect(serviceMockReturnsOptions.options()).andReturn(mockOptions).times(optionsCalls); replay(serviceMockReturnsOptions); diskImage = new Image.Builder(serviceMockReturnsOptions, IMAGE_ID, DISK_CONFIGURATION) - .id(ID) + .generatedId(GENERATED_ID) .creationTimestamp(CREATION_TIMESTAMP) .description(DESCRIPTION) .status(STATUS) @@ -87,7 +87,7 @@ private void initializeExpectedImage(int optionsCalls) { .deprecationStatus(DEPRECATION_STATUS) .build(); storageImage = new Image.Builder(serviceMockReturnsOptions, IMAGE_ID, STORAGE_CONFIGURATION) - .id(ID) + .generatedId(GENERATED_ID) .creationTimestamp(CREATION_TIMESTAMP) .description(DESCRIPTION) .status(STATUS) @@ -100,7 +100,7 @@ private void initializeExpectedImage(int optionsCalls) { private void initializeImage() { image = new Image.Builder(compute, IMAGE_ID, DISK_CONFIGURATION) - .id(ID) + .generatedId(GENERATED_ID) .creationTimestamp(CREATION_TIMESTAMP) .description(DESCRIPTION) .status(STATUS) @@ -133,7 +133,7 @@ public void testToBuilderIncomplete() { @Test public void testBuilder() { initializeExpectedImage(3); - assertEquals(ID, diskImage.id()); + assertEquals(GENERATED_ID, diskImage.generatedId()); assertEquals(IMAGE_ID, diskImage.imageId()); assertEquals(CREATION_TIMESTAMP, diskImage.creationTimestamp()); assertEquals(DESCRIPTION, diskImage.description()); @@ -143,7 +143,7 @@ public void testBuilder() { assertEquals(LICENSES, diskImage.licenses()); assertEquals(DEPRECATION_STATUS, diskImage.deprecationStatus()); assertSame(serviceMockReturnsOptions, diskImage.compute()); - assertEquals(ID, storageImage.id()); + assertEquals(GENERATED_ID, storageImage.generatedId()); assertEquals(IMAGE_ID, storageImage.imageId()); assertEquals(CREATION_TIMESTAMP, storageImage.creationTimestamp()); assertEquals(DESCRIPTION, storageImage.description()); @@ -158,7 +158,7 @@ public void testBuilder() { .imageId(imageId) .configuration(DISK_CONFIGURATION) .build(); - assertNull(image.id()); + assertNull(image.generatedId()); assertEquals(imageId, image.imageId()); assertNull(image.creationTimestamp()); assertNull(image.description()); @@ -292,7 +292,7 @@ public void testDeprecateNull() { public void compareImage(Image expected, Image value) { assertEquals(expected, value); assertEquals(expected.compute().options(), value.compute().options()); - assertEquals(expected.id(), value.id()); + assertEquals(expected.generatedId(), value.generatedId()); assertEquals(expected.imageId(), value.imageId()); assertEquals(expected.creationTimestamp(), value.creationTimestamp()); assertEquals(expected.description(), value.description()); diff --git a/gcloud-java-compute/src/test/java/com/google/gcloud/compute/InstanceInfoTest.java b/gcloud-java-compute/src/test/java/com/google/gcloud/compute/InstanceInfoTest.java index 51b2dcb91c72..be0a866e0df7 100644 --- a/gcloud-java-compute/src/test/java/com/google/gcloud/compute/InstanceInfoTest.java +++ b/gcloud-java-compute/src/test/java/com/google/gcloud/compute/InstanceInfoTest.java @@ -28,7 +28,7 @@ public class InstanceInfoTest { - private static final String ID = "42"; + private static final String GENERATED_ID = "42"; private static final Long CREATION_TIMESTAMP = 1453293540000L; private static final String DESCRIPTION = "description"; private static final InstanceId INSTANCE_ID = InstanceId.of("project", "zone", "instance"); @@ -55,7 +55,7 @@ public class InstanceInfoTest { private static final SchedulingOptions SCHEDULING_OPTIONS = SchedulingOptions.preemptible(); private static final String CPU_PLATFORM = "cpuPlatform"; private static final InstanceInfo INSTANCE_INFO = InstanceInfo.builder(INSTANCE_ID, MACHINE_TYPE) - .id(ID) + .generatedId(GENERATED_ID) .creationTimestamp(CREATION_TIMESTAMP) .description(DESCRIPTION) .status(STATUS) @@ -88,7 +88,7 @@ public void testToBuilderIncomplete() { @Test public void testBuilder() { - assertEquals(ID, INSTANCE_INFO.id()); + assertEquals(GENERATED_ID, INSTANCE_INFO.generatedId()); assertEquals(INSTANCE_ID, INSTANCE_INFO.instanceId()); assertEquals(CREATION_TIMESTAMP, INSTANCE_INFO.creationTimestamp()); assertEquals(DESCRIPTION, INSTANCE_INFO.description()); @@ -104,7 +104,7 @@ public void testBuilder() { assertEquals(SCHEDULING_OPTIONS, INSTANCE_INFO.schedulingOptions()); assertEquals(CPU_PLATFORM, INSTANCE_INFO.cpuPlatform()); InstanceInfo instanceInfo = InstanceInfo.builder(INSTANCE_ID, MACHINE_TYPE) - .id(ID) + .generatedId(GENERATED_ID) .creationTimestamp(CREATION_TIMESTAMP) .description(DESCRIPTION) .status(STATUS) @@ -125,7 +125,7 @@ public void testBuilder() { public void testOf() { InstanceInfo instance = InstanceInfo.of(INSTANCE_ID, MACHINE_TYPE, ATTACHED_DISK, NETWORK_INTERFACE); - assertNull(instance.id()); + assertNull(instance.generatedId()); assertEquals(INSTANCE_ID, instance.instanceId()); assertNull(instance.creationTimestamp()); assertNull(instance.description()); @@ -164,7 +164,7 @@ public void testSetProjectId() { public void compareInstanceInfo(InstanceInfo expected, InstanceInfo value) { assertEquals(expected, value); - assertEquals(expected.id(), value.id()); + assertEquals(expected.generatedId(), value.generatedId()); assertEquals(expected.instanceId(), value.instanceId()); assertEquals(expected.creationTimestamp(), value.creationTimestamp()); assertEquals(expected.description(), value.description()); diff --git a/gcloud-java-compute/src/test/java/com/google/gcloud/compute/InstanceTest.java b/gcloud-java-compute/src/test/java/com/google/gcloud/compute/InstanceTest.java index 880ed68f63ab..85e2ff5311c0 100644 --- a/gcloud-java-compute/src/test/java/com/google/gcloud/compute/InstanceTest.java +++ b/gcloud-java-compute/src/test/java/com/google/gcloud/compute/InstanceTest.java @@ -42,7 +42,7 @@ public class InstanceTest { - private static final String ID = "42"; + private static final String GENERATED_ID = "42"; private static final Long CREATION_TIMESTAMP = 1453293540000L; private static final String DESCRIPTION = "description"; private static final InstanceId INSTANCE_ID = InstanceId.of("project", "zone", "instance"); @@ -85,7 +85,7 @@ private void initializeExpectedInstance(int optionsCalls) { replay(serviceMockReturnsOptions); expectedInstance = new Instance.Builder(serviceMockReturnsOptions, INSTANCE_ID, MACHINE_TYPE, ATTACHED_DISK, NETWORK_INTERFACE) - .id(ID) + .generatedId(GENERATED_ID) .creationTimestamp(CREATION_TIMESTAMP) .description(DESCRIPTION) .status(STATUS) @@ -103,7 +103,7 @@ private void initializeExpectedInstance(int optionsCalls) { private void initializeInstance() { instance = new Instance.Builder(compute, INSTANCE_ID, MACHINE_TYPE, ATTACHED_DISK, NETWORK_INTERFACE) - .id(ID) + .generatedId(GENERATED_ID) .creationTimestamp(CREATION_TIMESTAMP) .description(DESCRIPTION) .status(STATUS) @@ -140,7 +140,7 @@ public void testToBuilderIncomplete() { @Test public void testBuilder() { initializeExpectedInstance(2); - assertEquals(ID, expectedInstance.id()); + assertEquals(GENERATED_ID, expectedInstance.generatedId()); assertEquals(INSTANCE_ID, expectedInstance.instanceId()); assertEquals(CREATION_TIMESTAMP, expectedInstance.creationTimestamp()); assertEquals(DESCRIPTION, expectedInstance.description()); @@ -160,7 +160,7 @@ public void testBuilder() { InstanceInfo.of(INSTANCE_ID, MACHINE_TYPE, ATTACHED_DISK, NETWORK_INTERFACE); Instance instance = new Instance(serviceMockReturnsOptions, new InstanceInfo.BuilderImpl(instanceInfo)); - assertNull(instance.id()); + assertNull(instance.generatedId()); assertEquals(INSTANCE_ID, instance.instanceId()); assertNull(instance.creationTimestamp()); assertNull(instance.description()); @@ -875,7 +875,7 @@ public void testStopNull() { public void compareInstance(Instance expected, Instance value) { assertEquals(expected, value); assertEquals(expected.compute().options(), value.compute().options()); - assertEquals(expected.id(), value.id()); + assertEquals(expected.generatedId(), value.generatedId()); assertEquals(expected.instanceId(), value.instanceId()); assertEquals(expected.creationTimestamp(), value.creationTimestamp()); assertEquals(expected.description(), value.description()); diff --git a/gcloud-java-compute/src/test/java/com/google/gcloud/compute/MachineTypeTest.java b/gcloud-java-compute/src/test/java/com/google/gcloud/compute/MachineTypeTest.java index 6b0f78dff00a..f57f35a8ec3b 100644 --- a/gcloud-java-compute/src/test/java/com/google/gcloud/compute/MachineTypeTest.java +++ b/gcloud-java-compute/src/test/java/com/google/gcloud/compute/MachineTypeTest.java @@ -26,7 +26,7 @@ public class MachineTypeTest { - private static final String ID = "42"; + private static final String GENERATED_ID = "42"; private static final Long CREATION_TIMESTAMP = 1453293540000L; private static final String DESCRIPTION = "description"; private static final MachineTypeId MACHINE_TYPE_ID = MachineTypeId.of("project", "zone", "type"); @@ -38,7 +38,7 @@ public class MachineTypeTest { private static final DeprecationStatus DEPRECATION_STATUS = DeprecationStatus.of(DeprecationStatus.Status.DELETED, MACHINE_TYPE_ID); private static final MachineType MACHINE_TYPE = MachineType.builder() - .id(ID) + .generatedId(GENERATED_ID) .machineTypeId(MACHINE_TYPE_ID) .creationTimestamp(CREATION_TIMESTAMP) .description(DESCRIPTION) @@ -52,7 +52,7 @@ public class MachineTypeTest { @Test public void testBuilder() { - assertEquals(ID, MACHINE_TYPE.id()); + assertEquals(GENERATED_ID, MACHINE_TYPE.generatedId()); assertEquals(MACHINE_TYPE_ID, MACHINE_TYPE.machineTypeId()); assertEquals(CREATION_TIMESTAMP, MACHINE_TYPE.creationTimestamp()); assertEquals(DESCRIPTION, MACHINE_TYPE.description()); @@ -74,7 +74,7 @@ public void testToPbAndFromPb() { private void compareMachineTypes(MachineType expected, MachineType value) { assertEquals(expected, value); assertEquals(expected.machineTypeId(), value.machineTypeId()); - assertEquals(expected.id(), value.id()); + assertEquals(expected.generatedId(), value.generatedId()); assertEquals(expected.creationTimestamp(), value.creationTimestamp()); assertEquals(expected.description(), value.description()); assertEquals(expected.cpus(), value.cpus()); diff --git a/gcloud-java-compute/src/test/java/com/google/gcloud/compute/NetworkInfoTest.java b/gcloud-java-compute/src/test/java/com/google/gcloud/compute/NetworkInfoTest.java index 3886e13816fe..a57ee91901b8 100644 --- a/gcloud-java-compute/src/test/java/com/google/gcloud/compute/NetworkInfoTest.java +++ b/gcloud-java-compute/src/test/java/com/google/gcloud/compute/NetworkInfoTest.java @@ -27,7 +27,7 @@ public class NetworkInfoTest { - private static final String ID = "42"; + private static final String GENERATED_ID = "42"; private static final Long CREATION_TIMESTAMP = 1453293540000L; private static final String DESCRIPTION = "description"; private static final SubnetworkId SUBNETWORK1 = SubnetworkId.of("project", "region1", "network1"); @@ -43,13 +43,13 @@ public class NetworkInfoTest { new SubnetNetworkConfiguration(AUTO_CREATE_SUBNETWORKS, SUBNETWORKS); private static final NetworkInfo NETWORK_INFO = NetworkInfo.builder(NETWORK_ID, NETWORK_CONFIGURATION) - .id(ID) + .generatedId(GENERATED_ID) .creationTimestamp(CREATION_TIMESTAMP) .description(DESCRIPTION) .build(); private static final NetworkInfo SUBNET_NETWORK_INFO = NetworkInfo.builder(NETWORK_ID, SUBNET_NETWORK_CONFIGURATION) - .id(ID) + .generatedId(GENERATED_ID) .creationTimestamp(CREATION_TIMESTAMP) .description(DESCRIPTION) .build(); @@ -76,12 +76,12 @@ public void testToBuilderIncomplete() { @Test public void testBuilder() { - assertEquals(ID, NETWORK_INFO.id()); + assertEquals(GENERATED_ID, NETWORK_INFO.generatedId()); assertEquals(NETWORK_ID, NETWORK_INFO.networkId()); assertEquals(CREATION_TIMESTAMP, NETWORK_INFO.creationTimestamp()); assertEquals(DESCRIPTION, NETWORK_INFO.description()); assertEquals(NETWORK_CONFIGURATION, NETWORK_INFO.configuration()); - assertEquals(ID, SUBNET_NETWORK_INFO.id()); + assertEquals(GENERATED_ID, SUBNET_NETWORK_INFO.generatedId()); assertEquals(NETWORK_ID, SUBNET_NETWORK_INFO.networkId()); assertEquals(CREATION_TIMESTAMP, SUBNET_NETWORK_INFO.creationTimestamp()); assertEquals(DESCRIPTION, SUBNET_NETWORK_INFO.description()); @@ -91,7 +91,7 @@ public void testBuilder() { @Test public void testOf() { NetworkInfo networkInfo = NetworkInfo.of(NETWORK_ID, NETWORK_CONFIGURATION); - assertNull(networkInfo.id()); + assertNull(networkInfo.generatedId()); assertEquals(NETWORK_ID, NETWORK_INFO.networkId()); assertEquals(NETWORK_CONFIGURATION, NETWORK_INFO.configuration()); assertNull(networkInfo.creationTimestamp()); @@ -116,7 +116,7 @@ public void testSetProjectId() { public void compareNetworkInfo(NetworkInfo expected, NetworkInfo value) { assertEquals(expected, value); - assertEquals(expected.id(), value.id()); + assertEquals(expected.generatedId(), value.generatedId()); assertEquals(expected.networkId(), value.networkId()); assertEquals(expected.creationTimestamp(), value.creationTimestamp()); assertEquals(expected.description(), value.description()); diff --git a/gcloud-java-compute/src/test/java/com/google/gcloud/compute/NetworkTest.java b/gcloud-java-compute/src/test/java/com/google/gcloud/compute/NetworkTest.java index 3d303702ecc4..21978180f3b6 100644 --- a/gcloud-java-compute/src/test/java/com/google/gcloud/compute/NetworkTest.java +++ b/gcloud-java-compute/src/test/java/com/google/gcloud/compute/NetworkTest.java @@ -35,7 +35,7 @@ public class NetworkTest { - private static final String ID = "42"; + private static final String GENERATED_ID = "42"; private static final Long CREATION_TIMESTAMP = 1453293540000L; private static final String DESCRIPTION = "description"; private static final SubnetworkId SUBNETWORK1 = SubnetworkId.of("project", "region1", "network1"); @@ -62,13 +62,13 @@ private void initializeExpectedNetwork(int optionsCalls) { replay(serviceMockReturnsOptions); standardNetwork = new Network.Builder(serviceMockReturnsOptions, NETWORK_ID, NETWORK_CONFIGURATION) - .id(ID) + .generatedId(GENERATED_ID) .creationTimestamp(CREATION_TIMESTAMP) .description(DESCRIPTION) .build(); subnetNetwork = new Network.Builder(serviceMockReturnsOptions, NETWORK_ID, SUBNET_NETWORK_CONFIGURATION) - .id(ID) + .generatedId(GENERATED_ID) .creationTimestamp(CREATION_TIMESTAMP) .description(DESCRIPTION) .build(); @@ -77,7 +77,7 @@ private void initializeExpectedNetwork(int optionsCalls) { private void initializeNetwork() { network = new Network.Builder(compute, NETWORK_ID, NETWORK_CONFIGURATION) - .id(ID) + .generatedId(GENERATED_ID) .creationTimestamp(CREATION_TIMESTAMP) .description(DESCRIPTION) .build(); @@ -105,13 +105,13 @@ public void testToBuilderIncomplete() { @Test public void testBuilder() { initializeExpectedNetwork(2); - assertEquals(ID, standardNetwork.id()); + assertEquals(GENERATED_ID, standardNetwork.generatedId()); assertEquals(NETWORK_ID, standardNetwork.networkId()); assertEquals(CREATION_TIMESTAMP, standardNetwork.creationTimestamp()); assertEquals(DESCRIPTION, standardNetwork.description()); assertEquals(NETWORK_CONFIGURATION, standardNetwork.configuration()); assertSame(serviceMockReturnsOptions, standardNetwork.compute()); - assertEquals(ID, subnetNetwork.id()); + assertEquals(GENERATED_ID, subnetNetwork.generatedId()); assertEquals(NETWORK_ID, subnetNetwork.networkId()); assertEquals(CREATION_TIMESTAMP, subnetNetwork.creationTimestamp()); assertEquals(DESCRIPTION, subnetNetwork.description()); @@ -249,7 +249,7 @@ public void testCreateSubnetworkWithOptions() throws Exception { public void compareNetwork(Network expected, Network value) { assertEquals(expected, value); assertEquals(expected.compute().options(), value.compute().options()); - assertEquals(expected.id(), value.id()); + assertEquals(expected.generatedId(), value.generatedId()); assertEquals(expected.networkId(), value.networkId()); assertEquals(expected.creationTimestamp(), value.creationTimestamp()); assertEquals(expected.description(), value.description()); diff --git a/gcloud-java-compute/src/test/java/com/google/gcloud/compute/OperationTest.java b/gcloud-java-compute/src/test/java/com/google/gcloud/compute/OperationTest.java index 450097c4ef30..e13f77c551ad 100644 --- a/gcloud-java-compute/src/test/java/com/google/gcloud/compute/OperationTest.java +++ b/gcloud-java-compute/src/test/java/com/google/gcloud/compute/OperationTest.java @@ -49,8 +49,7 @@ public class OperationTest { new OperationWarning("code1", "message1", ImmutableMap.of("k1", "v1")); private static final OperationWarning OPERATION_WARNING2 = new OperationWarning("code2", "location2", ImmutableMap.of("k2", "v2")); - private static final String ID = "1"; - private static final Long CREATION_TIMESTAMP = 1453293540000L; + private static final String GENERATED_ID = "1"; private static final String CLIENT_OPERATION_ID = "clientOperationId"; private static final String OPERATION_TYPE = "delete"; private static final String TARGET_LINK = "targetLink"; @@ -88,7 +87,7 @@ private void initializeExpectedOperation(int optionsCalls) { expect(serviceMockReturnsOptions.options()).andReturn(mockOptions).times(optionsCalls); replay(serviceMockReturnsOptions); globalOperation = new Operation.Builder(serviceMockReturnsOptions) - .id(ID) + .generatedId(GENERATED_ID) .operationId(GLOBAL_OPERATION_ID) .clientOperationId(CLIENT_OPERATION_ID) .operationType(OPERATION_TYPE) @@ -108,7 +107,7 @@ private void initializeExpectedOperation(int optionsCalls) { .description(DESCRIPTION) .build(); zoneOperation = new Operation.Builder(serviceMockReturnsOptions) - .id(ID) + .generatedId(GENERATED_ID) .operationId(ZONE_OPERATION_ID) .clientOperationId(CLIENT_OPERATION_ID) .operationType(OPERATION_TYPE) @@ -128,7 +127,7 @@ private void initializeExpectedOperation(int optionsCalls) { .description(DESCRIPTION) .build(); regionOperation = new Operation.Builder(serviceMockReturnsOptions) - .id(ID) + .generatedId(GENERATED_ID) .operationId(REGION_OPERATION_ID) .clientOperationId(CLIENT_OPERATION_ID) .operationType(OPERATION_TYPE) @@ -152,7 +151,7 @@ private void initializeExpectedOperation(int optionsCalls) { private void initializeOperation() { operation = new Operation.Builder(compute) - .id(ID) + .generatedId(GENERATED_ID) .operationId(GLOBAL_OPERATION_ID) .clientOperationId(CLIENT_OPERATION_ID) .operationType(OPERATION_TYPE) @@ -179,7 +178,7 @@ public void tearDown() throws Exception { } private void assertEqualsCommonFields(Operation operation) { - assertEquals(ID, operation.id()); + assertEquals(GENERATED_ID, operation.generatedId()); assertEquals(CLIENT_OPERATION_ID, operation.clientOperationId()); assertEquals(OPERATION_TYPE, operation.operationType()); assertEquals(TARGET_LINK, operation.targetLink()); @@ -200,7 +199,7 @@ private void assertEqualsCommonFields(Operation operation) { } private void assertNullCommonFields(Operation operation) { - assertNull(operation.id()); + assertNull(operation.generatedId()); assertNull(operation.clientOperationId()); assertNull(operation.operationType()); assertNull(operation.targetLink()); diff --git a/gcloud-java-compute/src/test/java/com/google/gcloud/compute/RegionTest.java b/gcloud-java-compute/src/test/java/com/google/gcloud/compute/RegionTest.java index 07701b1d2248..5b1947a585ab 100644 --- a/gcloud-java-compute/src/test/java/com/google/gcloud/compute/RegionTest.java +++ b/gcloud-java-compute/src/test/java/com/google/gcloud/compute/RegionTest.java @@ -27,7 +27,7 @@ public class RegionTest { private static final RegionId REGION_ID = RegionId.of("project", "region"); - private static final String ID = "42"; + private static final String GENERATED_ID = "42"; private static final Long CREATION_TIMESTAMP = 1453293540000L; private static final String DESCRIPTION = "description"; private static final Region.Status STATUS = Region.Status.DOWN; @@ -43,7 +43,7 @@ public class RegionTest { DeprecationStatus.of(DeprecationStatus.Status.DELETED, REGION_ID); private static final Region REGION = Region.builder() .regionId(REGION_ID) - .id(ID) + .generatedId(GENERATED_ID) .creationTimestamp(CREATION_TIMESTAMP) .description(DESCRIPTION) .status(STATUS) @@ -55,7 +55,7 @@ public class RegionTest { @Test public void testBuilder() { assertEquals(REGION_ID, REGION.regionId()); - assertEquals(ID, REGION.id()); + assertEquals(GENERATED_ID, REGION.generatedId()); assertEquals(CREATION_TIMESTAMP, REGION.creationTimestamp()); assertEquals(DESCRIPTION, REGION.description()); assertEquals(STATUS, REGION.status()); @@ -77,7 +77,7 @@ public void testToAndFromPb() { private void compareRegions(Region expected, Region value) { assertEquals(expected, value); assertEquals(expected.regionId(), value.regionId()); - assertEquals(expected.id(), value.id()); + assertEquals(expected.generatedId(), value.generatedId()); assertEquals(expected.creationTimestamp(), value.creationTimestamp()); assertEquals(expected.description(), value.description()); assertEquals(expected.status(), value.status()); diff --git a/gcloud-java-compute/src/test/java/com/google/gcloud/compute/SerializationTest.java b/gcloud-java-compute/src/test/java/com/google/gcloud/compute/SerializationTest.java index 5b5b97142a3d..4761ccc80f5c 100644 --- a/gcloud-java-compute/src/test/java/com/google/gcloud/compute/SerializationTest.java +++ b/gcloud-java-compute/src/test/java/com/google/gcloud/compute/SerializationTest.java @@ -41,14 +41,12 @@ public class SerializationTest { private static final Compute COMPUTE = ComputeOptions.builder().projectId("p").build().service(); - private static final String ID = "42"; private static final Long CREATION_TIMESTAMP = 1453293540000L; private static final String DESCRIPTION = "description"; private static final String VALID_DISK_SIZE = "10GB-10TB"; private static final Long DEFAULT_DISK_SIZE_GB = 10L; private static final DiskTypeId DISK_TYPE_ID = DiskTypeId.of("project", "zone", "diskType"); private static final DiskType DISK_TYPE = DiskType.builder() - .id(ID) .diskTypeId(DISK_TYPE_ID) .creationTimestamp(CREATION_TIMESTAMP) .description(DESCRIPTION) @@ -62,7 +60,6 @@ public class SerializationTest { private static final Integer MAXIMUM_PERSISTENT_DISKS = 4; private static final Long MAXIMUM_PERSISTENT_DISKS_SIZE_GB = 5L; private static final MachineType MACHINE_TYPE = MachineType.builder() - .id(ID) .machineTypeId(MACHINE_TYPE_ID) .creationTimestamp(CREATION_TIMESTAMP) .description(DESCRIPTION) @@ -84,7 +81,6 @@ public class SerializationTest { private static final List QUOTAS = ImmutableList.of(QUOTA1, QUOTA2); private static final Region REGION = Region.builder() .regionId(REGION_ID) - .id(ID) .creationTimestamp(CREATION_TIMESTAMP) .description(DESCRIPTION) .status(REGION_STATUS) @@ -95,7 +91,6 @@ public class SerializationTest { private static final Zone.Status ZONE_STATUS = Zone.Status.DOWN; private static final Zone ZONE = Zone.builder() .zoneId(ZONE_ID) - .id(ID) .creationTimestamp(CREATION_TIMESTAMP) .description(DESCRIPTION) .status(ZONE_STATUS) @@ -135,7 +130,6 @@ public class SerializationTest { private static final AddressInfo ADDRESS_INFO = AddressInfo.builder(REGION_ADDRESS_ID) .creationTimestamp(CREATION_TIMESTAMP) .description(DESCRIPTION) - .id(ID) .usage(INSTANCE_USAGE) .build(); private static final Address ADDRESS = new Address.Builder(COMPUTE, REGION_ADDRESS_ID).build(); diff --git a/gcloud-java-compute/src/test/java/com/google/gcloud/compute/SnapshotInfoTest.java b/gcloud-java-compute/src/test/java/com/google/gcloud/compute/SnapshotInfoTest.java index 15789b414574..b9febeb9f011 100644 --- a/gcloud-java-compute/src/test/java/com/google/gcloud/compute/SnapshotInfoTest.java +++ b/gcloud-java-compute/src/test/java/com/google/gcloud/compute/SnapshotInfoTest.java @@ -29,7 +29,7 @@ public class SnapshotInfoTest { - private static final String ID = "42"; + private static final String GENERATED_ID = "42"; private static final DiskId SOURCE_DISK = DiskId.of("project", "zone", "disk"); private static final Long CREATION_TIMESTAMP = 1453293540000L; private static final String DESCRIPTION = "description"; @@ -42,7 +42,7 @@ public class SnapshotInfoTest { private static final Long STORAGE_BYTES = 24L; private static final StorageBytesStatus STORAGE_BYTES_STATUS = StorageBytesStatus.UP_TO_DATE; private static final SnapshotInfo SNAPSHOT_INFO = SnapshotInfo.builder(SNAPSHOT_ID, SOURCE_DISK) - .id(ID) + .generatedId(GENERATED_ID) .creationTimestamp(CREATION_TIMESTAMP) .description(DESCRIPTION) .status(STATUS) @@ -70,7 +70,7 @@ public void testToBuilderIncomplete() { @Test public void testBuilder() { - assertEquals(ID, SNAPSHOT_INFO.id()); + assertEquals(GENERATED_ID, SNAPSHOT_INFO.generatedId()); assertEquals(SNAPSHOT_ID, SNAPSHOT_INFO.snapshotId()); assertEquals(CREATION_TIMESTAMP, SNAPSHOT_INFO.creationTimestamp()); assertEquals(DESCRIPTION, SNAPSHOT_INFO.description()); @@ -86,7 +86,7 @@ public void testBuilder() { @Test public void testOf() { SnapshotInfo snapshotInfo = SnapshotInfo.of(SNAPSHOT_ID, SOURCE_DISK); - assertNull(snapshotInfo.id()); + assertNull(snapshotInfo.generatedId()); assertEquals(SNAPSHOT_ID, snapshotInfo.snapshotId()); assertNull(snapshotInfo.creationTimestamp()); assertNull(snapshotInfo.description()); @@ -119,7 +119,7 @@ public void testSetProjectId() { public void compareSnapshotInfo(SnapshotInfo expected, SnapshotInfo value) { assertEquals(expected, value); - assertEquals(expected.id(), value.id()); + assertEquals(expected.generatedId(), value.generatedId()); assertEquals(expected.snapshotId(), value.snapshotId()); assertEquals(expected.creationTimestamp(), value.creationTimestamp()); assertEquals(expected.description(), value.description()); diff --git a/gcloud-java-compute/src/test/java/com/google/gcloud/compute/SnapshotTest.java b/gcloud-java-compute/src/test/java/com/google/gcloud/compute/SnapshotTest.java index ac02669d7d5c..9959b875b92a 100644 --- a/gcloud-java-compute/src/test/java/com/google/gcloud/compute/SnapshotTest.java +++ b/gcloud-java-compute/src/test/java/com/google/gcloud/compute/SnapshotTest.java @@ -35,7 +35,7 @@ public class SnapshotTest { - private static final String ID = "42"; + private static final String GENERATED_ID = "42"; private static final DiskId SOURCE_DISK = DiskId.of("project", "zone", "disk"); private static final Long CREATION_TIMESTAMP = 1453293540000L; private static final String DESCRIPTION = "description"; @@ -59,7 +59,7 @@ private void initializeExpectedSnapshot(int optionsCalls) { expect(serviceMockReturnsOptions.options()).andReturn(mockOptions).times(optionsCalls); replay(serviceMockReturnsOptions); expectedSnapshot = new Snapshot.Builder(serviceMockReturnsOptions, SNAPSHOT_ID, SOURCE_DISK) - .id(ID) + .generatedId(GENERATED_ID) .creationTimestamp(CREATION_TIMESTAMP) .description(DESCRIPTION) .status(STATUS) @@ -74,7 +74,7 @@ private void initializeExpectedSnapshot(int optionsCalls) { private void initializeSnapshot() { snapshot = new Snapshot.Builder(compute, SNAPSHOT_ID, SOURCE_DISK) - .id(ID) + .generatedId(GENERATED_ID) .creationTimestamp(CREATION_TIMESTAMP) .description(DESCRIPTION) .status(STATUS) @@ -108,7 +108,7 @@ public void testToBuilderIncomplete() { @Test public void testBuilder() { initializeExpectedSnapshot(2); - assertEquals(ID, expectedSnapshot.id()); + assertEquals(GENERATED_ID, expectedSnapshot.generatedId()); assertEquals(SNAPSHOT_ID, expectedSnapshot.snapshotId()); assertEquals(CREATION_TIMESTAMP, expectedSnapshot.creationTimestamp()); assertEquals(DESCRIPTION, expectedSnapshot.description()); @@ -126,7 +126,7 @@ public void testBuilder() { .snapshotId(otherSnapshotId) .sourceDisk(otherSourceDisk) .build(); - assertNull(snapshot.id()); + assertNull(snapshot.generatedId()); assertEquals(otherSnapshotId, snapshot.snapshotId()); assertNull(snapshot.creationTimestamp()); assertNull(snapshot.description()); @@ -237,7 +237,7 @@ public void testReloadWithOptions() throws Exception { public void compareSnapshot(Snapshot expected, Snapshot value) { assertEquals(expected, value); assertEquals(expected.compute().options(), value.compute().options()); - assertEquals(expected.id(), value.id()); + assertEquals(expected.generatedId(), value.generatedId()); assertEquals(expected.snapshotId(), value.snapshotId()); assertEquals(expected.creationTimestamp(), value.creationTimestamp()); assertEquals(expected.description(), value.description()); diff --git a/gcloud-java-compute/src/test/java/com/google/gcloud/compute/SubnetworkInfoTest.java b/gcloud-java-compute/src/test/java/com/google/gcloud/compute/SubnetworkInfoTest.java index 83ba0bf9baab..721072ef9065 100644 --- a/gcloud-java-compute/src/test/java/com/google/gcloud/compute/SubnetworkInfoTest.java +++ b/gcloud-java-compute/src/test/java/com/google/gcloud/compute/SubnetworkInfoTest.java @@ -23,7 +23,7 @@ public class SubnetworkInfoTest { - private static final String ID = "42"; + private static final String GENERATED_ID = "42"; private static final Long CREATION_TIMESTAMP = 1453293540000L; private static final String DESCRIPTION = "description"; private static final SubnetworkId SUBNETWORK_ID = @@ -33,7 +33,7 @@ public class SubnetworkInfoTest { private static final String IP_RANGE = "192.168.0.0/16"; private static final SubnetworkInfo SUBNETWORK_INFO = SubnetworkInfo.builder(SUBNETWORK_ID, NETWORK_ID, IP_RANGE) - .id(ID) + .generatedId(GENERATED_ID) .creationTimestamp(CREATION_TIMESTAMP) .description(DESCRIPTION) .gatewayAddress(GATEWAY_ADDRESS) @@ -57,7 +57,7 @@ public void testToBuilderIncomplete() { @Test public void testBuilder() { - assertEquals(ID, SUBNETWORK_INFO.id()); + assertEquals(GENERATED_ID, SUBNETWORK_INFO.generatedId()); assertEquals(SUBNETWORK_ID, SUBNETWORK_INFO.subnetworkId()); assertEquals(CREATION_TIMESTAMP, SUBNETWORK_INFO.creationTimestamp()); assertEquals(DESCRIPTION, SUBNETWORK_INFO.description()); @@ -69,7 +69,7 @@ public void testBuilder() { @Test public void testOf() { SubnetworkInfo subnetworkInfo = SubnetworkInfo.of(SUBNETWORK_ID, NETWORK_ID, IP_RANGE); - assertNull(subnetworkInfo.id()); + assertNull(subnetworkInfo.generatedId()); assertEquals(SUBNETWORK_ID, subnetworkInfo.subnetworkId()); assertNull(subnetworkInfo.creationTimestamp()); assertNull(subnetworkInfo.description()); @@ -96,7 +96,7 @@ public void testSetProjectId() { public void compareSubnetworkInfo(SubnetworkInfo expected, SubnetworkInfo value) { assertEquals(expected, value); - assertEquals(expected.id(), value.id()); + assertEquals(expected.generatedId(), value.generatedId()); assertEquals(expected.subnetworkId(), value.subnetworkId()); assertEquals(expected.creationTimestamp(), value.creationTimestamp()); assertEquals(expected.description(), value.description()); diff --git a/gcloud-java-compute/src/test/java/com/google/gcloud/compute/SubnetworkTest.java b/gcloud-java-compute/src/test/java/com/google/gcloud/compute/SubnetworkTest.java index 4e47c9aa1198..8fc841383f1e 100644 --- a/gcloud-java-compute/src/test/java/com/google/gcloud/compute/SubnetworkTest.java +++ b/gcloud-java-compute/src/test/java/com/google/gcloud/compute/SubnetworkTest.java @@ -31,7 +31,7 @@ public class SubnetworkTest { - private static final String ID = "42"; + private static final String GENERATED_ID = "42"; private static final Long CREATION_TIMESTAMP = 1453293540000L; private static final String DESCRIPTION = "description"; private static final SubnetworkId SUBNETWORK_ID = SubnetworkId.of("project", "region", "network"); @@ -50,7 +50,7 @@ private void initializeExpectedSubnetwork(int optionsCalls) { replay(serviceMockReturnsOptions); expectedSubnetwork = new Subnetwork.Builder(serviceMockReturnsOptions, SUBNETWORK_ID, NETWORK_ID, IP_RANGE) - .id(ID) + .generatedId(GENERATED_ID) .creationTimestamp(CREATION_TIMESTAMP) .description(DESCRIPTION) .gatewayAddress(GATEWAY_ADDRESS) @@ -61,7 +61,7 @@ private void initializeExpectedSubnetwork(int optionsCalls) { private void initializeSubnetwork() { subnetwork = new Subnetwork.Builder(compute, SUBNETWORK_ID, NETWORK_ID, IP_RANGE) - .id(ID) + .generatedId(GENERATED_ID) .creationTimestamp(CREATION_TIMESTAMP) .description(DESCRIPTION) .gatewayAddress(GATEWAY_ADDRESS) @@ -90,7 +90,7 @@ public void testToBuilderIncomplete() { @Test public void testBuilder() { initializeExpectedSubnetwork(1); - assertEquals(ID, expectedSubnetwork.id()); + assertEquals(GENERATED_ID, expectedSubnetwork.generatedId()); assertEquals(SUBNETWORK_ID, expectedSubnetwork.subnetworkId()); assertEquals(CREATION_TIMESTAMP, expectedSubnetwork.creationTimestamp()); assertEquals(DESCRIPTION, expectedSubnetwork.description()); @@ -198,7 +198,7 @@ public void testReloadWithOptions() throws Exception { public void compareSubnetwork(Subnetwork expected, Subnetwork value) { assertEquals(expected, value); assertEquals(expected.compute().options(), value.compute().options()); - assertEquals(expected.id(), value.id()); + assertEquals(expected.generatedId(), value.generatedId()); assertEquals(expected.subnetworkId(), value.subnetworkId()); assertEquals(expected.creationTimestamp(), value.creationTimestamp()); assertEquals(expected.description(), value.description()); diff --git a/gcloud-java-compute/src/test/java/com/google/gcloud/compute/ZoneTest.java b/gcloud-java-compute/src/test/java/com/google/gcloud/compute/ZoneTest.java index 97a80a4de05b..624fd4d2d62b 100644 --- a/gcloud-java-compute/src/test/java/com/google/gcloud/compute/ZoneTest.java +++ b/gcloud-java-compute/src/test/java/com/google/gcloud/compute/ZoneTest.java @@ -24,7 +24,7 @@ public class ZoneTest { private static final ZoneId ZONE_ID = ZoneId.of("project", "zone"); private static final RegionId REGION_ID = RegionId.of("project", "region"); - private static final String ID = "42"; + private static final String GENERATED_ID = "42"; private static final Long CREATION_TIMESTAMP = 1453293540000L; private static final String DESCRIPTION = "description"; private static final Zone.Status STATUS = Zone.Status.DOWN; @@ -32,7 +32,7 @@ public class ZoneTest { DeprecationStatus.of(DeprecationStatus.Status.DELETED, ZONE_ID); private static final Zone ZONE = Zone.builder() .zoneId(ZONE_ID) - .id(ID) + .generatedId(GENERATED_ID) .creationTimestamp(CREATION_TIMESTAMP) .description(DESCRIPTION) .status(STATUS) @@ -43,7 +43,7 @@ public class ZoneTest { @Test public void testBuilder() { assertEquals(REGION_ID, ZONE.region()); - assertEquals(ID, ZONE.id()); + assertEquals(GENERATED_ID, ZONE.generatedId()); assertEquals(CREATION_TIMESTAMP, ZONE.creationTimestamp()); assertEquals(DESCRIPTION, ZONE.description()); assertEquals(STATUS, ZONE.status()); @@ -66,7 +66,7 @@ public void testToAndFromPb() { private void compareZones(Zone expected, Zone value) { assertEquals(expected, value); assertEquals(expected.zoneId(), value.zoneId()); - assertEquals(expected.id(), value.id()); + assertEquals(expected.generatedId(), value.generatedId()); assertEquals(expected.creationTimestamp(), value.creationTimestamp()); assertEquals(expected.description(), value.description()); assertEquals(expected.status(), value.status()); diff --git a/gcloud-java-compute/src/test/java/com/google/gcloud/compute/it/ITComputeTest.java b/gcloud-java-compute/src/test/java/com/google/gcloud/compute/it/ITComputeTest.java index 00a26cf82602..a46d47d2040d 100644 --- a/gcloud-java-compute/src/test/java/com/google/gcloud/compute/it/ITComputeTest.java +++ b/gcloud-java-compute/src/test/java/com/google/gcloud/compute/it/ITComputeTest.java @@ -119,7 +119,7 @@ public static void beforeClass() { @Test public void testGetDiskType() { DiskType diskType = compute.getDiskType(ZONE, DISK_TYPE); - // assertNotNull(diskType.id()); + // assertNotNull(diskType.generatedId()); assertEquals(ZONE, diskType.diskTypeId().zone()); assertEquals(DISK_TYPE, diskType.diskTypeId().type()); assertNotNull(diskType.creationTimestamp()); @@ -132,7 +132,7 @@ public void testGetDiskType() { public void testGetDiskTypeWithSelectedFields() { DiskType diskType = compute.getDiskType(ZONE, DISK_TYPE, Compute.DiskTypeOption.fields(Compute.DiskTypeField.CREATION_TIMESTAMP)); - // assertNotNull(diskType.id()); + // assertNotNull(diskType.generatedId()); assertEquals(ZONE, diskType.diskTypeId().zone()); assertEquals(DISK_TYPE, diskType.diskTypeId().type()); assertNotNull(diskType.creationTimestamp()); @@ -148,7 +148,7 @@ public void testListDiskTypes() { assertTrue(diskTypeIterator.hasNext()); while (diskTypeIterator.hasNext()) { DiskType diskType = diskTypeIterator.next(); - // assertNotNull(diskType.id()); + // assertNotNull(diskType.generatedId()); assertNotNull(diskType.diskTypeId()); assertEquals(ZONE, diskType.diskTypeId().zone()); assertNotNull(diskType.creationTimestamp()); @@ -166,7 +166,7 @@ public void testListDiskTypesWithSelectedFields() { assertTrue(diskTypeIterator.hasNext()); while (diskTypeIterator.hasNext()) { DiskType diskType = diskTypeIterator.next(); - assertNull(diskType.id()); + assertNull(diskType.generatedId()); assertNotNull(diskType.diskTypeId()); assertEquals(ZONE, diskType.diskTypeId().zone()); assertNotNull(diskType.creationTimestamp()); @@ -185,7 +185,7 @@ public void testListDiskTypesWithFilter() { while (diskTypeIterator.hasNext()) { DiskType diskType = diskTypeIterator.next(); // todo(mziccard): uncomment or remove once #695 is closed - // assertNotNull(diskType.id()); + // assertNotNull(diskType.generatedId()); assertNotNull(diskType.diskTypeId()); assertEquals(ZONE, diskType.diskTypeId().zone()); assertNotNull(diskType.creationTimestamp()); @@ -202,7 +202,7 @@ public void testAggregatedListDiskTypes() { assertTrue(diskTypeIterator.hasNext()); while (diskTypeIterator.hasNext()) { DiskType diskType = diskTypeIterator.next(); - // assertNotNull(diskType.id()); + // assertNotNull(diskType.generatedId()); assertNotNull(diskType.diskTypeId()); assertNotNull(diskType.creationTimestamp()); assertNotNull(diskType.description()); @@ -220,7 +220,7 @@ public void testAggregatedListDiskTypesWithFilter() { while (diskTypeIterator.hasNext()) { DiskType diskType = diskTypeIterator.next(); // todo(mziccard): uncomment or remove once #695 is closed - // assertNotNull(diskType.id()); + // assertNotNull(diskType.generatedId()); assertNotNull(diskType.diskTypeId()); assertNotNull(diskType.creationTimestamp()); assertNotNull(diskType.description()); @@ -234,7 +234,7 @@ public void testGetMachineType() { MachineType machineType = compute.getMachineType(ZONE, MACHINE_TYPE); assertEquals(ZONE, machineType.machineTypeId().zone()); assertEquals(MACHINE_TYPE, machineType.machineTypeId().type()); - assertNotNull(machineType.id()); + assertNotNull(machineType.generatedId()); assertNotNull(machineType.creationTimestamp()); assertNotNull(machineType.description()); assertNotNull(machineType.cpus()); @@ -249,7 +249,7 @@ public void testGetMachineTypeWithSelectedFields() { Compute.MachineTypeOption.fields(Compute.MachineTypeField.ID)); assertEquals(ZONE, machineType.machineTypeId().zone()); assertEquals(MACHINE_TYPE, machineType.machineTypeId().type()); - assertNotNull(machineType.id()); + assertNotNull(machineType.generatedId()); assertNull(machineType.creationTimestamp()); assertNull(machineType.description()); assertNull(machineType.cpus()); @@ -267,7 +267,7 @@ public void testListMachineTypes() { MachineType machineType = machineTypeIterator.next(); assertNotNull(machineType.machineTypeId()); assertEquals(ZONE, machineType.machineTypeId().zone()); - assertNotNull(machineType.id()); + assertNotNull(machineType.generatedId()); assertNotNull(machineType.creationTimestamp()); assertNotNull(machineType.description()); assertNotNull(machineType.cpus()); @@ -287,7 +287,7 @@ public void testListMachineTypesWithSelectedFields() { MachineType machineType = machineTypeIterator.next(); assertNotNull(machineType.machineTypeId()); assertEquals(ZONE, machineType.machineTypeId().zone()); - assertNull(machineType.id()); + assertNull(machineType.generatedId()); assertNotNull(machineType.creationTimestamp()); assertNull(machineType.description()); assertNull(machineType.cpus()); @@ -308,7 +308,7 @@ public void testListMachineTypesWithFilter() { MachineType machineType = machineTypeIterator.next(); assertNotNull(machineType.machineTypeId()); assertEquals(ZONE, machineType.machineTypeId().zone()); - assertNotNull(machineType.id()); + assertNotNull(machineType.generatedId()); assertNotNull(machineType.creationTimestamp()); assertNotNull(machineType.description()); assertNotNull(machineType.cpus()); @@ -327,7 +327,7 @@ public void testAggregatedListMachineTypes() { while (machineTypeIterator.hasNext()) { MachineType machineType = machineTypeIterator.next(); assertNotNull(machineType.machineTypeId()); - assertNotNull(machineType.id()); + assertNotNull(machineType.generatedId()); assertNotNull(machineType.creationTimestamp()); assertNotNull(machineType.description()); assertNotNull(machineType.cpus()); @@ -347,7 +347,7 @@ public void testAggregatedListMachineTypesWithFilter() { while (machineTypeIterator.hasNext()) { MachineType machineType = machineTypeIterator.next(); assertNotNull(machineType.machineTypeId()); - assertNotNull(machineType.id()); + assertNotNull(machineType.generatedId()); assertNotNull(machineType.creationTimestamp()); assertNotNull(machineType.description()); assertNotNull(machineType.cpus()); @@ -378,7 +378,7 @@ public void testGetRegion() { assertEquals(REGION, region.regionId().region()); assertNotNull(region.description()); assertNotNull(region.creationTimestamp()); - assertNotNull(region.id()); + assertNotNull(region.generatedId()); assertNotNull(region.quotas()); assertNotNull(region.status()); assertNotNull(region.zones()); @@ -388,7 +388,7 @@ public void testGetRegion() { public void testGetRegionWithSelectedFields() { Region region = compute.getRegion(REGION, Compute.RegionOption.fields(Compute.RegionField.ID)); assertEquals(REGION, region.regionId().region()); - assertNotNull(region.id()); + assertNotNull(region.generatedId()); assertNull(region.description()); assertNull(region.creationTimestamp()); assertNull(region.quotas()); @@ -405,7 +405,7 @@ public void testListRegions() { assertNotNull(region.regionId()); assertNotNull(region.description()); assertNotNull(region.creationTimestamp()); - assertNotNull(region.id()); + assertNotNull(region.generatedId()); assertNotNull(region.quotas()); assertNotNull(region.status()); assertNotNull(region.zones()); @@ -422,7 +422,7 @@ public void testListRegionsWithSelectedFields() { assertNotNull(region.regionId()); assertNull(region.description()); assertNull(region.creationTimestamp()); - assertNotNull(region.id()); + assertNotNull(region.generatedId()); assertNull(region.quotas()); assertNull(region.status()); assertNull(region.zones()); @@ -442,7 +442,7 @@ public void testListRegionsWithFilter() { public void testGetZone() { Zone zone = compute.getZone(ZONE); assertEquals(ZONE, zone.zoneId().zone()); - assertNotNull(zone.id()); + assertNotNull(zone.generatedId()); assertNotNull(zone.creationTimestamp()); assertNotNull(zone.description()); assertNotNull(zone.status()); @@ -453,7 +453,7 @@ public void testGetZone() { public void testGetZoneWithSelectedFields() { Zone zone = compute.getZone(ZONE, Compute.ZoneOption.fields(Compute.ZoneField.ID)); assertEquals(ZONE, zone.zoneId().zone()); - assertNotNull(zone.id()); + assertNotNull(zone.generatedId()); assertNull(zone.creationTimestamp()); assertNull(zone.description()); assertNull(zone.status()); @@ -467,7 +467,7 @@ public void testListZones() { while (zoneIterator.hasNext()) { Zone zone = zoneIterator.next(); assertNotNull(zone.zoneId()); - assertNotNull(zone.id()); + assertNotNull(zone.generatedId()); assertNotNull(zone.creationTimestamp()); assertNotNull(zone.description()); assertNotNull(zone.status()); @@ -483,7 +483,7 @@ public void testListZonesWithSelectedFields() { while (zoneIterator.hasNext()) { Zone zone = zoneIterator.next(); assertNotNull(zone.zoneId()); - assertNull(zone.id()); + assertNull(zone.generatedId()); assertNotNull(zone.creationTimestamp()); assertNull(zone.description()); assertNull(zone.status()); @@ -506,7 +506,7 @@ public void testListGlobalOperations() { Iterator operationIterator = operationPage.iterateAll(); while (operationIterator.hasNext()) { Operation operation = operationIterator.next(); - assertNotNull(operation.id()); + assertNotNull(operation.generatedId()); assertNotNull(operation.operationId()); // todo(mziccard): uncomment or remove once #727 is closed // assertNotNull(operation.creationTimestamp()); @@ -523,7 +523,7 @@ public void testListGlobalOperationsWithSelectedFields() { Iterator operationIterator = operationPage.iterateAll(); while (operationIterator.hasNext()) { Operation operation = operationIterator.next(); - assertNotNull(operation.id()); + assertNotNull(operation.generatedId()); assertNotNull(operation.operationId()); assertNull(operation.operationType()); assertNull(operation.targetLink()); @@ -549,7 +549,7 @@ public void testListGlobalOperationsWithFilter() { Iterator operationIterator = operationPage.iterateAll(); while (operationIterator.hasNext()) { Operation operation = operationIterator.next(); - assertNotNull(operation.id()); + assertNotNull(operation.generatedId()); assertNotNull(operation.operationId()); // todo(mziccard): uncomment or remove once #727 is closed // assertNotNull(operation.creationTimestamp()); @@ -565,7 +565,7 @@ public void testListRegionOperations() { Iterator operationIterator = operationPage.iterateAll(); while (operationIterator.hasNext()) { Operation operation = operationIterator.next(); - assertNotNull(operation.id()); + assertNotNull(operation.generatedId()); assertNotNull(operation.operationId()); assertEquals(REGION, operation.operationId().region()); // todo(mziccard): uncomment or remove once #727 is closed @@ -583,7 +583,7 @@ public void testListRegionOperationsWithSelectedFields() { Iterator operationIterator = operationPage.iterateAll(); while (operationIterator.hasNext()) { Operation operation = operationIterator.next(); - assertNotNull(operation.id()); + assertNotNull(operation.generatedId()); assertNotNull(operation.operationId()); assertEquals(REGION, operation.operationId().region()); assertNull(operation.operationType()); @@ -611,7 +611,7 @@ public void testListRegionOperationsWithFilter() { Iterator operationIterator = operationPage.iterateAll(); while (operationIterator.hasNext()) { Operation operation = operationIterator.next(); - assertNotNull(operation.id()); + assertNotNull(operation.generatedId()); assertNotNull(operation.operationId()); assertEquals(REGION, operation.operationId().region()); // todo(mziccard): uncomment or remove once #727 is closed @@ -628,7 +628,7 @@ public void testListZoneOperations() { Iterator operationIterator = operationPage.iterateAll(); while (operationIterator.hasNext()) { Operation operation = operationIterator.next(); - assertNotNull(operation.id()); + assertNotNull(operation.generatedId()); assertNotNull(operation.operationId()); assertEquals(ZONE, operation.operationId().zone()); // todo(mziccard): uncomment or remove once #727 is closed @@ -646,7 +646,7 @@ public void testListZoneOperationsWithSelectedFields() { Iterator operationIterator = operationPage.iterateAll(); while (operationIterator.hasNext()) { Operation operation = operationIterator.next(); - assertNotNull(operation.id()); + assertNotNull(operation.generatedId()); assertNotNull(operation.operationId()); assertEquals(ZONE, operation.operationId().zone()); assertNull(operation.operationType()); @@ -674,7 +674,7 @@ public void testListZoneOperationsWithFilter() { Iterator operationIterator = operationPage.iterateAll(); while (operationIterator.hasNext()) { Operation operation = operationIterator.next(); - assertNotNull(operation.id()); + assertNotNull(operation.generatedId()); assertNotNull(operation.operationId()); assertEquals(ZONE, operation.operationId().zone()); // todo(mziccard): uncomment or remove once #727 is closed @@ -702,7 +702,7 @@ public void testCreateGetAndDeleteRegionAddress() throws InterruptedException { assertEquals(addressId.address(), remoteAddress.addressId().address()); assertNotNull(remoteAddress.address()); assertNotNull(remoteAddress.creationTimestamp()); - assertNotNull(remoteAddress.id()); + assertNotNull(remoteAddress.generatedId()); assertNotNull(remoteAddress.status()); // test get with selected fields remoteAddress = compute.get(addressId, Compute.AddressOption.fields()); @@ -712,7 +712,7 @@ public void testCreateGetAndDeleteRegionAddress() throws InterruptedException { assertEquals(addressId.address(), remoteAddress.addressId().address()); assertNull(remoteAddress.address()); assertNull(remoteAddress.creationTimestamp()); - assertNull(remoteAddress.id()); + assertNull(remoteAddress.generatedId()); operation = remoteAddress.delete(); while (!operation.isDone()) { Thread.sleep(1000L); @@ -750,7 +750,7 @@ public void testListRegionAddresses() throws InterruptedException { assertTrue(addressSet.contains(address.addressId().address())); assertNotNull(address.address()); assertNotNull(address.creationTimestamp()); - assertNotNull(address.id()); + assertNotNull(address.generatedId()); count++; } assertEquals(2, count); @@ -766,7 +766,7 @@ public void testListRegionAddresses() throws InterruptedException { assertTrue(addressSet.contains(address.addressId().address())); assertNotNull(address.address()); assertNull(address.creationTimestamp()); - assertNull(address.id()); + assertNull(address.generatedId()); assertNull(address.status()); assertNull(address.usage()); count++; @@ -803,7 +803,7 @@ public void testAggregatedListAddresses() throws InterruptedException { assertTrue(addressSet.contains(address.addressId().address())); assertNotNull(address.address()); assertNotNull(address.creationTimestamp()); - assertNotNull(address.id()); + assertNotNull(address.generatedId()); count++; } assertEquals(2, count); @@ -827,7 +827,7 @@ public void testCreateGetAndDeleteGlobalAddress() throws InterruptedException { assertEquals(addressId.address(), remoteAddress.addressId().address()); assertNotNull(remoteAddress.address()); assertNotNull(remoteAddress.creationTimestamp()); - assertNotNull(remoteAddress.id()); + assertNotNull(remoteAddress.generatedId()); assertNotNull(remoteAddress.status()); // test get with selected fields remoteAddress = compute.get(addressId, Compute.AddressOption.fields()); @@ -836,7 +836,7 @@ public void testCreateGetAndDeleteGlobalAddress() throws InterruptedException { assertEquals(addressId.address(), remoteAddress.addressId().address()); assertNull(remoteAddress.address()); assertNull(remoteAddress.creationTimestamp()); - assertNull(remoteAddress.id()); + assertNull(remoteAddress.generatedId()); operation = remoteAddress.delete(); while (!operation.isDone()) { Thread.sleep(1000L); @@ -873,7 +873,7 @@ public void testListGlobalAddresses() throws InterruptedException { assertTrue(addressSet.contains(address.addressId().address())); assertNotNull(address.address()); assertNotNull(address.creationTimestamp()); - assertNotNull(address.id()); + assertNotNull(address.generatedId()); count++; } assertEquals(2, count); @@ -888,7 +888,7 @@ public void testListGlobalAddresses() throws InterruptedException { assertTrue(addressSet.contains(address.addressId().address())); assertNotNull(address.address()); assertNull(address.creationTimestamp()); - assertNull(address.id()); + assertNull(address.generatedId()); assertNull(address.status()); assertNull(address.usage()); count++; @@ -914,7 +914,7 @@ public void testCreateGetResizeAndDeleteStandardDisk() throws InterruptedExcepti assertEquals(ZONE, remoteDisk.diskId().zone()); assertEquals(diskId.disk(), remoteDisk.diskId().disk()); assertNotNull(remoteDisk.creationTimestamp()); - assertNotNull(remoteDisk.id()); + assertNotNull(remoteDisk.generatedId()); assertTrue(remoteDisk.configuration() instanceof StandardDiskConfiguration); StandardDiskConfiguration remoteConfiguration = remoteDisk.configuration(); assertEquals(100L, (long) remoteConfiguration.sizeGb()); @@ -932,7 +932,7 @@ public void testCreateGetResizeAndDeleteStandardDisk() throws InterruptedExcepti assertEquals(ZONE, remoteDisk.diskId().zone()); assertEquals(diskId.disk(), remoteDisk.diskId().disk()); assertNull(remoteDisk.creationTimestamp()); - assertNull(remoteDisk.id()); + assertNull(remoteDisk.generatedId()); assertTrue(remoteDisk.configuration() instanceof StandardDiskConfiguration); remoteConfiguration = remoteDisk.configuration(); assertEquals(200L, (long) remoteConfiguration.sizeGb()); @@ -963,7 +963,7 @@ public void testCreateGetAndDeleteImageDisk() throws InterruptedException { assertEquals(diskId.disk(), remoteDisk.diskId().disk()); assertEquals(DiskInfo.CreationStatus.READY, remoteDisk.creationStatus()); assertNotNull(remoteDisk.creationTimestamp()); - assertNotNull(remoteDisk.id()); + assertNotNull(remoteDisk.generatedId()); assertTrue(remoteDisk.configuration() instanceof ImageDiskConfiguration); ImageDiskConfiguration remoteConfiguration = remoteDisk.configuration(); assertEquals(IMAGE_ID, remoteConfiguration.sourceImage()); @@ -979,7 +979,7 @@ public void testCreateGetAndDeleteImageDisk() throws InterruptedException { assertEquals(ZONE, remoteDisk.diskId().zone()); assertEquals(diskId.disk(), remoteDisk.diskId().disk()); assertNull(remoteDisk.creationTimestamp()); - assertNull(remoteDisk.id()); + assertNull(remoteDisk.generatedId()); assertTrue(remoteDisk.configuration() instanceof ImageDiskConfiguration); remoteConfiguration = remoteDisk.configuration(); assertEquals(IMAGE_ID, remoteConfiguration.sourceImage()); @@ -1017,7 +1017,7 @@ public void testCreateGetAndDeleteSnapshotAndSnapshotDisk() throws InterruptedEx // test get snapshot with selected fields Snapshot snapshot = compute.getSnapshot(snapshotName, Compute.SnapshotOption.fields(Compute.SnapshotField.CREATION_TIMESTAMP)); - assertNull(snapshot.id()); + assertNull(snapshot.generatedId()); assertNotNull(snapshot.snapshotId()); assertNotNull(snapshot.creationTimestamp()); assertNull(snapshot.description()); @@ -1030,7 +1030,7 @@ public void testCreateGetAndDeleteSnapshotAndSnapshotDisk() throws InterruptedEx assertNull(snapshot.storageBytesStatus()); // test get snapshot snapshot = compute.getSnapshot(snapshotName); - assertNotNull(snapshot.id()); + assertNotNull(snapshot.generatedId()); assertNotNull(snapshot.snapshotId()); assertNotNull(snapshot.creationTimestamp()); assertNotNull(snapshot.status()); @@ -1053,7 +1053,7 @@ public void testCreateGetAndDeleteSnapshotAndSnapshotDisk() throws InterruptedEx assertEquals(snapshotDiskId.disk(), remoteDisk.diskId().disk()); assertEquals(DiskInfo.CreationStatus.READY, remoteDisk.creationStatus()); assertNotNull(remoteDisk.creationTimestamp()); - assertNotNull(remoteDisk.id()); + assertNotNull(remoteDisk.generatedId()); assertTrue(remoteDisk.configuration() instanceof SnapshotDiskConfiguration); SnapshotDiskConfiguration remoteConfiguration = remoteDisk.configuration(); assertEquals(DiskConfiguration.Type.SNAPSHOT, remoteConfiguration.type()); @@ -1070,7 +1070,7 @@ public void testCreateGetAndDeleteSnapshotAndSnapshotDisk() throws InterruptedEx assertEquals(snapshotDiskId.disk(), remoteDisk.diskId().disk()); assertNull(remoteDisk.creationStatus()); assertNull(remoteDisk.creationTimestamp()); - assertNull(remoteDisk.id()); + assertNull(remoteDisk.generatedId()); assertTrue(remoteDisk.configuration() instanceof SnapshotDiskConfiguration); remoteConfiguration = remoteDisk.configuration(); assertEquals(DiskConfiguration.Type.SNAPSHOT, remoteConfiguration.type()); @@ -1121,7 +1121,7 @@ public void testListDisksAndSnapshots() throws InterruptedException { assertTrue(diskSet.contains(remoteDisk.diskId().disk())); assertEquals(DiskInfo.CreationStatus.READY, remoteDisk.creationStatus()); assertNotNull(remoteDisk.creationTimestamp()); - assertNotNull(remoteDisk.id()); + assertNotNull(remoteDisk.generatedId()); assertTrue(remoteDisk.configuration() instanceof StandardDiskConfiguration); StandardDiskConfiguration remoteConfiguration = remoteDisk.configuration(); assertEquals(100L, (long) remoteConfiguration.sizeGb()); @@ -1143,7 +1143,7 @@ public void testListDisksAndSnapshots() throws InterruptedException { assertTrue(diskSet.contains(remoteDisk.diskId().disk())); assertEquals(DiskInfo.CreationStatus.READY, remoteDisk.creationStatus()); assertNull(remoteDisk.creationTimestamp()); - assertNull(remoteDisk.id()); + assertNull(remoteDisk.generatedId()); assertTrue(remoteDisk.configuration() instanceof StandardDiskConfiguration); StandardDiskConfiguration remoteConfiguration = remoteDisk.configuration(); assertNull(remoteConfiguration.sizeGb()); @@ -1174,7 +1174,7 @@ public void testListDisksAndSnapshots() throws InterruptedException { count = 0; while (snapshotIterator.hasNext()) { Snapshot remoteSnapshot = snapshotIterator.next(); - assertNotNull(remoteSnapshot.id()); + assertNotNull(remoteSnapshot.generatedId()); assertTrue(diskSet.contains(remoteSnapshot.snapshotId().snapshot())); assertNotNull(remoteSnapshot.creationTimestamp()); assertNotNull(remoteSnapshot.status()); @@ -1193,7 +1193,7 @@ public void testListDisksAndSnapshots() throws InterruptedException { count = 0; while (snapshotIterator.hasNext()) { Snapshot remoteSnapshot = snapshotIterator.next(); - assertNull(remoteSnapshot.id()); + assertNull(remoteSnapshot.generatedId()); assertTrue(diskSet.contains(remoteSnapshot.snapshotId().snapshot())); assertNotNull(remoteSnapshot.creationTimestamp()); assertNull(remoteSnapshot.status()); @@ -1241,7 +1241,7 @@ public void testAggregatedListDisks() throws InterruptedException { assertTrue(diskSet.contains(remoteDisk.diskId().disk())); assertEquals(DiskInfo.CreationStatus.READY, remoteDisk.creationStatus()); assertNotNull(remoteDisk.creationTimestamp()); - assertNotNull(remoteDisk.id()); + assertNotNull(remoteDisk.generatedId()); assertTrue(remoteDisk.configuration() instanceof StandardDiskConfiguration); StandardDiskConfiguration remoteConfiguration = remoteDisk.configuration(); assertEquals(100L, (long) remoteConfiguration.sizeGb()); @@ -1275,7 +1275,7 @@ public void testCreateGetAndDeprecateImage() throws InterruptedException { // test get image with selected fields Image image = compute.get(imageId, Compute.ImageOption.fields(Compute.ImageField.CREATION_TIMESTAMP)); - assertNull(image.id()); + assertNull(image.generatedId()); assertNotNull(image.imageId()); assertNotNull(image.creationTimestamp()); assertNull(image.description()); @@ -1290,7 +1290,7 @@ public void testCreateGetAndDeprecateImage() throws InterruptedException { assertNull(image.deprecationStatus()); // test get image image = compute.get(imageId); - assertNotNull(image.id()); + assertNotNull(image.generatedId()); assertNotNull(image.imageId()); assertNotNull(image.creationTimestamp()); assertNotNull(image.configuration()); @@ -1328,7 +1328,7 @@ public void testListImages() { while (imageIterator.hasNext()) { count++; Image image = imageIterator.next(); - assertNotNull(image.id()); + assertNotNull(image.generatedId()); assertNotNull(image.imageId()); assertNotNull(image.creationTimestamp()); assertNotNull(image.configuration()); @@ -1347,7 +1347,7 @@ public void testListImagesWithSelectedFields() { while (imageIterator.hasNext()) { count++; Image image = imageIterator.next(); - assertNotNull(image.id()); + assertNotNull(image.generatedId()); assertNotNull(image.imageId()); assertNull(image.creationTimestamp()); assertNotNull(image.configuration()); @@ -1368,7 +1368,7 @@ public void testListImagesWithFilter() { while (imageIterator.hasNext()) { count++; Image image = imageIterator.next(); - assertNotNull(image.id()); + assertNotNull(image.generatedId()); assertNotNull(image.imageId()); assertNotNull(image.creationTimestamp()); assertNotNull(image.configuration()); @@ -1394,7 +1394,7 @@ public void testCreateAndGetNetwork() throws InterruptedException { Network network = compute.getNetwork(networkId.network(), Compute.NetworkOption.fields(Compute.NetworkField.CREATION_TIMESTAMP)); assertEquals(networkId.network(), network.networkId().network()); - assertNull(network.id()); + assertNull(network.generatedId()); assertNotNull(network.creationTimestamp()); assertNull(network.description()); assertEquals(NetworkConfiguration.Type.STANDARD, network.configuration().type()); @@ -1403,7 +1403,7 @@ public void testCreateAndGetNetwork() throws InterruptedException { // test get network network = compute.getNetwork(networkId.network()); assertEquals(networkId.network(), network.networkId().network()); - assertNotNull(network.id()); + assertNotNull(network.generatedId()); assertNotNull(network.creationTimestamp()); assertEquals(NetworkConfiguration.Type.STANDARD, network.configuration().type()); remoteConfiguration = network.configuration(); @@ -1433,7 +1433,7 @@ public void testListNetworks() throws InterruptedException { while (networkIterator.hasNext()) { Network network = networkIterator.next(); assertEquals(networkId.network(), network.networkId().network()); - assertNotNull(network.id()); + assertNotNull(network.generatedId()); assertNotNull(network.creationTimestamp()); assertEquals(NetworkConfiguration.Type.STANDARD, network.configuration().type()); StandardNetworkConfiguration remoteConfiguration = network.configuration(); @@ -1449,7 +1449,7 @@ public void testListNetworks() throws InterruptedException { while (networkIterator.hasNext()) { Network network = networkIterator.next(); assertEquals(networkId.network(), network.networkId().network()); - assertNull(network.id()); + assertNull(network.generatedId()); assertNotNull(network.creationTimestamp()); assertNull(network.description()); assertEquals(NetworkConfiguration.Type.STANDARD, network.configuration().type()); @@ -1477,7 +1477,7 @@ public void testCreateNetworkAndSubnetwork() throws InterruptedException { // test get network Network network = compute.getNetwork(networkId.network()); assertEquals(networkId.network(), network.networkId().network()); - assertNotNull(network.id()); + assertNotNull(network.generatedId()); assertNotNull(network.creationTimestamp()); assertEquals(NetworkConfiguration.Type.SUBNET, network.configuration().type()); assertTrue(network.configuration() instanceof SubnetNetworkConfiguration); @@ -1492,7 +1492,7 @@ public void testCreateNetworkAndSubnetwork() throws InterruptedException { // test get subnetwork with selected fields Subnetwork subnetwork = compute.get(subnetworkId, Compute.SubnetworkOption.fields(Compute.SubnetworkField.CREATION_TIMESTAMP)); - assertNull(subnetwork.id()); + assertNull(subnetwork.generatedId()); assertEquals(subnetworkId.subnetwork(), subnetwork.subnetworkId().subnetwork()); assertNotNull(subnetwork.creationTimestamp()); assertNull(subnetwork.description()); @@ -1501,7 +1501,7 @@ public void testCreateNetworkAndSubnetwork() throws InterruptedException { assertNull(subnetwork.ipRange()); // test get subnetwork subnetwork = compute.get(subnetworkId); - assertNotNull(subnetwork.id()); + assertNotNull(subnetwork.generatedId()); assertEquals(subnetworkId.subnetwork(), subnetwork.subnetworkId().subnetwork()); assertNotNull(subnetwork.creationTimestamp()); assertNotNull(subnetwork.gatewayAddress()); @@ -1516,7 +1516,7 @@ public void testCreateNetworkAndSubnetwork() throws InterruptedException { int count = 0; while (subnetworkIterator.hasNext()) { Subnetwork remoteSubnetwork = subnetworkIterator.next(); - assertNotNull(remoteSubnetwork.id()); + assertNotNull(remoteSubnetwork.generatedId()); assertEquals(subnetworkId.subnetwork(), remoteSubnetwork.subnetworkId().subnetwork()); assertNotNull(remoteSubnetwork.creationTimestamp()); assertNotNull(remoteSubnetwork.gatewayAddress()); @@ -1532,7 +1532,7 @@ public void testCreateNetworkAndSubnetwork() throws InterruptedException { count = 0; while (subnetworkIterator.hasNext()) { Subnetwork remoteSubnetwork = subnetworkIterator.next(); - assertNull(remoteSubnetwork.id()); + assertNull(remoteSubnetwork.generatedId()); assertEquals(subnetworkId.subnetwork(), remoteSubnetwork.subnetworkId().subnetwork()); assertNotNull(remoteSubnetwork.creationTimestamp()); assertNull(remoteSubnetwork.description()); @@ -1592,7 +1592,7 @@ public void testAggregatedListSubnetworks() throws InterruptedException { int count = 0; while (subnetworkIterator.hasNext()) { Subnetwork remoteSubnetwork = subnetworkIterator.next(); - assertNotNull(remoteSubnetwork.id()); + assertNotNull(remoteSubnetwork.generatedId()); assertTrue(regionSet.contains(remoteSubnetwork.subnetworkId().region())); assertTrue(subnetworkSet.contains(remoteSubnetwork.subnetworkId().subnetwork())); assertNotNull(remoteSubnetwork.creationTimestamp());