This repository was archived by the owner on Apr 7, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
main/java/com/google/cloud/spanner/connection
test/java/com/google/cloud/spanner/connection Expand file tree Collapse file tree Original file line number Diff line number Diff line change 7777import com .google .cloud .spanner .SpannerOptions ;
7878import com .google .cloud .spanner .connection .StatementExecutor .StatementExecutorType ;
7979import com .google .common .annotations .VisibleForTesting ;
80+ import com .google .common .base .MoreObjects ;
8081import com .google .common .base .Preconditions ;
8182import com .google .common .base .Strings ;
8283import com .google .common .base .Suppliers ;
@@ -970,7 +971,7 @@ public TransportChannelProvider getChannelProvider() {
970971 return null ;
971972 }
972973 try {
973- URL url = new URL (host );
974+ URL url = new URL (MoreObjects . firstNonNull ( host , DEFAULT_HOST ) );
974975 ExternalChannelProvider provider =
975976 ExternalChannelProvider .class .cast (Class .forName (channelProvider ).newInstance ());
976977 return provider .getChannelProvider (url .getHost (), url .getPort ());
Original file line number Diff line number Diff line change 6060public class ConnectionOptionsTest {
6161 private static final String FILE_TEST_PATH =
6262 Objects .requireNonNull (ConnectionOptionsTest .class .getResource ("test-key.json" )).getFile ();
63- private static final String DEFAULT_HOST = "https://spanner.googleapis.com" ;
63+ private static final String DEFAULT_HOST = null ;
6464 private static final String TEST_PROJECT = "test-project-123" ;
6565 private static final String TEST_INSTANCE = "test-instance-123" ;
6666 private static final String TEST_DATABASE = "test-database-123" ;
You can’t perform that action at this time.
0 commit comments