File tree Expand file tree Collapse file tree 2 files changed +12
-9
lines changed
main/java/com/google/cloud/spanner
test/java/com/google/cloud/spanner Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -741,9 +741,7 @@ public static class Builder
741741 extends ServiceOptions .Builder <Spanner , SpannerOptions , SpannerOptions .Builder > {
742742 static final int DEFAULT_PREFETCH_CHUNKS = 4 ;
743743 static final QueryOptions DEFAULT_QUERY_OPTIONS = QueryOptions .getDefaultInstance ();
744- // TODO: Set the default to DecodeMode.DIRECT before merging to keep the current default.
745- // It is currently set to LAZY_PER_COL so it is used in all tests.
746- static final DecodeMode DEFAULT_DECODE_MODE = DecodeMode .LAZY_PER_COL ;
744+ static final DecodeMode DEFAULT_DECODE_MODE = DecodeMode .DIRECT ;
747745 static final RetrySettings DEFAULT_ADMIN_REQUESTS_LIMIT_EXCEEDED_RETRY_SETTINGS =
748746 RetrySettings .newBuilder ()
749747 .setInitialRetryDelay (Duration .ofSeconds (5L ))
Original file line number Diff line number Diff line change @@ -104,16 +104,21 @@ public static void resetLogging() {
104104
105105 @ Test
106106 public void defaultBuilder () {
107- // We need to set the project id since in test environment we cannot obtain a default project
108- // id.
109- SpannerOptions options = SpannerOptions .newBuilder ().setProjectId ("test-project" ).build ();
107+ // We need to set the project id and credentials since in test environments we cannot guarantee
108+ // that a default project id and credentials are available.
109+ SpannerOptions options =
110+ SpannerOptions .newBuilder ()
111+ .setProjectId ("test-project" )
112+ .setCredentials (NoCredentials .getInstance ())
113+ .build ();
110114 if (Strings .isNullOrEmpty (System .getenv ("SPANNER_EMULATOR_HOST" ))) {
111- assertThat ( options . getHost ()). isEqualTo ( "https://spanner.googleapis.com" );
115+ assertEquals ( "https://spanner.googleapis.com" , options . getHost () );
112116 } else {
113- assertThat ( options . getHost ()). isEqualTo ( "http://" + System .getenv ("SPANNER_EMULATOR_HOST" ));
117+ assertEquals ( "http://" + System .getenv ("SPANNER_EMULATOR_HOST" ), options . getHost ( ));
114118 }
115- assertThat ( options .getPrefetchChunks ()). isEqualTo ( 4 );
119+ assertEquals ( 4 , options .getPrefetchChunks ());
116120 assertNull (options .getSessionLabels ());
121+ assertEquals (DecodeMode .DIRECT , options .getDecodeMode ());
117122 }
118123
119124 @ Test
You can’t perform that action at this time.
0 commit comments