mirror of https://github.com/apache/jclouds.git
Fixed InstanceApiLiveTest, made Instance.status @Nullable
This commit is contained in:
parent
aa3a8dff8a
commit
da9bd0c19d
|
@ -225,7 +225,7 @@ public abstract class Instance {
|
||||||
|
|
||||||
public abstract URI machineType();
|
public abstract URI machineType();
|
||||||
|
|
||||||
public abstract Status status();
|
@Nullable public abstract Status status();
|
||||||
|
|
||||||
/** Human-readable explanation of the status. */
|
/** Human-readable explanation of the status. */
|
||||||
@Nullable public abstract String statusMessage();
|
@Nullable public abstract String statusMessage();
|
||||||
|
|
|
@ -126,9 +126,14 @@ public class InstanceApiLiveTest extends BaseGoogleComputeEngineApiLiveTest {
|
||||||
|
|
||||||
@Test(groups = "live", dependsOnMethods = "testInsertInstance")
|
@Test(groups = "live", dependsOnMethods = "testInsertInstance")
|
||||||
public void testAddAccessConfig() {
|
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);
|
AccessConfig config = AccessConfig.create("test-config", Type.ONE_TO_ONE_NAT, null);
|
||||||
assertOperationDoneSuccessfully(api().addAccessConfigToNic(INSTANCE_NAME, config, "nic0"));
|
assertOperationDoneSuccessfully(api().addAccessConfigToNic(INSTANCE_NAME, config, "nic0"));
|
||||||
Instance instance = api().get(INSTANCE_NAME);
|
instance = api().get(INSTANCE_NAME);
|
||||||
assertNotNull(instance);
|
assertNotNull(instance);
|
||||||
assertEquals(instance.networkInterfaces().get(0).accessConfigs().get(0).name(), "test-config");
|
assertEquals(instance.networkInterfaces().get(0).accessConfigs().get(0).name(), "test-config");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue