File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 2525import com .google .auth .oauth2 .ServiceAccountCredentials ;
2626import com .google .cloud .spanner .ErrorCode ;
2727import com .google .cloud .spanner .SpannerException ;
28+ import java .io .File ;
2829import java .io .IOException ;
2930import java .nio .file .Files ;
30- import java .nio .file .Paths ;
3131import org .junit .Test ;
3232import org .junit .runner .RunWith ;
3333import org .junit .runners .JUnit4 ;
3636@ RunWith (JUnit4 .class )
3737public 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
You can’t perform that action at this time.
0 commit comments