Skip to content
Merged
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 @@ -22,6 +22,7 @@

import com.google.auth.oauth2.GoogleCredentials;
import com.google.auth.oauth2.ServiceAccountCredentials;
import com.google.cloud.spanner.IntegrationTestEnv;
import com.google.cloud.spanner.MutableCredentials;
import com.google.cloud.spanner.SerialIntegrationTest;
import com.google.cloud.spanner.Spanner;
Expand All @@ -32,6 +33,7 @@
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Paths;
import org.junit.ClassRule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;
Expand All @@ -44,6 +46,8 @@ public class ITMutableCredentialsTest {
private static final String INVALID_CERT_PATH =
"/com/google/cloud/spanner/connection/test-key.json";

@ClassRule public static final IntegrationTestEnv env = new IntegrationTestEnv();

@Test
public void testMutableCredentialsUpdateAuthorizationForRunningClient() throws IOException {
GoogleCredentials validCredentials = null;
Expand Down Expand Up @@ -75,7 +79,7 @@ public void testMutableCredentialsUpdateAuthorizationForRunningClient() throws I
new MutableCredentials((ServiceAccountCredentials) validCredentials);

SpannerOptions options =
SpannerOptions.newBuilder()
env.getTestHelper().getOptions().toBuilder()
// this setting is required in the scenario SPANNER_EMULATOR_HOST is set otherwise
// SpannerOptions overrides credentials to NoCredentials
.setEmulatorHost(null)
Expand Down
Loading