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());
}
Aggregations