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 c76e75f13da3..9eb343cd5e74 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 @@ -134,7 +134,7 @@ public boolean exists() { * @throws ComputeException upon failure */ public Address reload(Compute.AddressOption... options) { - return compute.get(addressId(), options); + return compute.getAddress(addressId(), options); } /** @@ -145,7 +145,7 @@ public Address reload(Compute.AddressOption... options) { * @throws ComputeException upon failure */ public Operation delete(Compute.OperationOption... options) { - return compute.delete(addressId(), options); + return compute.deleteAddress(addressId(), options); } /** diff --git a/gcloud-java-compute/src/main/java/com/google/gcloud/compute/Compute.java b/gcloud-java-compute/src/main/java/com/google/gcloud/compute/Compute.java index 0512a1554ee0..da25d63a5c2c 100644 --- a/gcloud-java-compute/src/main/java/com/google/gcloud/compute/Compute.java +++ b/gcloud-java-compute/src/main/java/com/google/gcloud/compute/Compute.java @@ -2289,7 +2289,7 @@ public static InstanceAggregatedListOption pageToken(String pageToken) { * * @throws ComputeException upon failure */ - Operation get(OperationId operationId, OperationOption... options); + Operation getOperation(OperationId operationId, OperationOption... options); /** * Lists the global operations. @@ -2321,14 +2321,14 @@ public static InstanceAggregatedListOption pageToken(String pageToken) { * @return {@code true} if operation was deleted, {@code false} if it was not found * @throws ComputeException upon failure */ - boolean delete(OperationId operation); + boolean deleteOperation(OperationId operation); /** * Returns the requested address or {@code null} if not found. * * @throws ComputeException upon failure */ - Address get(AddressId addressId, AddressOption... options); + Address getAddress(AddressId addressId, AddressOption... options); /** * Creates a new address. @@ -2366,7 +2366,7 @@ public static InstanceAggregatedListOption pageToken(String pageToken) { * found * @throws ComputeException upon failure */ - Operation delete(AddressId addressId, OperationOption... options); + Operation deleteAddress(AddressId addressId, OperationOption... options); /** * Creates a new snapshot. @@ -2429,7 +2429,7 @@ public static InstanceAggregatedListOption pageToken(String pageToken) { * * @throws ComputeException upon failure */ - Image get(ImageId imageId, ImageOption... options); + Image getImage(ImageId imageId, ImageOption... options); /** * Lists images in the provided project that are available to the current user. This method can be @@ -2457,7 +2457,7 @@ public static InstanceAggregatedListOption pageToken(String pageToken) { * image was not found * @throws ComputeException upon failure or if {@code image} is a publicly-available image */ - Operation delete(ImageId image, OperationOption... options); + Operation deleteImage(ImageId image, OperationOption... options); /** * Deprecates the requested image. @@ -2474,7 +2474,7 @@ Operation deprecate(ImageId image, DeprecationStatus deprecationStatus, * * @throws ComputeException upon failure */ - Disk get(DiskId diskId, DiskOption... options); + Disk getDisk(DiskId diskId, DiskOption... options); /** * Creates a new disk. @@ -2505,7 +2505,7 @@ Operation deprecate(ImageId image, DeprecationStatus deprecationStatus, * found * @throws ComputeException upon failure */ - Operation delete(DiskId disk, OperationOption... options); + Operation deleteDisk(DiskId disk, OperationOption... options); /** * Resizes the disk to the requested size. The new size must be larger than the previous one. @@ -2529,7 +2529,7 @@ Operation deprecate(ImageId image, DeprecationStatus deprecationStatus, * * @throws ComputeException upon failure */ - Subnetwork get(SubnetworkId subnetworkId, SubnetworkOption... options); + Subnetwork getSubnetwork(SubnetworkId subnetworkId, SubnetworkOption... options); /** * Lists subnetworks for the provided region. @@ -2553,7 +2553,7 @@ Operation deprecate(ImageId image, DeprecationStatus deprecationStatus, * subnetwork was not found * @throws ComputeException upon failure */ - Operation delete(SubnetworkId subnetwork, OperationOption... options); + Operation deleteSubnetwork(SubnetworkId subnetwork, OperationOption... options); /** * Creates a new network. @@ -2608,7 +2608,7 @@ Operation deprecate(ImageId image, DeprecationStatus deprecationStatus, * * @throws ComputeException upon failure */ - Instance get(InstanceId instance, InstanceOption... options); + Instance getInstance(InstanceId instance, InstanceOption... options); /** * Lists instances for the provided zone. @@ -2631,7 +2631,7 @@ Operation deprecate(ImageId image, DeprecationStatus deprecationStatus, * instance was not found * @throws ComputeException upon failure */ - Operation delete(InstanceId instance, OperationOption... options); + Operation deleteInstance(InstanceId instance, OperationOption... options); /** * Adds an access configuration to an instance's network interface. diff --git a/gcloud-java-compute/src/main/java/com/google/gcloud/compute/ComputeImpl.java b/gcloud-java-compute/src/main/java/com/google/gcloud/compute/ComputeImpl.java index 3a8f46a88265..f70477fea0d7 100644 --- a/gcloud-java-compute/src/main/java/com/google/gcloud/compute/ComputeImpl.java +++ b/gcloud-java-compute/src/main/java/com/google/gcloud/compute/ComputeImpl.java @@ -765,7 +765,7 @@ public com.google.api.services.compute.model.License call() { } @Override - public Operation get(final OperationId operationId, OperationOption... options) { + public Operation getOperation(final OperationId operationId, OperationOption... options) { final Map optionsMap = optionMap(options); try { com.google.api.services.compute.model.Operation answer = @@ -889,7 +889,7 @@ Iterable> call() { } @Override - public boolean delete(final OperationId operation) { + public boolean deleteOperation(final OperationId operation) { try { return runWithRetries(new Callable() { @Override @@ -916,7 +916,7 @@ public Boolean call() { } @Override - public Address get(final AddressId addressId, AddressOption... options) { + public Address getAddress(final AddressId addressId, AddressOption... options) { final Map optionsMap = optionMap(options); try { com.google.api.services.compute.model.Address answer = @@ -1069,7 +1069,7 @@ public Address apply(com.google.api.services.compute.model.Address address) { } @Override - public Operation delete(final AddressId addressId, OperationOption... options) { + public Operation deleteAddress(final AddressId addressId, OperationOption... options) { final Map optionsMap = optionMap(options); try { com.google.api.services.compute.model.Operation answer = @@ -1206,7 +1206,7 @@ public com.google.api.services.compute.model.Operation call() { } @Override - public Image get(ImageId imageId, ImageOption... options) { + public Image getImage(ImageId imageId, ImageOption... options) { final ImageId completeImageId = imageId.setProjectId(options().projectId()); final Map optionsMap = optionMap(options); try { @@ -1264,7 +1264,7 @@ public Image apply(com.google.api.services.compute.model.Image image) { } @Override - public Operation delete(ImageId image, OperationOption... options) { + public Operation deleteImage(ImageId image, OperationOption... options) { final ImageId completeId = image.setProjectId(options().projectId()); final Map optionsMap = optionMap(options); try { @@ -1302,7 +1302,7 @@ public com.google.api.services.compute.model.Operation call() { } @Override - public Disk get(final DiskId diskId, DiskOption... options) { + public Disk getDisk(final DiskId diskId, DiskOption... options) { final Map optionsMap = optionMap(options); try { com.google.api.services.compute.model.Disk answer = @@ -1403,7 +1403,7 @@ Iterable> call() { } @Override - public Operation delete(final DiskId disk, OperationOption... options) { + public Operation deleteDisk(final DiskId disk, OperationOption... options) { final Map optionsMap = optionMap(options); try { com.google.api.services.compute.model.Operation answer = @@ -1455,7 +1455,7 @@ public com.google.api.services.compute.model.Operation call() { } @Override - public Subnetwork get(final SubnetworkId subnetworkId, SubnetworkOption... options) { + public Subnetwork getSubnetwork(final SubnetworkId subnetworkId, SubnetworkOption... options) { final Map optionsMap = optionMap(options); try { com.google.api.services.compute.model.Subnetwork answer = @@ -1539,7 +1539,7 @@ Iterable> call() { } @Override - public Operation delete(final SubnetworkId subnetwork, OperationOption... options) { + public Operation deleteSubnetwork(final SubnetworkId subnetwork, OperationOption... options) { final Map optionsMap = optionMap(options); try { com.google.api.services.compute.model.Operation answer = @@ -1667,7 +1667,7 @@ public com.google.api.services.compute.model.Operation call() { } @Override - public Instance get(final InstanceId instance, InstanceOption... options) { + public Instance getInstance(final InstanceId instance, InstanceOption... options) { final Map optionsMap = optionMap(options); try { com.google.api.services.compute.model.Instance answer = @@ -1750,7 +1750,7 @@ Iterable> call() { } @Override - public Operation delete(final InstanceId instance, OperationOption... options) { + public Operation deleteInstance(final InstanceId instance, OperationOption... options) { final Map optionsMap = optionMap(options); try { com.google.api.services.compute.model.Operation answer = 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 9904f49b819e..5b0507afafd7 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 @@ -149,7 +149,7 @@ public boolean exists() { * @throws ComputeException upon failure */ public Disk reload(DiskOption... options) { - return compute.get(diskId(), options); + return compute.getDisk(diskId(), options); } /** @@ -160,7 +160,7 @@ public Disk reload(DiskOption... options) { * @throws ComputeException upon failure */ public Operation delete(OperationOption... options) { - return compute.delete(diskId(), options); + return compute.deleteDisk(diskId(), options); } /** 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 a68febb01c7e..66e71fb1c196 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 @@ -148,7 +148,7 @@ public boolean exists() { * @throws ComputeException upon failure */ public Image reload(ImageOption... options) { - return compute.get(imageId(), options); + return compute.getImage(imageId(), options); } /** @@ -159,7 +159,7 @@ public Image reload(ImageOption... options) { * @throws ComputeException upon failure or if this image is a publicly-available image */ public Operation delete(OperationOption... options) { - return compute.delete(imageId(), options); + return compute.deleteImage(imageId(), options); } /** 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 7c84d11d71d7..415b4d1cfa4e 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 @@ -202,7 +202,7 @@ public boolean exists() { * @throws ComputeException upon failure */ public Instance reload(InstanceOption... options) { - return compute.get(instanceId(), options); + return compute.getInstance(instanceId(), options); } /** @@ -213,7 +213,7 @@ public Instance reload(InstanceOption... options) { * @throws ComputeException upon failure */ public Operation delete(OperationOption... options) { - return compute.delete(instanceId(), options); + return compute.deleteInstance(instanceId(), options); } /** 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 3e4935dbb859..10f1d968608b 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 @@ -652,8 +652,8 @@ public boolean exists() throws ComputeException { * @throws ComputeException upon failure */ public boolean isDone() throws ComputeException { - Operation operation = - compute.get(operationId, Compute.OperationOption.fields(Compute.OperationField.STATUS)); + Operation operation = compute.getOperation(operationId, + Compute.OperationOption.fields(Compute.OperationField.STATUS)); return operation == null || operation.status() == Status.DONE; } @@ -666,7 +666,7 @@ public boolean isDone() throws ComputeException { * @throws ComputeException upon failure */ public Operation reload(Compute.OperationOption... options) throws ComputeException { - return compute.get(operationId, options); + return compute.getOperation(operationId, options); } /** @@ -677,7 +677,7 @@ public Operation reload(Compute.OperationOption... options) throws ComputeExcept * @throws ComputeException upon failure */ public boolean delete() throws ComputeException { - return compute.delete(operationId); + return compute.deleteOperation(operationId); } @Override 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 035af9f829c2..31fc72a0f3de 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 @@ -135,7 +135,7 @@ public boolean exists() { * @throws ComputeException upon failure */ public Subnetwork reload(SubnetworkOption... options) { - return compute.get(subnetworkId(), options); + return compute.getSubnetwork(subnetworkId(), options); } /** @@ -146,7 +146,7 @@ public Subnetwork reload(SubnetworkOption... options) { * @throws ComputeException upon failure */ public Operation delete(OperationOption... options) { - return compute.delete(subnetworkId(), options); + return compute.deleteSubnetwork(subnetworkId(), options); } /** 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 2fe9e516f486..e6b7cbee888d 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 @@ -203,7 +203,7 @@ public void testDeleteOperation() { Operation operation = new Operation.Builder(serviceMockReturnsOptions) .operationId(GlobalOperationId.of("project", "op")) .build(); - expect(compute.delete(REGION_ADDRESS_ID)).andReturn(operation); + expect(compute.deleteAddress(REGION_ADDRESS_ID)).andReturn(operation); replay(compute); initializeAddress(); assertSame(operation, address.delete()); @@ -213,7 +213,7 @@ public void testDeleteOperation() { public void testDeleteNull() { initializeExpectedAddress(3); expect(compute.options()).andReturn(mockOptions); - expect(compute.delete(REGION_ADDRESS_ID)).andReturn(null); + expect(compute.deleteAddress(REGION_ADDRESS_ID)).andReturn(null); replay(compute); initializeAddress(); assertNull(address.delete()); @@ -224,7 +224,7 @@ public void testExists_True() throws Exception { initializeExpectedAddress(3); Compute.AddressOption[] expectedOptions = {Compute.AddressOption.fields()}; expect(compute.options()).andReturn(mockOptions); - expect(compute.get(REGION_ADDRESS_ID, expectedOptions)).andReturn(regionForwardingAddress); + expect(compute.getAddress(REGION_ADDRESS_ID, expectedOptions)).andReturn(regionForwardingAddress); replay(compute); initializeAddress(); assertTrue(address.exists()); @@ -236,7 +236,7 @@ public void testExists_False() throws Exception { initializeExpectedAddress(3); Compute.AddressOption[] expectedOptions = {Compute.AddressOption.fields()}; expect(compute.options()).andReturn(mockOptions); - expect(compute.get(REGION_ADDRESS_ID, expectedOptions)).andReturn(null); + expect(compute.getAddress(REGION_ADDRESS_ID, expectedOptions)).andReturn(null); replay(compute); initializeAddress(); assertFalse(address.exists()); @@ -247,7 +247,7 @@ public void testExists_False() throws Exception { public void testReload() throws Exception { initializeExpectedAddress(5); expect(compute.options()).andReturn(mockOptions); - expect(compute.get(REGION_ADDRESS_ID)).andReturn(regionForwardingAddress); + expect(compute.getAddress(REGION_ADDRESS_ID)).andReturn(regionForwardingAddress); replay(compute); initializeAddress(); Address updatedAddress = address.reload(); @@ -259,7 +259,7 @@ public void testReload() throws Exception { public void testReloadNull() throws Exception { initializeExpectedAddress(3); expect(compute.options()).andReturn(mockOptions); - expect(compute.get(REGION_ADDRESS_ID)).andReturn(null); + expect(compute.getAddress(REGION_ADDRESS_ID)).andReturn(null); replay(compute); initializeAddress(); assertNull(address.reload()); @@ -270,7 +270,7 @@ public void testReloadNull() throws Exception { public void testReloadWithOptions() throws Exception { initializeExpectedAddress(5); expect(compute.options()).andReturn(mockOptions); - expect(compute.get(REGION_ADDRESS_ID, Compute.AddressOption.fields())) + expect(compute.getAddress(REGION_ADDRESS_ID, Compute.AddressOption.fields())) .andReturn(regionForwardingAddress); replay(compute); initializeAddress(); 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 32cf4bba12d3..07c7b851e0bf 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 @@ -1272,7 +1272,7 @@ public void testGetGlobalOperation() { .andReturn(globalOperation.toPb()); EasyMock.replay(computeRpcMock); compute = options.service(); - assertEquals(globalOperation, compute.get(GLOBAL_OPERATION_ID)); + assertEquals(globalOperation, compute.getOperation(GLOBAL_OPERATION_ID)); } @Test @@ -1282,7 +1282,7 @@ public void testGetGlobalOperation_Null() { .andReturn(null); EasyMock.replay(computeRpcMock); compute = options.service(); - assertNull(compute.get(GLOBAL_OPERATION_ID)); + assertNull(compute.getOperation(GLOBAL_OPERATION_ID)); } @Test @@ -1293,7 +1293,7 @@ public void testGetGlobalOperationWithSelectedFields() { .andReturn(globalOperation.toPb()); EasyMock.replay(computeRpcMock); compute = options.service(); - Operation operation = compute.get(GLOBAL_OPERATION_ID, OPERATION_OPTION_FIELDS); + Operation operation = compute.getOperation(GLOBAL_OPERATION_ID, OPERATION_OPTION_FIELDS); String selector = (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.rpcOption()); assertTrue(selector.contains("selfLink")); assertTrue(selector.contains("id")); @@ -1375,7 +1375,7 @@ public void testDeleteGlobalOperation_True() { .andReturn(true); EasyMock.replay(computeRpcMock); compute = options.service(); - assertTrue(compute.delete(GLOBAL_OPERATION_ID)); + assertTrue(compute.deleteOperation(GLOBAL_OPERATION_ID)); } @Test @@ -1384,7 +1384,7 @@ public void testDeleteGlobalOperation_False() { .andReturn(false); EasyMock.replay(computeRpcMock); compute = options.service(); - assertFalse(compute.delete(GLOBAL_OPERATION_ID)); + assertFalse(compute.deleteOperation(GLOBAL_OPERATION_ID)); } @Test @@ -1394,7 +1394,7 @@ public void testGetRegionOperation() { .andReturn(regionOperation.toPb()); EasyMock.replay(computeRpcMock); compute = options.service(); - Operation operation = compute.get(REGION_OPERATION_ID); + Operation operation = compute.getOperation(REGION_OPERATION_ID); assertEquals(regionOperation, operation); } @@ -1405,7 +1405,7 @@ public void testGetRegionOperation_Null() { .andReturn(regionOperation.toPb()); EasyMock.replay(computeRpcMock); compute = options.service(); - Operation operation = compute.get(REGION_OPERATION_ID); + Operation operation = compute.getOperation(REGION_OPERATION_ID); assertEquals(regionOperation, operation); } @@ -1417,7 +1417,7 @@ public void testGetRegionOperationWithSelectedFields() { .andReturn(regionOperation.toPb()); EasyMock.replay(computeRpcMock); compute = options.service(); - Operation operation = compute.get(REGION_OPERATION_ID, OPERATION_OPTION_FIELDS); + Operation operation = compute.getOperation(REGION_OPERATION_ID, OPERATION_OPTION_FIELDS); String selector = (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.rpcOption()); assertTrue(selector.contains("selfLink")); assertTrue(selector.contains("id")); @@ -1507,7 +1507,7 @@ public void testDeleteRegionOperation_True() { REGION_OPERATION_ID.operation())).andReturn(true); EasyMock.replay(computeRpcMock); compute = options.service(); - assertTrue(compute.delete(REGION_OPERATION_ID)); + assertTrue(compute.deleteOperation(REGION_OPERATION_ID)); } @Test @@ -1516,7 +1516,7 @@ public void testDeleteRegionOperation_False() { REGION_OPERATION_ID.operation())).andReturn(false); EasyMock.replay(computeRpcMock); compute = options.service(); - assertFalse(compute.delete(REGION_OPERATION_ID)); + assertFalse(compute.deleteOperation(REGION_OPERATION_ID)); } @Test @@ -1525,7 +1525,7 @@ public void testGetZoneOperation() { ZONE_OPERATION_ID.operation(), EMPTY_RPC_OPTIONS)).andReturn(zoneOperation.toPb()); EasyMock.replay(computeRpcMock); compute = options.service(); - Operation operation = compute.get(ZONE_OPERATION_ID); + Operation operation = compute.getOperation(ZONE_OPERATION_ID); assertEquals(zoneOperation, operation); } @@ -1535,7 +1535,7 @@ public void testGetZoneOperation_Null() { ZONE_OPERATION_ID.operation(), EMPTY_RPC_OPTIONS)).andReturn(null); EasyMock.replay(computeRpcMock); compute = options.service(); - assertNull(compute.get(ZONE_OPERATION_ID)); + assertNull(compute.getOperation(ZONE_OPERATION_ID)); } @Test @@ -1546,7 +1546,7 @@ public void testGetZoneOperationWithSelectedFields() { .andReturn(zoneOperation.toPb()); EasyMock.replay(computeRpcMock); compute = options.service(); - Operation operation = compute.get(ZONE_OPERATION_ID, OPERATION_OPTION_FIELDS); + Operation operation = compute.getOperation(ZONE_OPERATION_ID, OPERATION_OPTION_FIELDS); String selector = (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.rpcOption()); assertTrue(selector.contains("selfLink")); assertTrue(selector.contains("id")); @@ -1636,7 +1636,7 @@ public void testDeleteZoneOperation_True() { ZONE_OPERATION_ID.operation())).andReturn(true); EasyMock.replay(computeRpcMock); compute = options.service(); - assertTrue(compute.delete(ZONE_OPERATION_ID)); + assertTrue(compute.deleteOperation(ZONE_OPERATION_ID)); } @Test @@ -1645,7 +1645,7 @@ public void testDeleteZoneOperation_False() { ZONE_OPERATION_ID.operation())).andReturn(false); EasyMock.replay(computeRpcMock); compute = options.service(); - assertFalse(compute.delete(ZONE_OPERATION_ID)); + assertFalse(compute.deleteOperation(ZONE_OPERATION_ID)); } @Test @@ -1654,7 +1654,7 @@ public void testGetGlobalAddress() { .andReturn(GLOBAL_ADDRESS.toPb()); EasyMock.replay(computeRpcMock); compute = options.service(); - Address address = compute.get(GLOBAL_ADDRESS_ID); + Address address = compute.getAddress(GLOBAL_ADDRESS_ID); assertEquals(new Address(compute, new AddressInfo.BuilderImpl(GLOBAL_ADDRESS)), address); } @@ -1664,7 +1664,7 @@ public void testGetGlobalAddress_Null() { .andReturn(null); EasyMock.replay(computeRpcMock); compute = options.service(); - assertNull(compute.get(GLOBAL_ADDRESS_ID)); + assertNull(compute.getAddress(GLOBAL_ADDRESS_ID)); } @Test @@ -1675,7 +1675,7 @@ public void testGetGlobalAddressWithSelectedFields() { .andReturn(GLOBAL_ADDRESS.toPb()); EasyMock.replay(computeRpcMock); compute = options.service(); - Address address = compute.get(GLOBAL_ADDRESS_ID, ADDRESS_OPTION_FIELDS); + Address address = compute.getAddress(GLOBAL_ADDRESS_ID, ADDRESS_OPTION_FIELDS); String selector = (String) capturedOptions.getValue().get(ADDRESS_OPTION_FIELDS.rpcOption()); assertTrue(selector.contains("selfLink")); assertTrue(selector.contains("id")); @@ -1690,7 +1690,7 @@ public void testGetRegionAddress() { REGION_ADDRESS_ID.address(), EMPTY_RPC_OPTIONS)).andReturn(REGION_ADDRESS.toPb()); EasyMock.replay(computeRpcMock); compute = options.service(); - Address address = compute.get(REGION_ADDRESS_ID); + Address address = compute.getAddress(REGION_ADDRESS_ID); assertEquals(new Address(compute, new AddressInfo.BuilderImpl(REGION_ADDRESS)), address); } @@ -1700,7 +1700,7 @@ public void testGetRegionAddress_Null() { REGION_ADDRESS_ID.address(), EMPTY_RPC_OPTIONS)).andReturn(REGION_ADDRESS.toPb()); EasyMock.replay(computeRpcMock); compute = options.service(); - Address address = compute.get(REGION_ADDRESS_ID); + Address address = compute.getAddress(REGION_ADDRESS_ID); assertEquals(new Address(compute, new AddressInfo.BuilderImpl(REGION_ADDRESS)), address); } @@ -1712,7 +1712,7 @@ public void testGetRegionAddressWithSelectedFields() { .andReturn(REGION_ADDRESS.toPb()); EasyMock.replay(computeRpcMock); compute = options.service(); - Address address = compute.get(REGION_ADDRESS_ID, ADDRESS_OPTION_FIELDS); + Address address = compute.getAddress(REGION_ADDRESS_ID, ADDRESS_OPTION_FIELDS); String selector = (String) capturedOptions.getValue().get(ADDRESS_OPTION_FIELDS.rpcOption()); assertTrue(selector.contains("selfLink")); assertTrue(selector.contains("id")); @@ -1728,7 +1728,7 @@ public void testDeleteGlobalAddress_Operation() { .andReturn(globalOperation.toPb()); EasyMock.replay(computeRpcMock); compute = options.service(); - assertEquals(globalOperation, compute.delete(GLOBAL_ADDRESS_ID)); + assertEquals(globalOperation, compute.deleteAddress(GLOBAL_ADDRESS_ID)); } @Test @@ -1738,7 +1738,7 @@ public void testDeleteGlobalAddressWithSelectedFields_Operation() { capture(capturedOptions))).andReturn(globalOperation.toPb()); EasyMock.replay(computeRpcMock); compute = options.service(); - Operation operation = compute.delete(GLOBAL_ADDRESS_ID, OPERATION_OPTION_FIELDS); + Operation operation = compute.deleteAddress(GLOBAL_ADDRESS_ID, OPERATION_OPTION_FIELDS); String selector = (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.rpcOption()); assertTrue(selector.contains("selfLink")); assertTrue(selector.contains("id")); @@ -1754,7 +1754,7 @@ public void testDeleteGlobalAddress_Null() { .andReturn(null); EasyMock.replay(computeRpcMock); compute = options.service(); - assertNull(compute.delete(GLOBAL_ADDRESS_ID)); + assertNull(compute.deleteAddress(GLOBAL_ADDRESS_ID)); } @Test @@ -1763,7 +1763,7 @@ public void testDeleteRegionAddress_Operation() { REGION_ADDRESS_ID.address(), EMPTY_RPC_OPTIONS)).andReturn(regionOperation.toPb()); EasyMock.replay(computeRpcMock); compute = options.service(); - assertEquals(regionOperation, compute.delete(REGION_ADDRESS_ID)); + assertEquals(regionOperation, compute.deleteAddress(REGION_ADDRESS_ID)); } @Test @@ -1774,7 +1774,7 @@ public void testDeleteRegionAddressWithSelectedFields_Operation() { .andReturn(globalOperation.toPb()); EasyMock.replay(computeRpcMock); compute = options.service(); - Operation operation = compute.delete(REGION_ADDRESS_ID, OPERATION_OPTION_FIELDS); + Operation operation = compute.deleteAddress(REGION_ADDRESS_ID, OPERATION_OPTION_FIELDS); String selector = (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.rpcOption()); assertTrue(selector.contains("selfLink")); assertTrue(selector.contains("id")); @@ -1789,7 +1789,7 @@ public void testDeleteRegionAddress_Null() { REGION_ADDRESS_ID.address(), EMPTY_RPC_OPTIONS)).andReturn(null); EasyMock.replay(computeRpcMock); compute = options.service(); - assertNull(compute.delete(REGION_ADDRESS_ID)); + assertNull(compute.deleteAddress(REGION_ADDRESS_ID)); } @Test @@ -2276,7 +2276,7 @@ public void testGetImage() { .andReturn(IMAGE.toPb()); EasyMock.replay(computeRpcMock); compute = options.service(); - Image image = compute.get(IMAGE_ID); + Image image = compute.getImage(IMAGE_ID); assertEquals(new Image(compute, new ImageInfo.BuilderImpl(IMAGE)), image); } @@ -2287,7 +2287,7 @@ public void testGetImage_Null() { .andReturn(null); EasyMock.replay(computeRpcMock); compute = options.service(); - assertNull(compute.get(IMAGE_ID)); + assertNull(compute.getImage(IMAGE_ID)); } @Test @@ -2297,7 +2297,7 @@ public void testGetImageWithSelectedFields() { capture(capturedOptions))).andReturn(IMAGE.toPb()); EasyMock.replay(computeRpcMock); compute = options.service(); - Image image = compute.get(IMAGE_ID, IMAGE_OPTION_FIELDS); + Image image = compute.getImage(IMAGE_ID, IMAGE_OPTION_FIELDS); String selector = (String) capturedOptions.getValue().get(IMAGE_OPTION_FIELDS.rpcOption()); assertTrue(selector.contains("selfLink")); assertTrue(selector.contains("id")); @@ -2314,7 +2314,7 @@ public void testDeleteImage_Operation() { EMPTY_RPC_OPTIONS)).andReturn(globalOperation.toPb()); EasyMock.replay(computeRpcMock); compute = options.service(); - assertEquals(globalOperation, compute.delete(IMAGE_ID)); + assertEquals(globalOperation, compute.deleteImage(IMAGE_ID)); } @Test @@ -2324,7 +2324,7 @@ public void testDeleteImageWithSelectedFields_Operation() { capture(capturedOptions))).andReturn(globalOperation.toPb()); EasyMock.replay(computeRpcMock); compute = options.service(); - Operation operation = compute.delete(ImageId.of("image"), OPERATION_OPTION_FIELDS); + Operation operation = compute.deleteImage(ImageId.of("image"), OPERATION_OPTION_FIELDS); String selector = (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.rpcOption()); assertTrue(selector.contains("selfLink")); assertTrue(selector.contains("id")); @@ -2339,7 +2339,7 @@ public void testDeleteImage_Null() { EMPTY_RPC_OPTIONS)).andReturn(null); EasyMock.replay(computeRpcMock); compute = options.service(); - assertNull(compute.delete(IMAGE_ID)); + assertNull(compute.deleteImage(IMAGE_ID)); } @Test @@ -2501,7 +2501,7 @@ public void testGetDisk() { .andReturn(DISK.toPb()); EasyMock.replay(computeRpcMock); compute = options.service(); - Disk disk = compute.get(DISK_ID); + Disk disk = compute.getDisk(DISK_ID); assertEquals(new Disk(compute, new DiskInfo.BuilderImpl(DISK)), disk); } @@ -2511,7 +2511,7 @@ public void testGetDisk_Null() { .andReturn(null); EasyMock.replay(computeRpcMock); compute = options.service(); - assertNull(compute.get(DISK_ID)); + assertNull(compute.getDisk(DISK_ID)); } @Test @@ -2521,7 +2521,7 @@ public void testGetDiskWithSelectedFields() { capture(capturedOptions))).andReturn(DISK.toPb()); EasyMock.replay(computeRpcMock); compute = options.service(); - Disk disk = compute.get(DISK_ID, DISK_OPTION_FIELDS); + Disk disk = compute.getDisk(DISK_ID, DISK_OPTION_FIELDS); String selector = (String) capturedOptions.getValue().get(DISK_OPTION_FIELDS.rpcOption()); assertTrue(selector.contains("selfLink")); assertTrue(selector.contains("type")); @@ -2539,7 +2539,7 @@ public void testDeleteDisk_Operation() { .andReturn(zoneOperation.toPb()); EasyMock.replay(computeRpcMock); compute = options.service(); - assertEquals(zoneOperation, compute.delete(DISK_ID)); + assertEquals(zoneOperation, compute.deleteDisk(DISK_ID)); } @Test @@ -2549,7 +2549,7 @@ public void testDeleteDiskWithSelectedFields_Operation() { capture(capturedOptions))).andReturn(zoneOperation.toPb()); EasyMock.replay(computeRpcMock); compute = options.service(); - Operation operation = compute.delete(DISK_ID, OPERATION_OPTION_FIELDS); + Operation operation = compute.deleteDisk(DISK_ID, OPERATION_OPTION_FIELDS); String selector = (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.rpcOption()); assertTrue(selector.contains("selfLink")); assertTrue(selector.contains("id")); @@ -2564,7 +2564,7 @@ public void testDeleteDisk_Null() { .andReturn(null); EasyMock.replay(computeRpcMock); compute = options.service(); - assertNull(compute.delete(DISK_ID)); + assertNull(compute.deleteDisk(DISK_ID)); } @Test @@ -2786,7 +2786,7 @@ public void testGetSubnetwork() { EMPTY_RPC_OPTIONS)).andReturn(SUBNETWORK.toPb()); EasyMock.replay(computeRpcMock); compute = options.service(); - Subnetwork subnetwork = compute.get(SUBNETWORK_ID); + Subnetwork subnetwork = compute.getSubnetwork(SUBNETWORK_ID); assertEquals(new Subnetwork(compute, new SubnetworkInfo.BuilderImpl(SUBNETWORK)), subnetwork); } @@ -2796,7 +2796,7 @@ public void testGetSubnetwork_Null() { EMPTY_RPC_OPTIONS)).andReturn(null); EasyMock.replay(computeRpcMock); compute = options.service(); - assertNull(compute.get(SUBNETWORK_ID)); + assertNull(compute.getSubnetwork(SUBNETWORK_ID)); } @Test @@ -2806,7 +2806,7 @@ public void testGetSubnetworkWithSelectedFields() { eq(SUBNETWORK_ID.subnetwork()), capture(capturedOptions))).andReturn(SUBNETWORK.toPb()); EasyMock.replay(computeRpcMock); compute = options.service(); - Subnetwork subnetwork = compute.get(SUBNETWORK_ID, SUBNETWORK_OPTION_FIELDS); + Subnetwork subnetwork = compute.getSubnetwork(SUBNETWORK_ID, SUBNETWORK_OPTION_FIELDS); String selector = (String) capturedOptions.getValue().get(SUBNETWORK_OPTION_FIELDS.rpcOption()); assertTrue(selector.contains("selfLink")); assertTrue(selector.contains("id")); @@ -2821,7 +2821,7 @@ public void testDeleteSubnetwork_Operation() { SUBNETWORK_ID.subnetwork(), EMPTY_RPC_OPTIONS)).andReturn(regionOperation.toPb()); EasyMock.replay(computeRpcMock); compute = options.service(); - assertEquals(regionOperation, compute.delete(SUBNETWORK_ID)); + assertEquals(regionOperation, compute.deleteSubnetwork(SUBNETWORK_ID)); } @Test @@ -2832,7 +2832,7 @@ public void testDeleteSubnetworkWithSelectedFields_Operation() { .andReturn(regionOperation.toPb()); EasyMock.replay(computeRpcMock); compute = options.service(); - Operation operation = compute.delete(SUBNETWORK_ID, OPERATION_OPTION_FIELDS); + Operation operation = compute.deleteSubnetwork(SUBNETWORK_ID, OPERATION_OPTION_FIELDS); String selector = (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.rpcOption()); assertTrue(selector.contains("selfLink")); assertTrue(selector.contains("id")); @@ -2847,7 +2847,7 @@ public void testDeleteSubnetwork_Null() { SUBNETWORK_ID.subnetwork(), EMPTY_RPC_OPTIONS)).andReturn(null); EasyMock.replay(computeRpcMock); compute = options.service(); - assertNull(compute.delete(SUBNETWORK_ID)); + assertNull(compute.deleteSubnetwork(SUBNETWORK_ID)); } @Test @@ -3213,7 +3213,7 @@ public void testGetInstance() { EMPTY_RPC_OPTIONS)).andReturn(INSTANCE.toPb()); EasyMock.replay(computeRpcMock); compute = options.service(); - Instance instance = compute.get(INSTANCE_ID); + Instance instance = compute.getInstance(INSTANCE_ID); assertEquals(new Instance(compute, new InstanceInfo.BuilderImpl(INSTANCE)), instance); } @@ -3223,7 +3223,7 @@ public void testGetInstance_Null() { EMPTY_RPC_OPTIONS)).andReturn(null); EasyMock.replay(computeRpcMock); compute = options.service(); - assertNull(compute.get(INSTANCE_ID)); + assertNull(compute.getInstance(INSTANCE_ID)); } @Test @@ -3233,7 +3233,7 @@ public void testGetInstanceWithSelectedFields() { capture(capturedOptions))).andReturn(INSTANCE.toPb()); EasyMock.replay(computeRpcMock); compute = options.service(); - Instance instance = compute.get(INSTANCE_ID, INSTANCE_OPTION_FIELDS); + Instance instance = compute.getInstance(INSTANCE_ID, INSTANCE_OPTION_FIELDS); String selector = (String) capturedOptions.getValue().get(INSTANCE_OPTION_FIELDS.rpcOption()); assertTrue(selector.contains("selfLink")); assertTrue(selector.contains("id")); @@ -3248,7 +3248,7 @@ public void testDeleteInstance_Operation() { EMPTY_RPC_OPTIONS)).andReturn(zoneOperation.toPb()); EasyMock.replay(computeRpcMock); compute = options.service(); - assertEquals(zoneOperation, compute.delete(INSTANCE_ID)); + assertEquals(zoneOperation, compute.deleteInstance(INSTANCE_ID)); } @Test @@ -3258,7 +3258,7 @@ public void testDeleteInstanceWithSelectedFields_Operation() { eq(INSTANCE_ID.instance()), capture(capturedOptions))).andReturn(zoneOperation.toPb()); EasyMock.replay(computeRpcMock); compute = options.service(); - Operation operation = compute.delete(INSTANCE_ID, OPERATION_OPTION_FIELDS); + Operation operation = compute.deleteInstance(INSTANCE_ID, OPERATION_OPTION_FIELDS); String selector = (String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.rpcOption()); assertTrue(selector.contains("selfLink")); assertTrue(selector.contains("id")); @@ -3273,7 +3273,7 @@ public void testDeleteInstance_Null() { EMPTY_RPC_OPTIONS)).andReturn(null); EasyMock.replay(computeRpcMock); compute = options.service(); - assertNull(compute.delete(INSTANCE_ID)); + assertNull(compute.deleteInstance(INSTANCE_ID)); } @Test 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 8b54a1ea2715..db50d8a22cd6 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 @@ -228,7 +228,7 @@ public void testDeleteOperation() { Operation operation = new Operation.Builder(serviceMockReturnsOptions) .operationId(ZoneOperationId.of("project", "zone", "op")) .build(); - expect(compute.delete(DISK_ID)).andReturn(operation); + expect(compute.deleteDisk(DISK_ID)).andReturn(operation); replay(compute); initializeDisk(); assertSame(operation, disk.delete()); @@ -238,7 +238,7 @@ public void testDeleteOperation() { public void testDeleteNull() { initializeExpectedDisk(3); expect(compute.options()).andReturn(mockOptions); - expect(compute.delete(DISK_ID)).andReturn(null); + expect(compute.deleteDisk(DISK_ID)).andReturn(null); replay(compute); initializeDisk(); assertNull(disk.delete()); @@ -249,7 +249,7 @@ public void testExists_True() throws Exception { initializeExpectedDisk(3); Compute.DiskOption[] expectedOptions = {Compute.DiskOption.fields()}; expect(compute.options()).andReturn(mockOptions); - expect(compute.get(DISK_ID, expectedOptions)).andReturn(imageDisk); + expect(compute.getDisk(DISK_ID, expectedOptions)).andReturn(imageDisk); replay(compute); initializeDisk(); assertTrue(disk.exists()); @@ -261,7 +261,7 @@ public void testExists_False() throws Exception { initializeExpectedDisk(3); Compute.DiskOption[] expectedOptions = {Compute.DiskOption.fields()}; expect(compute.options()).andReturn(mockOptions); - expect(compute.get(DISK_ID, expectedOptions)).andReturn(null); + expect(compute.getDisk(DISK_ID, expectedOptions)).andReturn(null); replay(compute); initializeDisk(); assertFalse(disk.exists()); @@ -272,7 +272,7 @@ public void testExists_False() throws Exception { public void testReload() throws Exception { initializeExpectedDisk(5); expect(compute.options()).andReturn(mockOptions); - expect(compute.get(DISK_ID)).andReturn(imageDisk); + expect(compute.getDisk(DISK_ID)).andReturn(imageDisk); replay(compute); initializeDisk(); Disk updatedDisk = disk.reload(); @@ -284,7 +284,7 @@ public void testReload() throws Exception { public void testReloadNull() throws Exception { initializeExpectedDisk(3); expect(compute.options()).andReturn(mockOptions); - expect(compute.get(DISK_ID)).andReturn(null); + expect(compute.getDisk(DISK_ID)).andReturn(null); replay(compute); initializeDisk(); assertNull(disk.reload()); @@ -295,7 +295,7 @@ public void testReloadNull() throws Exception { public void testReloadWithOptions() throws Exception { initializeExpectedDisk(5); expect(compute.options()).andReturn(mockOptions); - expect(compute.get(DISK_ID, Compute.DiskOption.fields())).andReturn(imageDisk); + expect(compute.getDisk(DISK_ID, Compute.DiskOption.fields())).andReturn(imageDisk); replay(compute); initializeDisk(); Disk updatedDisk = disk.reload(Compute.DiskOption.fields()); 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 43e27d011974..1512bdcb30b1 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 @@ -189,7 +189,7 @@ public void testDeleteOperation() { Operation operation = new Operation.Builder(serviceMockReturnsOptions) .operationId(GlobalOperationId.of("project", "op")) .build(); - expect(compute.delete(IMAGE_ID)).andReturn(operation); + expect(compute.deleteImage(IMAGE_ID)).andReturn(operation); replay(compute); initializeImage(); assertSame(operation, image.delete()); @@ -199,7 +199,7 @@ public void testDeleteOperation() { public void testDeleteNull() { initializeExpectedImage(2); expect(compute.options()).andReturn(mockOptions); - expect(compute.delete(IMAGE_ID)).andReturn(null); + expect(compute.deleteImage(IMAGE_ID)).andReturn(null); replay(compute); initializeImage(); assertNull(image.delete()); @@ -210,7 +210,7 @@ public void testExists_True() throws Exception { initializeExpectedImage(2); Compute.ImageOption[] expectedOptions = {Compute.ImageOption.fields()}; expect(compute.options()).andReturn(mockOptions); - expect(compute.get(IMAGE_ID, expectedOptions)).andReturn(diskImage); + expect(compute.getImage(IMAGE_ID, expectedOptions)).andReturn(diskImage); replay(compute); initializeImage(); assertTrue(image.exists()); @@ -222,7 +222,7 @@ public void testExists_False() throws Exception { initializeExpectedImage(2); Compute.ImageOption[] expectedOptions = {Compute.ImageOption.fields()}; expect(compute.options()).andReturn(mockOptions); - expect(compute.get(IMAGE_ID, expectedOptions)).andReturn(null); + expect(compute.getImage(IMAGE_ID, expectedOptions)).andReturn(null); replay(compute); initializeImage(); assertFalse(image.exists()); @@ -233,7 +233,7 @@ public void testExists_False() throws Exception { public void testReload() throws Exception { initializeExpectedImage(5); expect(compute.options()).andReturn(mockOptions); - expect(compute.get(IMAGE_ID)).andReturn(storageImage); + expect(compute.getImage(IMAGE_ID)).andReturn(storageImage); replay(compute); initializeImage(); Image updateImage = image.reload(); @@ -245,7 +245,7 @@ public void testReload() throws Exception { public void testReloadNull() throws Exception { initializeExpectedImage(2); expect(compute.options()).andReturn(mockOptions); - expect(compute.get(IMAGE_ID)).andReturn(null); + expect(compute.getImage(IMAGE_ID)).andReturn(null); replay(compute); initializeImage(); assertNull(image.reload()); @@ -256,7 +256,7 @@ public void testReloadNull() throws Exception { public void testReloadWithOptions() throws Exception { initializeExpectedImage(5); expect(compute.options()).andReturn(mockOptions); - expect(compute.get(IMAGE_ID, Compute.ImageOption.fields())).andReturn(storageImage); + expect(compute.getImage(IMAGE_ID, Compute.ImageOption.fields())).andReturn(storageImage); replay(compute); initializeImage(); Image updateImage = image.reload(Compute.ImageOption.fields()); 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 85e2ff5311c0..44f726f4165b 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 @@ -195,7 +195,7 @@ public void testDeleteOperation() { Operation operation = new Operation.Builder(serviceMockReturnsOptions) .operationId(ZoneOperationId.of("project", "op")) .build(); - expect(compute.delete(INSTANCE_ID)).andReturn(operation); + expect(compute.deleteInstance(INSTANCE_ID)).andReturn(operation); replay(compute); initializeInstance(); assertSame(operation, instance.delete()); @@ -205,7 +205,7 @@ public void testDeleteOperation() { public void testDeleteNull() { initializeExpectedInstance(1); expect(compute.options()).andReturn(mockOptions); - expect(compute.delete(INSTANCE_ID)).andReturn(null); + expect(compute.deleteInstance(INSTANCE_ID)).andReturn(null); replay(compute); initializeInstance(); assertNull(instance.delete()); @@ -216,7 +216,7 @@ public void testExists_True() throws Exception { initializeExpectedInstance(1); InstanceOption[] expectedOptions = {InstanceOption.fields()}; expect(compute.options()).andReturn(mockOptions); - expect(compute.get(INSTANCE_ID, expectedOptions)).andReturn(expectedInstance); + expect(compute.getInstance(INSTANCE_ID, expectedOptions)).andReturn(expectedInstance); replay(compute); initializeInstance(); assertTrue(instance.exists()); @@ -228,7 +228,7 @@ public void testExists_False() throws Exception { initializeExpectedInstance(1); InstanceOption[] expectedOptions = {InstanceOption.fields()}; expect(compute.options()).andReturn(mockOptions); - expect(compute.get(INSTANCE_ID, expectedOptions)).andReturn(null); + expect(compute.getInstance(INSTANCE_ID, expectedOptions)).andReturn(null); replay(compute); initializeInstance(); assertFalse(instance.exists()); @@ -239,7 +239,7 @@ public void testExists_False() throws Exception { public void testReload() throws Exception { initializeExpectedInstance(3); expect(compute.options()).andReturn(mockOptions); - expect(compute.get(INSTANCE_ID)).andReturn(expectedInstance); + expect(compute.getInstance(INSTANCE_ID)).andReturn(expectedInstance); replay(compute); initializeInstance(); Instance updatedInstance = instance.reload(); @@ -251,7 +251,7 @@ public void testReload() throws Exception { public void testReloadNull() throws Exception { initializeExpectedInstance(1); expect(compute.options()).andReturn(mockOptions); - expect(compute.get(INSTANCE_ID)).andReturn(null); + expect(compute.getInstance(INSTANCE_ID)).andReturn(null); replay(compute); initializeInstance(); assertNull(instance.reload()); @@ -262,7 +262,7 @@ public void testReloadNull() throws Exception { public void testReloadWithOptions() throws Exception { initializeExpectedInstance(3); expect(compute.options()).andReturn(mockOptions); - expect(compute.get(INSTANCE_ID, InstanceOption.fields())).andReturn(expectedInstance); + expect(compute.getInstance(INSTANCE_ID, InstanceOption.fields())).andReturn(expectedInstance); replay(compute); initializeInstance(); Instance updateInstance = instance.reload(InstanceOption.fields()); 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 e13f77c551ad..05cba345d171 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 @@ -274,7 +274,7 @@ public void testToAndFromPb() { public void testDeleteTrue() { initializeExpectedOperation(3); expect(compute.options()).andReturn(mockOptions); - expect(compute.delete(GLOBAL_OPERATION_ID)).andReturn(true); + expect(compute.deleteOperation(GLOBAL_OPERATION_ID)).andReturn(true); replay(compute); initializeOperation(); assertTrue(operation.delete()); @@ -285,7 +285,7 @@ public void testDeleteTrue() { public void testDeleteFalse() { initializeExpectedOperation(3); expect(compute.options()).andReturn(mockOptions); - expect(compute.delete(GLOBAL_OPERATION_ID)).andReturn(false); + expect(compute.deleteOperation(GLOBAL_OPERATION_ID)).andReturn(false); replay(compute); initializeOperation(); assertFalse(operation.delete()); @@ -297,7 +297,7 @@ public void testExists_True() throws Exception { initializeExpectedOperation(3); Compute.OperationOption[] expectedOptions = {Compute.OperationOption.fields()}; expect(compute.options()).andReturn(mockOptions); - expect(compute.get(GLOBAL_OPERATION_ID, expectedOptions)).andReturn(globalOperation); + expect(compute.getOperation(GLOBAL_OPERATION_ID, expectedOptions)).andReturn(globalOperation); replay(compute); initializeOperation(); assertTrue(operation.exists()); @@ -309,7 +309,7 @@ public void testExists_False() throws Exception { initializeExpectedOperation(3); Compute.OperationOption[] expectedOptions = {Compute.OperationOption.fields()}; expect(compute.options()).andReturn(mockOptions); - expect(compute.get(GLOBAL_OPERATION_ID, expectedOptions)).andReturn(null); + expect(compute.getOperation(GLOBAL_OPERATION_ID, expectedOptions)).andReturn(null); replay(compute); initializeOperation(); assertFalse(operation.exists()); @@ -322,7 +322,7 @@ public void testIsDone_True() throws Exception { Compute.OperationOption[] expectedOptions = {Compute.OperationOption.fields(Compute.OperationField.STATUS)}; expect(compute.options()).andReturn(mockOptions); - expect(compute.get(GLOBAL_OPERATION_ID, expectedOptions)).andReturn(globalOperation); + expect(compute.getOperation(GLOBAL_OPERATION_ID, expectedOptions)).andReturn(globalOperation); replay(compute); initializeOperation(); assertTrue(operation.isDone()); @@ -335,7 +335,7 @@ public void testIsDone_False() throws Exception { Compute.OperationOption[] expectedOptions = {Compute.OperationOption.fields(Compute.OperationField.STATUS)}; expect(compute.options()).andReturn(mockOptions); - expect(compute.get(GLOBAL_OPERATION_ID, expectedOptions)).andReturn( + expect(compute.getOperation(GLOBAL_OPERATION_ID, expectedOptions)).andReturn( Operation.fromPb(serviceMockReturnsOptions, globalOperation.toPb().setStatus("PENDING"))); replay(compute); initializeOperation(); @@ -348,7 +348,7 @@ public void testIsDone_NotExists() throws Exception { Compute.OperationOption[] expectedOptions = {Compute.OperationOption.fields(Compute.OperationField.STATUS)}; expect(compute.options()).andReturn(mockOptions); - expect(compute.get(GLOBAL_OPERATION_ID, expectedOptions)).andReturn(null); + expect(compute.getOperation(GLOBAL_OPERATION_ID, expectedOptions)).andReturn(null); replay(compute); initializeOperation(); assertTrue(operation.isDone()); @@ -359,7 +359,7 @@ public void testIsDone_NotExists() throws Exception { public void testReload() throws Exception { initializeExpectedOperation(5); expect(compute.options()).andReturn(mockOptions); - expect(compute.get(GLOBAL_OPERATION_ID)).andReturn(globalOperation); + expect(compute.getOperation(GLOBAL_OPERATION_ID)).andReturn(globalOperation); replay(compute); initializeOperation(); Operation updatedOperation = operation.reload(); @@ -371,7 +371,7 @@ public void testReload() throws Exception { public void testReloadNull() throws Exception { initializeExpectedOperation(3); expect(compute.options()).andReturn(mockOptions); - expect(compute.get(GLOBAL_OPERATION_ID)).andReturn(null); + expect(compute.getOperation(GLOBAL_OPERATION_ID)).andReturn(null); replay(compute); initializeOperation(); assertNull(operation.reload()); @@ -382,7 +382,7 @@ public void testReloadNull() throws Exception { public void testReloadWithOptions() throws Exception { initializeExpectedOperation(5); expect(compute.options()).andReturn(mockOptions); - expect(compute.get(GLOBAL_OPERATION_ID, Compute.OperationOption.fields())) + expect(compute.getOperation(GLOBAL_OPERATION_ID, Compute.OperationOption.fields())) .andReturn(globalOperation); replay(compute); initializeOperation(); 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 8fc841383f1e..e394e0daf737 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 @@ -118,7 +118,7 @@ public void testDeleteOperation() { Operation operation = new Operation.Builder(serviceMockReturnsOptions) .operationId(GlobalOperationId.of("project", "op")) .build(); - expect(compute.delete(SUBNETWORK_ID)).andReturn(operation); + expect(compute.deleteSubnetwork(SUBNETWORK_ID)).andReturn(operation); replay(compute); initializeSubnetwork(); assertSame(operation, subnetwork.delete()); @@ -128,7 +128,7 @@ public void testDeleteOperation() { public void testDeleteNull() { initializeExpectedSubnetwork(1); expect(compute.options()).andReturn(mockOptions); - expect(compute.delete(SUBNETWORK_ID)).andReturn(null); + expect(compute.deleteSubnetwork(SUBNETWORK_ID)).andReturn(null); replay(compute); initializeSubnetwork(); assertNull(subnetwork.delete()); @@ -139,7 +139,7 @@ public void testExists_True() throws Exception { initializeExpectedSubnetwork(1); Compute.SubnetworkOption[] expectedOptions = {Compute.SubnetworkOption.fields()}; expect(compute.options()).andReturn(mockOptions); - expect(compute.get(SUBNETWORK_ID, expectedOptions)) + expect(compute.getSubnetwork(SUBNETWORK_ID, expectedOptions)) .andReturn(expectedSubnetwork); replay(compute); initializeSubnetwork(); @@ -152,7 +152,7 @@ public void testExists_False() throws Exception { initializeExpectedSubnetwork(1); Compute.SubnetworkOption[] expectedOptions = {Compute.SubnetworkOption.fields()}; expect(compute.options()).andReturn(mockOptions); - expect(compute.get(SUBNETWORK_ID, expectedOptions)).andReturn(null); + expect(compute.getSubnetwork(SUBNETWORK_ID, expectedOptions)).andReturn(null); replay(compute); initializeSubnetwork(); assertFalse(subnetwork.exists()); @@ -163,7 +163,7 @@ public void testExists_False() throws Exception { public void testReload() throws Exception { initializeExpectedSubnetwork(3); expect(compute.options()).andReturn(mockOptions); - expect(compute.get(SUBNETWORK_ID)).andReturn(expectedSubnetwork); + expect(compute.getSubnetwork(SUBNETWORK_ID)).andReturn(expectedSubnetwork); replay(compute); initializeSubnetwork(); Subnetwork updatedSubnetwork = subnetwork.reload(); @@ -175,7 +175,7 @@ public void testReload() throws Exception { public void testReloadNull() throws Exception { initializeExpectedSubnetwork(1); expect(compute.options()).andReturn(mockOptions); - expect(compute.get(SUBNETWORK_ID)).andReturn(null); + expect(compute.getSubnetwork(SUBNETWORK_ID)).andReturn(null); replay(compute); initializeSubnetwork(); assertNull(subnetwork.reload()); @@ -186,7 +186,7 @@ public void testReloadNull() throws Exception { public void testReloadWithOptions() throws Exception { initializeExpectedSubnetwork(3); expect(compute.options()).andReturn(mockOptions); - expect(compute.get(SUBNETWORK_ID, Compute.SubnetworkOption.fields())) + expect(compute.getSubnetwork(SUBNETWORK_ID, Compute.SubnetworkOption.fields())) .andReturn(expectedSubnetwork); replay(compute); initializeSubnetwork(); 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 a46d47d2040d..edd469b8969a 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 @@ -695,7 +695,7 @@ public void testCreateGetAndDeleteRegionAddress() throws InterruptedException { Thread.sleep(1000L); } // test get - Address remoteAddress = compute.get(addressId); + Address remoteAddress = compute.getAddress(addressId); assertNotNull(remoteAddress); assertTrue(remoteAddress.addressId() instanceof RegionAddressId); assertEquals(REGION, remoteAddress.addressId().region()); @@ -705,7 +705,7 @@ public void testCreateGetAndDeleteRegionAddress() throws InterruptedException { assertNotNull(remoteAddress.generatedId()); assertNotNull(remoteAddress.status()); // test get with selected fields - remoteAddress = compute.get(addressId, Compute.AddressOption.fields()); + remoteAddress = compute.getAddress(addressId, Compute.AddressOption.fields()); assertNotNull(remoteAddress); assertTrue(remoteAddress.addressId() instanceof RegionAddressId); assertEquals(REGION, remoteAddress.addressId().region()); @@ -717,7 +717,7 @@ public void testCreateGetAndDeleteRegionAddress() throws InterruptedException { while (!operation.isDone()) { Thread.sleep(1000L); } - assertNull(compute.get(addressId)); + assertNull(compute.getAddress(addressId)); } @Test @@ -772,8 +772,8 @@ public void testListRegionAddresses() throws InterruptedException { count++; } assertEquals(2, count); - compute.delete(firstAddressId); - compute.delete(secondAddressId); + compute.deleteAddress(firstAddressId); + compute.deleteAddress(secondAddressId); } @Test @@ -807,8 +807,8 @@ public void testAggregatedListAddresses() throws InterruptedException { count++; } assertEquals(2, count); - compute.delete(firstAddressId); - compute.delete(secondAddressId); + compute.deleteAddress(firstAddressId); + compute.deleteAddress(secondAddressId); } @Test @@ -821,7 +821,7 @@ public void testCreateGetAndDeleteGlobalAddress() throws InterruptedException { Thread.sleep(1000L); } // test get - Address remoteAddress = compute.get(addressId); + Address remoteAddress = compute.getAddress(addressId); assertNotNull(remoteAddress); assertTrue(remoteAddress.addressId() instanceof GlobalAddressId); assertEquals(addressId.address(), remoteAddress.addressId().address()); @@ -830,7 +830,7 @@ public void testCreateGetAndDeleteGlobalAddress() throws InterruptedException { assertNotNull(remoteAddress.generatedId()); assertNotNull(remoteAddress.status()); // test get with selected fields - remoteAddress = compute.get(addressId, Compute.AddressOption.fields()); + remoteAddress = compute.getAddress(addressId, Compute.AddressOption.fields()); assertNotNull(remoteAddress); assertTrue(remoteAddress.addressId() instanceof GlobalAddressId); assertEquals(addressId.address(), remoteAddress.addressId().address()); @@ -841,7 +841,7 @@ public void testCreateGetAndDeleteGlobalAddress() throws InterruptedException { while (!operation.isDone()) { Thread.sleep(1000L); } - assertNull(compute.get(addressId)); + assertNull(compute.getAddress(addressId)); } @Test @@ -894,8 +894,8 @@ public void testListGlobalAddresses() throws InterruptedException { count++; } assertEquals(2, count); - compute.delete(firstAddressId); - compute.delete(secondAddressId); + compute.deleteAddress(firstAddressId); + compute.deleteAddress(secondAddressId); } @Test @@ -909,7 +909,7 @@ public void testCreateGetResizeAndDeleteStandardDisk() throws InterruptedExcepti Thread.sleep(1000L); } // test get - Disk remoteDisk = compute.get(diskId); + Disk remoteDisk = compute.getDisk(diskId); assertNotNull(remoteDisk); assertEquals(ZONE, remoteDisk.diskId().zone()); assertEquals(diskId.disk(), remoteDisk.diskId().disk()); @@ -927,7 +927,7 @@ public void testCreateGetResizeAndDeleteStandardDisk() throws InterruptedExcepti Thread.sleep(1000L); } // test resize and get with selected fields - remoteDisk = compute.get(diskId, Compute.DiskOption.fields(Compute.DiskField.SIZE_GB)); + remoteDisk = compute.getDisk(diskId, Compute.DiskOption.fields(Compute.DiskField.SIZE_GB)); assertNotNull(remoteDisk); assertEquals(ZONE, remoteDisk.diskId().zone()); assertEquals(diskId.disk(), remoteDisk.diskId().disk()); @@ -944,7 +944,7 @@ public void testCreateGetResizeAndDeleteStandardDisk() throws InterruptedExcepti while (!operation.isDone()) { Thread.sleep(1000L); } - assertNull(compute.get(diskId)); + assertNull(compute.getDisk(diskId)); } @Test @@ -957,7 +957,7 @@ public void testCreateGetAndDeleteImageDisk() throws InterruptedException { Thread.sleep(1000L); } // test get - Disk remoteDisk = compute.get(diskId); + Disk remoteDisk = compute.getDisk(diskId); assertNotNull(remoteDisk); assertEquals(ZONE, remoteDisk.diskId().zone()); assertEquals(diskId.disk(), remoteDisk.diskId().disk()); @@ -974,7 +974,7 @@ public void testCreateGetAndDeleteImageDisk() throws InterruptedException { assertNull(remoteDisk.lastAttachTimestamp()); assertNull(remoteDisk.lastDetachTimestamp()); // test get with selected fields - remoteDisk = compute.get(diskId, Compute.DiskOption.fields()); + remoteDisk = compute.getDisk(diskId, Compute.DiskOption.fields()); assertNotNull(remoteDisk); assertEquals(ZONE, remoteDisk.diskId().zone()); assertEquals(diskId.disk(), remoteDisk.diskId().disk()); @@ -993,7 +993,7 @@ public void testCreateGetAndDeleteImageDisk() throws InterruptedException { while (!operation.isDone()) { Thread.sleep(1000L); } - assertNull(compute.get(diskId)); + assertNull(compute.getDisk(diskId)); } @Test @@ -1009,7 +1009,7 @@ public void testCreateGetAndDeleteSnapshotAndSnapshotDisk() throws InterruptedEx while (!operation.isDone()) { Thread.sleep(1000L); } - Disk remoteDisk = compute.get(diskId); + Disk remoteDisk = compute.getDisk(diskId); operation = remoteDisk.createSnapshot(snapshotName); while (!operation.isDone()) { Thread.sleep(1000L); @@ -1047,7 +1047,7 @@ public void testCreateGetAndDeleteSnapshotAndSnapshotDisk() throws InterruptedEx Thread.sleep(1000L); } // test get disk - remoteDisk = compute.get(snapshotDiskId); + remoteDisk = compute.getDisk(snapshotDiskId); assertNotNull(remoteDisk); assertEquals(ZONE, remoteDisk.diskId().zone()); assertEquals(snapshotDiskId.disk(), remoteDisk.diskId().disk()); @@ -1064,7 +1064,7 @@ public void testCreateGetAndDeleteSnapshotAndSnapshotDisk() throws InterruptedEx assertNull(remoteDisk.lastAttachTimestamp()); assertNull(remoteDisk.lastDetachTimestamp()); // test get disk with selected fields - remoteDisk = compute.get(snapshotDiskId, Compute.DiskOption.fields()); + remoteDisk = compute.getDisk(snapshotDiskId, Compute.DiskOption.fields()); assertNotNull(remoteDisk); assertEquals(ZONE, remoteDisk.diskId().zone()); assertEquals(snapshotDiskId.disk(), remoteDisk.diskId().disk()); @@ -1084,7 +1084,7 @@ public void testCreateGetAndDeleteSnapshotAndSnapshotDisk() throws InterruptedEx while (!operation.isDone()) { Thread.sleep(1000L); } - assertNull(compute.get(snapshotDiskId)); + assertNull(compute.getDisk(snapshotDiskId)); operation = snapshot.delete(); while (!operation.isDone()) { Thread.sleep(1000L); @@ -1205,8 +1205,8 @@ public void testListDisksAndSnapshots() throws InterruptedException { count++; } assertEquals(2, count); - compute.delete(firstDiskId); - compute.delete(secondDiskId); + compute.deleteDisk(firstDiskId); + compute.deleteDisk(secondDiskId); compute.deleteSnapshot(firstSnapshotId); compute.deleteSnapshot(secondSnapshotId); } @@ -1250,8 +1250,8 @@ public void testAggregatedListDisks() throws InterruptedException { count++; } assertEquals(2, count); - compute.delete(firstDiskId); - compute.delete(secondDiskId); + compute.deleteDisk(firstDiskId); + compute.deleteDisk(secondDiskId); } @Test @@ -1266,14 +1266,14 @@ public void testCreateGetAndDeprecateImage() throws InterruptedException { while (!operation.isDone()) { Thread.sleep(1000L); } - Disk remoteDisk = compute.get(diskId); + Disk remoteDisk = compute.getDisk(diskId); ImageInfo imageInfo = ImageInfo.of(imageId, DiskImageConfiguration.of(diskId)); operation = compute.create(imageInfo); while (!operation.isDone()) { Thread.sleep(1000L); } // test get image with selected fields - Image image = compute.get(imageId, + Image image = compute.getImage(imageId, Compute.ImageOption.fields(Compute.ImageField.CREATION_TIMESTAMP)); assertNull(image.generatedId()); assertNotNull(image.imageId()); @@ -1289,7 +1289,7 @@ public void testCreateGetAndDeprecateImage() throws InterruptedException { assertNull(image.licenses()); assertNull(image.deprecationStatus()); // test get image - image = compute.get(imageId); + image = compute.getImage(imageId); assertNotNull(image.generatedId()); assertNotNull(image.imageId()); assertNotNull(image.creationTimestamp()); @@ -1310,14 +1310,14 @@ public void testCreateGetAndDeprecateImage() throws InterruptedException { while (!operation.isDone()) { Thread.sleep(1000L); } - image = compute.get(imageId); + image = compute.getImage(imageId); assertEquals(deprecationStatus, image.deprecationStatus()); remoteDisk.delete(); operation = image.delete(); while (!operation.isDone()) { Thread.sleep(1000L); } - assertNull(compute.get(imageId)); + assertNull(compute.getImage(imageId)); } @Test @@ -1490,7 +1490,7 @@ public void testCreateNetworkAndSubnetwork() throws InterruptedException { Thread.sleep(1000L); } // test get subnetwork with selected fields - Subnetwork subnetwork = compute.get(subnetworkId, + Subnetwork subnetwork = compute.getSubnetwork(subnetworkId, Compute.SubnetworkOption.fields(Compute.SubnetworkField.CREATION_TIMESTAMP)); assertNull(subnetwork.generatedId()); assertEquals(subnetworkId.subnetwork(), subnetwork.subnetworkId().subnetwork()); @@ -1500,7 +1500,7 @@ public void testCreateNetworkAndSubnetwork() throws InterruptedException { assertNull(subnetwork.network()); assertNull(subnetwork.ipRange()); // test get subnetwork - subnetwork = compute.get(subnetworkId); + subnetwork = compute.getSubnetwork(subnetworkId); assertNotNull(subnetwork.generatedId()); assertEquals(subnetworkId.subnetwork(), subnetwork.subnetworkId().subnetwork()); assertNotNull(subnetwork.creationTimestamp()); @@ -1550,7 +1550,7 @@ public void testCreateNetworkAndSubnetwork() throws InterruptedException { while (!operation.isDone()) { Thread.sleep(1000L); } - assertNull(compute.get(subnetworkId)); + assertNull(compute.getSubnetwork(subnetworkId)); assertNull(compute.getNetwork(networkName)); } @@ -1602,8 +1602,8 @@ public void testAggregatedListSubnetworks() throws InterruptedException { count++; } assertEquals(2, count); - firstOperation = compute.delete(firstSubnetworkId); - secondOperation = compute.delete(secondSubnetworkId); + firstOperation = compute.deleteSubnetwork(firstSubnetworkId); + secondOperation = compute.deleteSubnetwork(secondSubnetworkId); while (!firstOperation.isDone()) { Thread.sleep(1000L); } @@ -1628,7 +1628,7 @@ public void testCreateGetAndDeleteInstance() throws InterruptedException { while (!operation.isDone()) { Thread.sleep(1000L); } - Address address = compute.get(addressId); + Address address = compute.getAddress(addressId); // Create an instance InstanceId instanceId = InstanceId.of(ZONE, instanceName); NetworkId networkId = NetworkId.of("default"); @@ -1649,7 +1649,7 @@ public void testCreateGetAndDeleteInstance() throws InterruptedException { Thread.sleep(1000L); } // test get - Instance remoteInstance = compute.get(instanceId); + Instance remoteInstance = compute.getInstance(instanceId); assertEquals(instanceName, remoteInstance.instanceId().instance()); assertEquals(ZONE, remoteInstance.instanceId().zone()); assertEquals(InstanceInfo.Status.RUNNING, remoteInstance.status()); @@ -1682,7 +1682,7 @@ public void testCreateGetAndDeleteInstance() throws InterruptedException { assertNotNull(remoteInstance.metadata()); assertNotNull(remoteInstance.tags()); // test get with selected fields - remoteInstance = compute.get(instanceId, + remoteInstance = compute.getInstance(instanceId, Compute.InstanceOption.fields(Compute.InstanceField.CREATION_TIMESTAMP)); assertEquals(instanceName, remoteInstance.instanceId().instance()); assertEquals(ZONE, remoteInstance.instanceId().zone()); @@ -1702,7 +1702,7 @@ public void testCreateGetAndDeleteInstance() throws InterruptedException { while (!operation.isDone()) { Thread.sleep(1000L); } - assertNull(compute.get(instanceId)); + assertNull(compute.getInstance(instanceId)); address.delete(); } @@ -1723,29 +1723,29 @@ public void testStartStopAndResetInstance() throws InterruptedException { while (!operation.isDone()) { Thread.sleep(1000L); } - Instance remoteInstance = - compute.get(instanceId, Compute.InstanceOption.fields(Compute.InstanceField.STATUS)); + Instance remoteInstance = compute.getInstance(instanceId, + Compute.InstanceOption.fields(Compute.InstanceField.STATUS)); assertEquals(InstanceInfo.Status.RUNNING, remoteInstance.status()); operation = remoteInstance.stop(); while (!operation.isDone()) { Thread.sleep(1000L); } - remoteInstance = - compute.get(instanceId, Compute.InstanceOption.fields(Compute.InstanceField.STATUS)); + remoteInstance = compute.getInstance(instanceId, + Compute.InstanceOption.fields(Compute.InstanceField.STATUS)); assertEquals(InstanceInfo.Status.TERMINATED, remoteInstance.status()); operation = remoteInstance.start(); while (!operation.isDone()) { Thread.sleep(1000L); } - remoteInstance = - compute.get(instanceId, Compute.InstanceOption.fields(Compute.InstanceField.STATUS)); + remoteInstance = compute.getInstance(instanceId, + Compute.InstanceOption.fields(Compute.InstanceField.STATUS)); assertEquals(InstanceInfo.Status.RUNNING, remoteInstance.status()); operation = remoteInstance.reset(); while (!operation.isDone()) { Thread.sleep(1000L); } - remoteInstance = - compute.get(instanceId, Compute.InstanceOption.fields(Compute.InstanceField.STATUS)); + remoteInstance = compute.getInstance(instanceId, + Compute.InstanceOption.fields(Compute.InstanceField.STATUS)); assertEquals(InstanceInfo.Status.RUNNING, remoteInstance.status()); remoteInstance.delete(); } @@ -1767,14 +1767,14 @@ public void testSetInstanceProperties() throws InterruptedException { while (!operation.isDone()) { Thread.sleep(1000L); } - Instance remoteInstance = compute.get(instanceId); + Instance remoteInstance = compute.getInstance(instanceId); // test set tags List tags = ImmutableList.of("tag1", "tag2"); operation = remoteInstance.setTags(tags); while (!operation.isDone()) { Thread.sleep(1000L); } - remoteInstance = compute.get(instanceId); + remoteInstance = compute.getInstance(instanceId); assertEquals(tags, remoteInstance.tags().values()); // test set metadata Map metadata = ImmutableMap.of("key", "value"); @@ -1782,7 +1782,7 @@ public void testSetInstanceProperties() throws InterruptedException { while (!operation.isDone()) { Thread.sleep(1000L); } - remoteInstance = compute.get(instanceId); + remoteInstance = compute.getInstance(instanceId); assertEquals(metadata, remoteInstance.metadata().values()); // test set machine type operation = remoteInstance.stop(); @@ -1793,7 +1793,7 @@ public void testSetInstanceProperties() throws InterruptedException { while (!operation.isDone()) { Thread.sleep(1000L); } - remoteInstance = compute.get(instanceId); + remoteInstance = compute.getInstance(instanceId); assertEquals("n1-standard-1", remoteInstance.machineType().type()); assertEquals(ZONE, remoteInstance.machineType().zone()); // test set scheduling options @@ -1802,7 +1802,7 @@ public void testSetInstanceProperties() throws InterruptedException { while (!operation.isDone()) { Thread.sleep(1000L); } - remoteInstance = compute.get(instanceId); + remoteInstance = compute.getInstance(instanceId); assertEquals(options, remoteInstance.schedulingOptions()); remoteInstance.delete(); } @@ -1831,14 +1831,14 @@ public void testAttachAndDetachDisk() throws InterruptedException { while (!diskOperation.isDone()) { Thread.sleep(1000L); } - Instance remoteInstance = compute.get(instanceId); + Instance remoteInstance = compute.getInstance(instanceId); // test attach disk instanceOperation = remoteInstance.attachDisk("dev1", PersistentDiskConfiguration.builder(diskId).build()); while (!instanceOperation.isDone()) { Thread.sleep(1000L); } - remoteInstance = compute.get(instanceId); + remoteInstance = compute.getInstance(instanceId); Set deviceSet = ImmutableSet.of("dev0", "dev1"); assertEquals(2, remoteInstance.attachedDisks().size()); for (AttachedDisk remoteAttachedDisk : remoteInstance.attachedDisks()) { @@ -1849,7 +1849,8 @@ public void testAttachAndDetachDisk() throws InterruptedException { while (!instanceOperation.isDone()) { Thread.sleep(1000L); } - remoteInstance = compute.get(instanceId); + remoteInstance = compute.getInstance(instanceId); + assertEquals(2, remoteInstance.attachedDisks().size()); for (AttachedDisk remoteAttachedDisk : remoteInstance.attachedDisks()) { assertTrue(deviceSet.contains(remoteAttachedDisk.deviceName())); assertTrue(remoteAttachedDisk.configuration().autoDelete()); @@ -1859,10 +1860,11 @@ public void testAttachAndDetachDisk() throws InterruptedException { while (!instanceOperation.isDone()) { Thread.sleep(1000L); } - remoteInstance = compute.get(instanceId); + remoteInstance = compute.getInstance(instanceId); assertEquals(1, remoteInstance.attachedDisks().size()); assertEquals("dev0", remoteInstance.attachedDisks().get(0).deviceName()); remoteInstance.delete(); + compute.deleteDisk(diskId); } @Test @@ -1892,8 +1894,8 @@ public void testAddAndRemoveAccessConfig() throws InterruptedException { while (!addressOperation.isDone()) { Thread.sleep(1000L); } - Address remoteAddress = compute.get(addressId); - Instance remoteInstance = compute.get(instanceId); + Address remoteAddress = compute.getAddress(addressId); + Instance remoteInstance = compute.getInstance(instanceId); String networkInterfaceName = remoteInstance.networkInterfaces().get(0).name(); // test add access config AccessConfig accessConfig = AccessConfig.builder() @@ -1904,7 +1906,7 @@ public void testAddAndRemoveAccessConfig() throws InterruptedException { while (!instanceOperation.isDone()) { Thread.sleep(1000L); } - remoteInstance = compute.get(instanceId); + remoteInstance = compute.getInstance(instanceId); List accessConfigurations = remoteInstance.networkInterfaces().get(0).accessConfigurations(); assertEquals(1, accessConfigurations.size()); @@ -1914,7 +1916,7 @@ public void testAddAndRemoveAccessConfig() throws InterruptedException { while (!instanceOperation.isDone()) { Thread.sleep(1000L); } - remoteInstance = compute.get(instanceId); + remoteInstance = compute.getInstance(instanceId); assertTrue(remoteInstance.networkInterfaces().get(0).accessConfigurations().isEmpty()); remoteInstance.delete(); remoteAddress.delete();