Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
2 changes: 1 addition & 1 deletion .github/workflows/update_generation_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
# the branch into which the pull request is merged
base_branch: main
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@
import com.google.auth.oauth2.ServiceAccountCredentials;
import com.google.cloud.spanner.ErrorCode;
import com.google.cloud.spanner.SpannerException;
import java.io.FileInputStream;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
Expand All @@ -36,7 +37,7 @@
public class CredentialsServiceTest {
private static final String FILE_TEST_PATH =
CredentialsServiceTest.class.getResource("test-key.json").getFile();
private static final String APP_DEFAULT_FILE_TEST_PATH =
private static final String SA_APP_DEFAULT_FILE_TEST_PATH =
CredentialsServiceTest.class.getResource("test-key-app-default.json").getFile();

private static final String TEST_PROJECT_ID = "test-project";
Expand All @@ -49,7 +50,8 @@ public class CredentialsServiceTest {
GoogleCredentials internalGetApplicationDefault() throws IOException {
// Read application default credentials directly from a specific file instead of actually
// fetching the default from the environment.
return GoogleCredentials.fromStream(new FileInputStream(APP_DEFAULT_FILE_TEST_PATH));
return ServiceAccountCredentials.fromStream(
Files.newInputStream(Paths.get(SA_APP_DEFAULT_FILE_TEST_PATH)));
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
import com.google.common.base.Strings;
import com.google.longrunning.OperationsClient;
import com.google.longrunning.OperationsSettings;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
Expand Down Expand Up @@ -352,9 +351,7 @@ public void deniedListBackupOperations() throws IOException {
.setTransportChannelProvider(InstantiatingGrpcChannelProvider.newBuilder().build())
.setEndpoint("spanner.googleapis.com:443")
.setCredentialsProvider(
FixedCredentialsProvider.create(
GoogleCredentials.fromStream(
new FileInputStream(System.getenv("GOOGLE_APPLICATION_CREDENTIALS")))))
FixedCredentialsProvider.create(GoogleCredentials.getApplicationDefault()))
.build())) {
client.listOperations(backupId.getName() + "/operations", "");
fail("Expected PermissionDeniedException");
Expand Down
Loading