From 0bd327ebe0c4287544b2b3cd5af4baed8b2e1882 Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Tue, 14 Oct 2025 10:11:56 -0400 Subject: [PATCH] chore: Update GceTestEnvConfig to use ServiceAccountCredential.fromStream() --- .../test/java/com/google/cloud/spanner/GceTestEnvConfig.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/GceTestEnvConfig.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/GceTestEnvConfig.java index 02666432096..c48c5ec2f42 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/GceTestEnvConfig.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/GceTestEnvConfig.java @@ -21,7 +21,7 @@ import static com.google.common.base.Preconditions.checkState; import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; -import com.google.auth.oauth2.GoogleCredentials; +import com.google.auth.oauth2.ServiceAccountCredentials; import com.google.cloud.spanner.spi.v1.SpannerInterceptorProvider; import io.grpc.CallOptions; import io.grpc.Channel; @@ -80,7 +80,8 @@ public GceTestEnvConfig() { } if (!credentialsFile.isEmpty()) { try { - builder.setCredentials(GoogleCredentials.fromStream(new FileInputStream(credentialsFile))); + builder.setCredentials( + ServiceAccountCredentials.fromStream(new FileInputStream(credentialsFile))); } catch (IOException e) { throw new RuntimeException(e); }