Skip to content

Commit

Permalink
chore: refactor ITKmsTest to avoid using deprecated method (#9854)
Browse files Browse the repository at this point in the history
* chore: refactor ITKmsTest to avoid using deprecated method

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
mpeddada1 and gcf-owl-bot[bot] authored Sep 20, 2023
1 parent c000864 commit caa67be
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions java-kms/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>libraries-bom</artifactId>
<version>26.22.0</version>
<version>26.23.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down Expand Up @@ -195,7 +195,7 @@ Java is a registered trademark of Oracle and/or its affiliates.
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.html
[stability-image]: https://img.shields.io/badge/stability-stable-green
[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-kms.svg
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-kms/2.26.0
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-kms/2.27.0
[authentication]: https://github.com/googleapis/google-cloud-java#authentication
[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes
[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ private static KeyRing getKeyRing(
GetKeyRingRequest.newBuilder().setName(kmsKeyRingResourcePath).build();
requestParamsHeader.put(requestParamsKey, "name=" + kmsKeyRingResourcePath);
KeyManagementServiceGrpc.KeyManagementServiceBlockingStub stubForGetKeyRing =
MetadataUtils.attachHeaders(kmsStub, requestParamsHeader);
kmsStub.withInterceptors(MetadataUtils.newAttachHeadersInterceptor(requestParamsHeader));
return stubForGetKeyRing.getKeyRing(getKeyRingRequest);
} catch (StatusRuntimeException ex) {
if (ex.getStatus().getCode() == Status.Code.NOT_FOUND) {
Expand All @@ -85,7 +85,8 @@ private static KeyRing getKeyRing(
.build();
requestParamsHeader.put(requestParamsKey, "parent=" + keyRingParent);
KeyManagementServiceGrpc.KeyManagementServiceBlockingStub stubForCreateKeyRing =
MetadataUtils.attachHeaders(kmsStub, requestParamsHeader);
kmsStub.withInterceptors(
MetadataUtils.newAttachHeadersInterceptor(requestParamsHeader));
return stubForCreateKeyRing.createKeyRing(createKeyRingRequest);
} else {
throw ex;
Expand Down

0 comments on commit caa67be

Please sign in to comment.