File tree 2 files changed +12
-9
lines changed
main/java/com/google/cloud/spanner
test/java/com/google/cloud/spanner
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
741
741
extends ServiceOptions .Builder <Spanner , SpannerOptions , SpannerOptions .Builder > {
742
742
static final int DEFAULT_PREFETCH_CHUNKS = 4 ;
743
743
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 ;
747
745
static final RetrySettings DEFAULT_ADMIN_REQUESTS_LIMIT_EXCEEDED_RETRY_SETTINGS =
748
746
RetrySettings .newBuilder ()
749
747
.setInitialRetryDelay (Duration .ofSeconds (5L ))
Original file line number Diff line number Diff line change @@ -104,16 +104,21 @@ public static void resetLogging() {
104
104
105
105
@ Test
106
106
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 ();
110
114
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 () );
112
116
} else {
113
- assertThat ( options . getHost ()). isEqualTo ( "https://" + System .getenv ("SPANNER_EMULATOR_HOST" ));
117
+ assertEquals ( "https://" + System .getenv ("SPANNER_EMULATOR_HOST" ), options . getHost ( ));
114
118
}
115
- assertThat ( options .getPrefetchChunks ()). isEqualTo ( 4 );
119
+ assertEquals ( 4 , options .getPrefetchChunks ());
116
120
assertNull (options .getSessionLabels ());
121
+ assertEquals (DecodeMode .DIRECT , options .getDecodeMode ());
117
122
}
118
123
119
124
@ Test
You can’t perform that action at this time.
0 commit comments