2222import com .google .auth .oauth2 .GoogleCredentials ;
2323import com .google .auth .oauth2 .ServiceAccountCredentials ;
2424import com .google .cloud .spanner .*;
25-
25+ import com .google .cloud .spanner .admin .database .v1 .DatabaseAdminClient ;
26+ import com .google .cloud .spanner .connection .ITAbstractSpannerTest ;
27+ import com .google .cloud .spanner .connection .MutableCredentials ;
28+ import com .google .spanner .admin .database .v1 .Database ;
29+ import com .google .spanner .admin .database .v1 .DatabaseName ;
2630import java .io .IOException ;
2731import java .io .InputStream ;
2832import java .nio .file .Files ;
2933import java .nio .file .Paths ;
3034import java .util .ArrayList ;
3135import java .util .List ;
32-
33- import com .google .cloud .spanner .admin .database .v1 .DatabaseAdminClient ;
34- import com .google .cloud .spanner .connection .Connection ;
35- import com .google .cloud .spanner .connection .ConnectionOptions ;
36- import com .google .cloud .spanner .connection .ITAbstractSpannerTest ;
37- import com .google .cloud .spanner .connection .MutableCredentials ;
38- import com .google .spanner .admin .database .v1 .Database ;
39- import com .google .spanner .admin .database .v1 .DatabaseName ;
40- import com .google .spanner .admin .database .v1 .InstanceName ;
4136import org .junit .Test ;
4237import org .junit .experimental .categories .Category ;
4338import org .junit .runner .RunWith ;
@@ -53,7 +48,8 @@ public class ITMutableCredentialsTest extends ITAbstractSpannerTest {
5348 public void testMutableCredentialsUpdateAuthorizationForRunningClient () throws IOException {
5449
5550 GoogleCredentials credentialsFromFile ;
56- try (InputStream stream = Files .newInputStream (Paths .get (GceTestEnvConfig .GCE_CREDENTIALS_FILE ))) {
51+ try (InputStream stream =
52+ Files .newInputStream (Paths .get (GceTestEnvConfig .GCE_CREDENTIALS_FILE ))) {
5753 credentialsFromFile = GoogleCredentials .fromStream (stream );
5854 }
5955 assumeTrue (
@@ -69,14 +65,16 @@ public void testMutableCredentialsUpdateAuthorizationForRunningClient() throws I
6965 List <String > scopes = new ArrayList <>(getTestEnv ().getTestHelper ().getOptions ().getScopes ());
7066 MutableCredentials mutableCredentials = new MutableCredentials (validCredentials , scopes );
7167
72- SpannerOptions options =
73- SpannerOptions .newBuilder ()
74- .setCredentials (mutableCredentials )
75- .build ();
68+ SpannerOptions options = SpannerOptions .newBuilder ().setCredentials (mutableCredentials ).build ();
7669
7770 try (Spanner spanner = options .getService ();
78- DatabaseAdminClient databaseAdminClient = spanner .createDatabaseAdminClient ()) {
79- String dbName = DatabaseName .of (GceTestEnvConfig .GCE_PROJECT_ID , getTestEnv ().getTestHelper ().getInstanceId ().getInstance (), "TEST" ).toString ();
71+ DatabaseAdminClient databaseAdminClient = spanner .createDatabaseAdminClient ()) {
72+ String dbName =
73+ DatabaseName .of (
74+ GceTestEnvConfig .GCE_PROJECT_ID ,
75+ getTestEnv ().getTestHelper ().getInstanceId ().getInstance (),
76+ "TEST" )
77+ .toString ();
8078 Database database = databaseAdminClient .getDatabase (dbName );
8179 assertNotNull (database );
8280 try {
0 commit comments