Skip to content

Commit e3b3a62

Browse files
committed
chore: Resolve issue with Paths.get()
1 parent e024deb commit e3b3a62

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
import com.google.auth.oauth2.ServiceAccountCredentials;
2626
import com.google.cloud.spanner.ErrorCode;
2727
import com.google.cloud.spanner.SpannerException;
28+
import java.io.File;
2829
import java.io.IOException;
2930
import java.nio.file.Files;
30-
import java.nio.file.Paths;
3131
import org.junit.Test;
3232
import org.junit.runner.RunWith;
3333
import org.junit.runners.JUnit4;
@@ -36,9 +36,9 @@
3636
@RunWith(JUnit4.class)
3737
public class CredentialsServiceTest {
3838
private static final String FILE_TEST_PATH =
39-
CredentialsServiceTest.class.getResource("test-key.json").getFile();
39+
CredentialsServiceTest.class.getResource("test-key.json").getPath();
4040
private static final String SA_APP_DEFAULT_FILE_TEST_PATH =
41-
CredentialsServiceTest.class.getResource("test-key-app-default.json").getFile();
41+
CredentialsServiceTest.class.getResource("test-key-app-default.json").getPath();
4242

4343
private static final String TEST_PROJECT_ID = "test-project";
4444
private static final String APP_DEFAULT_PROJECT_ID = "app-default-test-project";
@@ -51,7 +51,7 @@ 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-
Files.newInputStream(Paths.get(SA_APP_DEFAULT_FILE_TEST_PATH)));
54+
Files.newInputStream(new File(SA_APP_DEFAULT_FILE_TEST_PATH).toPath()));
5555
}
5656
};
5757

0 commit comments

Comments
 (0)