use of com.google.cloud.storage.HmacKey in project google-cloud-java by GoogleCloudPlatform.
the class ITStorageHmacKeySnippets method testActivateHmacKey.
@Test
public void testActivateHmacKey() {
HmacKey hmacKey = storage.createHmacKey(ServiceAccount.of(HMAC_KEY_TEST_SERVICE_ACCOUNT));
HmacKeyMetadata metadata = storage.updateHmacKeyState(hmacKey.getMetadata(), HmacKeyState.INACTIVE);
HmacKeyMetadata newMetadata = storageSnippets.activateHmacKey(metadata.getAccessId(), PROJECT_ID);
assertEquals(HmacKeyState.ACTIVE, newMetadata.getState());
}
Aggregations