2222
2323import com .google .auth .oauth2 .GoogleCredentials ;
2424import com .google .auth .oauth2 .ServiceAccountCredentials ;
25+ import com .google .cloud .spanner .IntegrationTestEnv ;
2526import com .google .cloud .spanner .MutableCredentials ;
2627import com .google .cloud .spanner .SerialIntegrationTest ;
2728import com .google .cloud .spanner .Spanner ;
3233import java .io .InputStream ;
3334import java .nio .file .Files ;
3435import java .nio .file .Paths ;
36+ import org .junit .ClassRule ;
3537import org .junit .Test ;
3638import org .junit .experimental .categories .Category ;
3739import 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