Skip to content
This repository was archived by the owner on Apr 7, 2026. It is now read-only.

Commit 22a9ba7

Browse files
committed
try to use hardcoded service account file
1 parent 1751af2 commit 22a9ba7

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/it/ITMutableCredentialsTest.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,18 @@
4141
@Category(SerialIntegrationTest.class)
4242
@RunWith(JUnit4.class)
4343
public class ITMutableCredentialsTest extends ITAbstractSpannerTest {
44+
private static final String VALID_KEY_RESOURCE =
45+
"/com/google/cloud/spanner/connection/test-key-cloud-storage.json";
46+
4447
private static final String INVALID_KEY_RESOURCE =
4548
"/com/google/cloud/spanner/connection/test-key.json";
4649

4750
@Test
4851
public void testMutableCredentialsUpdateAuthorizationForRunningClient() throws IOException {
4952

5053
GoogleCredentials credentialsFromFile;
51-
try (InputStream stream = Files.newInputStream(Paths.get(getKeyFile()))) {
54+
try (InputStream stream =
55+
Files.newInputStream(Paths.get(VALID_KEY_RESOURCE))) {
5256
credentialsFromFile = GoogleCredentials.fromStream(stream);
5357
}
5458
assumeTrue(
@@ -57,8 +61,7 @@ public void testMutableCredentialsUpdateAuthorizationForRunningClient() throws I
5761

5862
ServiceAccountCredentials validCredentials = (ServiceAccountCredentials) credentialsFromFile;
5963
ServiceAccountCredentials invalidCredentials;
60-
try (InputStream stream =
61-
ITMutableCredentialsTest.class.getResourceAsStream(INVALID_KEY_RESOURCE)) {
64+
try (InputStream stream = Files.newInputStream(Paths.get(INVALID_KEY_RESOURCE))) {
6265
assertNotNull("Missing test resource: " + INVALID_KEY_RESOURCE, stream);
6366
invalidCredentials = ServiceAccountCredentials.fromStream(stream);
6467
}

0 commit comments

Comments
 (0)