Search in sources :

Example 1 with ShieldedInstanceConfig

use of com.google.cloud.compute.v1.ShieldedInstanceConfig in project java-compute by googleapis.

the class ITSmokeInstancesTest method testPatch.

@Test
public void testPatch() throws ExecutionException, InterruptedException {
    Instance resultInstance = insertInstance();
    Assert.assertFalse(resultInstance.getShieldedInstanceConfig().getEnableSecureBoot());
    instancesClient.stopAsync(DEFAULT_PROJECT, DEFAULT_ZONE, INSTANCE).get();
    ShieldedInstanceConfig shieldedInstanceConfigResource = ShieldedInstanceConfig.newBuilder().setEnableSecureBoot(true).build();
    instancesClient.updateShieldedInstanceConfigAsync(DEFAULT_PROJECT, DEFAULT_ZONE, INSTANCE, shieldedInstanceConfigResource).get();
    Instance updInstance = getInstance();
    Assert.assertTrue(updInstance.getShieldedInstanceConfig().getEnableSecureBoot());
}
Also used : Instance(com.google.cloud.compute.v1.Instance) ShieldedInstanceConfig(com.google.cloud.compute.v1.ShieldedInstanceConfig) Test(org.junit.Test)

Aggregations

Instance (com.google.cloud.compute.v1.Instance)1 ShieldedInstanceConfig (com.google.cloud.compute.v1.ShieldedInstanceConfig)1 Test (org.junit.Test)1