Fixed InstanceApiLiveTest, made Instance.status @Nullable

This commit is contained in:
Daniel Broudy 2015-01-06 15:25:41 -08:00 committed by Ignasi Barrera
parent aa3a8dff8a
commit da9bd0c19d
2 changed files with 7 additions and 2 deletions

View File

@ -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();

View File

@ -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");
}