File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
src/test/java/com/google/cloud/spanner/jdbc/it Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -60,17 +60,24 @@ public class ITJdbcConnectTest extends ITAbstractJdbcTest {
6060 @ ClassRule public static JdbcIntegrationTestEnv env = new JdbcIntegrationTestEnv ();
6161
6262 private Database database ;
63+ private SpannerOptions options ;
6364
6465 @ Before
6566 public void setup () {
6667 database = env .getOrCreateDatabase (Dialect .GOOGLE_STANDARD_SQL , Collections .emptyList ());
68+ options = env .getTestHelper ().getOptions ();
6769 }
6870
6971 private String createBaseUrl () {
7072 StringBuilder url = new StringBuilder ("jdbc:cloudspanner:" );
7173 if (EmulatorSpannerHelper .isUsingEmulator ()) {
7274 url .append ("//" ).append (System .getenv ("SPANNER_EMULATOR_HOST" ));
7375 }
76+ // Extract "//x.y.googleapis.com" from "https://x.y.googleapis.com" and append it to
77+ // url.
78+ if (options .getHost () != null ) {
79+ url .append (options .getHost ().substring (options .getHost ().indexOf (':' ) + 1 ));
80+ }
7481 url .append ("/" ).append (database .getId ().getName ());
7582 if (EmulatorSpannerHelper .isUsingEmulator ()) {
7683 url .append (";usePlainText=true" );
You can’t perform that action at this time.
0 commit comments