@@ -135,13 +135,14 @@ public void testRegister() throws SQLException {
135135
136136 @ Test
137137 public void testConnect () throws SQLException {
138- try (Connection connection =
139- DriverManager .getConnection (
140- String .format (
141- "jdbc:cloudspanner://localhost:%d/projects/some-company.com:test-project/instances/static-test-instance/databases/test-database;usePlainText=true;credentials=%s" ,
142- server .getPort (), TEST_KEY_PATH ))) {
143- assertThat (connection .isClosed ()).isFalse ();
144- }
138+ for (String prefix : new String [] {"cloudspanner" , "spanner" })
139+ try (Connection connection =
140+ DriverManager .getConnection (
141+ String .format (
142+ "jdbc:%s://localhost:%d/projects/some-company.com:test-project/instances/static-test-instance/databases/test-database;usePlainText=true;credentials=%s" ,
143+ prefix , server .getPort (), TEST_KEY_PATH ))) {
144+ assertThat (connection .isClosed ()).isFalse ();
145+ }
145146 }
146147
147148 @ Test (expected = SQLException .class )
@@ -215,6 +216,17 @@ public void testLenient() throws SQLException {
215216 }
216217 }
217218
219+ @ Test
220+ public void testAcceptsURL () throws SQLException {
221+ JdbcDriver driver = JdbcDriver .getRegisteredDriver ();
222+ assertTrue (
223+ driver .acceptsURL (
224+ "jdbc:cloudspanner:/projects/my-project/instances/my-instance/databases/my-database" ));
225+ assertTrue (
226+ driver .acceptsURL (
227+ "jdbc:spanner:/projects/my-project/instances/my-instance/databases/my-database" ));
228+ }
229+
218230 @ Test
219231 public void testJdbcExternalHostFormat () {
220232 Matcher matcherWithoutInstance =
0 commit comments