@Override
    public boolean acceptsURL(String url) throws SQLException {
        return DriverUri.acceptsURL(url);
    }
@Test
    public void testDriverUri() throws Exception {
        String uri =
                "jdbc:flink://localhost:8888/catalog_name/database_name?sessionId=123&key1=val1&key2=val2";
        assertTrue(DriverUri.acceptsURL(uri));

        Properties properties = new Properties();
        properties.put("key3", "val3");
        properties.put("key4", "val4");
        DriverUri driverUri = DriverUri.create(uri, properties);
        assertEquals("catalog_name", driverUri.getCatalog().get());
        assertEquals("database_name", driverUri.getDatabase().get());
        assertEquals("localhost", driverUri.getAddress().getHostName());
        assertEquals(8888, driverUri.getAddress().getPort());
        assertEquals(5, driverUri.getProperties().size());

        String uriWithoutDBUri =
                "jdbc:flink://localhost:8888/catalog_name?sessionId=123&key1=val1&key2=val2";
        DriverUri driverWithoutDBUri = DriverUri.create(uriWithoutDBUri, properties);
        assertEquals("catalog_name", driverWithoutDBUri.getCatalog().get());
        assertFalse(driverWithoutDBUri.getDatabase().isPresent());
        assertEquals("localhost", driverWithoutDBUri.getAddress().getHostName());
        assertEquals(8888, driverWithoutDBUri.getAddress().getPort());
        assertEquals(5, driverWithoutDBUri.getProperties().size());
    }