File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed
google-cloud-spanner/src/test/java/com/google/cloud/spanner/spi/v1 Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -536,16 +536,17 @@ public Map<String, String> getHeaders() {
536536 };
537537 final SpannerOptions options =
538538 createSpannerOptions ().toBuilder ().setHeaderProvider (userAgentHeaderProvider ).build ();
539- final Spanner spanner = options .getService ();
540- final DatabaseClient databaseClient =
541- spanner .getDatabaseClient (DatabaseId .of ("[PROJECT]" , "[INSTANCE]" , "[DATABASE]" ));
539+ try ( Spanner spanner = options .getService ()) {
540+ final DatabaseClient databaseClient =
541+ spanner .getDatabaseClient (DatabaseId .of ("[PROJECT]" , "[INSTANCE]" , "[DATABASE]" ));
542542
543- try (final ResultSet rs = databaseClient .singleUse ().executeQuery (SELECT1AND2 )) {
544- rs .next ();
545- }
543+ try (final ResultSet rs = databaseClient .singleUse ().executeQuery (SELECT1AND2 )) {
544+ rs .next ();
545+ }
546546
547- assertThat (seenHeaders .get (Key .of ("user-agent" , Metadata .ASCII_STRING_MARSHALLER )))
548- .contains ("test-agent " + defaultUserAgent );
547+ assertThat (seenHeaders .get (Key .of ("user-agent" , Metadata .ASCII_STRING_MARSHALLER )))
548+ .contains ("test-agent " + defaultUserAgent );
549+ }
549550 }
550551
551552 @ SuppressWarnings ("rawtypes" )
You can’t perform that action at this time.
0 commit comments