From da9bd0c19dd969b30c002626a3e4c3ec825abb14 Mon Sep 17 00:00:00 2001 From: Daniel Broudy Date: Tue, 6 Jan 2015 15:25:41 -0800 Subject: [PATCH] Fixed InstanceApiLiveTest, made Instance.status @Nullable --- .../org/jclouds/googlecomputeengine/domain/Instance.java | 2 +- .../googlecomputeengine/features/InstanceApiLiveTest.java | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Instance.java b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Instance.java index cdc2ee41c8..dcbc3449a1 100644 --- a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Instance.java +++ b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Instance.java @@ -225,7 +225,7 @@ public abstract class Instance { public abstract URI machineType(); - public abstract Status status(); + @Nullable public abstract Status status(); /** Human-readable explanation of the status. */ @Nullable public abstract String statusMessage(); diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/InstanceApiLiveTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/InstanceApiLiveTest.java index 9add978726..191028248b 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/InstanceApiLiveTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/InstanceApiLiveTest.java @@ -126,9 +126,14 @@ public class InstanceApiLiveTest extends BaseGoogleComputeEngineApiLiveTest { @Test(groups = "live", dependsOnMethods = "testInsertInstance") public void testAddAccessConfig() { + Instance instance = api().get(INSTANCE_NAME); + assertNotNull(instance); + assertOperationDoneSuccessfully(api().deleteAccessConfigFromNic(INSTANCE_NAME, + instance.networkInterfaces().get(0).accessConfigs().get(0).name(), "nic0")); + AccessConfig config = AccessConfig.create("test-config", Type.ONE_TO_ONE_NAT, null); assertOperationDoneSuccessfully(api().addAccessConfigToNic(INSTANCE_NAME, config, "nic0")); - Instance instance = api().get(INSTANCE_NAME); + instance = api().get(INSTANCE_NAME); assertNotNull(instance); assertEquals(instance.networkInterfaces().get(0).accessConfigs().get(0).name(), "test-config"); }