Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

import com.google.auth.oauth2.GoogleCredentials;
import com.google.auth.oauth2.ServiceAccountCredentials;
import com.google.cloud.spanner.Dialect;
import com.google.cloud.spanner.connection.ConnectionOptions;
import com.google.cloud.spanner.connection.ConnectionOptionsTest;
Expand Down Expand Up @@ -555,8 +555,8 @@ public void testGetVersionColumns() throws SQLException {

@Test
public void testGetUserName() throws SQLException, IOException {
GoogleCredentials credentials =
GoogleCredentials.fromStream(
ServiceAccountCredentials credentials =
ServiceAccountCredentials.fromStream(
Objects.requireNonNull(ConnectionOptionsTest.class.getResource("test-key.json"))
.openStream());
JdbcConnection connection = mock(JdbcConnection.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import com.google.auth.oauth2.AccessToken;
import com.google.auth.oauth2.GoogleCredentials;
import com.google.auth.oauth2.ServiceAccountCredentials;
import com.google.cloud.spanner.Database;
import com.google.cloud.spanner.Dialect;
import com.google.cloud.spanner.ParallelIntegrationTest;
Expand Down Expand Up @@ -230,7 +231,8 @@ public void testConnectWithDataSourceWithConflictingValues() throws SQLException
public void testConnectWithOAuthToken() throws Exception {
GoogleCredentials credentials;
if (hasValidKeyFile()) {
credentials = GoogleCredentials.fromStream(Files.newInputStream(Paths.get(getKeyFile())));
credentials =
ServiceAccountCredentials.fromStream(Files.newInputStream(Paths.get(getKeyFile())));
} else {
try {
credentials = GoogleCredentials.getApplicationDefault();
Expand Down