Skip to content

Commit cb37715

Browse files
committed
chore: Add comment for fixed test
1 parent 01d0b9e commit cb37715

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/CredentialsServiceTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ GoogleCredentials internalGetApplicationDefault() throws IOException {
5151
// Read application default credentials directly from a specific file instead of actually
5252
// fetching the default from the environment.
5353
return ServiceAccountCredentials.fromStream(
54+
// Calling `getResource().getPath()` on Windows returns a string that might start with
55+
// something like `/C:/...`. Paths.get() interprets the leading / as part of the path
56+
// and would be invalid. Use `new File().toPath()` to read from these files.
5457
Files.newInputStream(new File(SA_APP_DEFAULT_FILE_TEST_PATH).toPath()));
5558
}
5659
};

0 commit comments

Comments
 (0)