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 {
60
60
@ ClassRule public static JdbcIntegrationTestEnv env = new JdbcIntegrationTestEnv ();
61
61
62
62
private Database database ;
63
+ private SpannerOptions options ;
63
64
64
65
@ Before
65
66
public void setup () {
66
67
database = env .getOrCreateDatabase (Dialect .GOOGLE_STANDARD_SQL , Collections .emptyList ());
68
+ options = env .getTestHelper ().getOptions ();
67
69
}
68
70
69
71
private String createBaseUrl () {
70
72
StringBuilder url = new StringBuilder ("jdbc:cloudspanner:" );
71
73
if (EmulatorSpannerHelper .isUsingEmulator ()) {
72
74
url .append ("//" ).append (System .getenv ("SPANNER_EMULATOR_HOST" ));
73
75
}
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
+ }
74
81
url .append ("/" ).append (database .getId ().getName ());
75
82
if (EmulatorSpannerHelper .isUsingEmulator ()) {
76
83
url .append (";usePlainText=true" );
You can’t perform that action at this time.
0 commit comments