Skip to content

Commit a5ffb92

Browse files
chore: Fix ITMutableCredentialsTest in cloud-devel (#4383)
1 parent 6290153 commit a5ffb92

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

java-spanner/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITMutableCredentialsTest.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
import com.google.auth.oauth2.GoogleCredentials;
2424
import com.google.auth.oauth2.ServiceAccountCredentials;
25+
import com.google.cloud.spanner.IntegrationTestEnv;
2526
import com.google.cloud.spanner.MutableCredentials;
2627
import com.google.cloud.spanner.SerialIntegrationTest;
2728
import com.google.cloud.spanner.Spanner;
@@ -32,6 +33,7 @@
3233
import java.io.InputStream;
3334
import java.nio.file.Files;
3435
import java.nio.file.Paths;
36+
import org.junit.ClassRule;
3537
import org.junit.Test;
3638
import org.junit.experimental.categories.Category;
3739
import org.junit.runner.RunWith;
@@ -44,6 +46,8 @@ public class ITMutableCredentialsTest {
4446
private static final String INVALID_CERT_PATH =
4547
"/com/google/cloud/spanner/connection/test-key.json";
4648

49+
@ClassRule public static final IntegrationTestEnv env = new IntegrationTestEnv();
50+
4751
@Test
4852
public void testMutableCredentialsUpdateAuthorizationForRunningClient() throws IOException {
4953
GoogleCredentials validCredentials = null;
@@ -75,7 +79,7 @@ public void testMutableCredentialsUpdateAuthorizationForRunningClient() throws I
7579
new MutableCredentials((ServiceAccountCredentials) validCredentials);
7680

7781
SpannerOptions options =
78-
SpannerOptions.newBuilder()
82+
env.getTestHelper().getOptions().toBuilder()
7983
// this setting is required in the scenario SPANNER_EMULATOR_HOST is set otherwise
8084
// SpannerOptions overrides credentials to NoCredentials
8185
.setEmulatorHost(null)

0 commit comments

Comments
 (0)