File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
src/test/java/com/google/cloud/spanner/jdbc Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 2323import static org .mockito .Mockito .mock ;
2424import static org .mockito .Mockito .when ;
2525
26- import com .google .auth .oauth2 .GoogleCredentials ;
26+ import com .google .auth .oauth2 .ServiceAccountCredentials ;
2727import com .google .cloud .spanner .Dialect ;
2828import com .google .cloud .spanner .connection .ConnectionOptions ;
2929import com .google .cloud .spanner .connection .ConnectionOptionsTest ;
@@ -555,8 +555,8 @@ public void testGetVersionColumns() throws SQLException {
555555
556556 @ Test
557557 public void testGetUserName () throws SQLException , IOException {
558- GoogleCredentials credentials =
559- GoogleCredentials .fromStream (
558+ ServiceAccountCredentials credentials =
559+ ServiceAccountCredentials .fromStream (
560560 Objects .requireNonNull (ConnectionOptionsTest .class .getResource ("test-key.json" ))
561561 .openStream ());
562562 JdbcConnection connection = mock (JdbcConnection .class );
Original file line number Diff line number Diff line change 2020
2121import com .google .auth .oauth2 .AccessToken ;
2222import com .google .auth .oauth2 .GoogleCredentials ;
23+ import com .google .auth .oauth2 .ServiceAccountCredentials ;
2324import com .google .cloud .spanner .Database ;
2425import com .google .cloud .spanner .Dialect ;
2526import com .google .cloud .spanner .ParallelIntegrationTest ;
@@ -230,7 +231,8 @@ public void testConnectWithDataSourceWithConflictingValues() throws SQLException
230231 public void testConnectWithOAuthToken () throws Exception {
231232 GoogleCredentials credentials ;
232233 if (hasValidKeyFile ()) {
233- credentials = GoogleCredentials .fromStream (Files .newInputStream (Paths .get (getKeyFile ())));
234+ credentials =
235+ ServiceAccountCredentials .fromStream (Files .newInputStream (Paths .get (getKeyFile ())));
234236 } else {
235237 try {
236238 credentials = GoogleCredentials .getApplicationDefault ();
You can’t perform that action at this time.
0 commit comments