@Test
public void prepareDataSourceWithBasicUrl() throws SQLException {

    // Test preparing data source with no catalog
    DataSourceProperties dataSource = new DataSourceProperties("user", "password", "jdbc:postgresql://localhost:5432");
    final JdbcSchemaParser parser = new PostgreSqlSchemaParser();
    DataSourceProperties prepared = parser.prepareDataSource(dataSource, null);
    Assert.assertNotEquals(dataSource, prepared);
    Assert.assertEquals("jdbc:postgresql://localhost:5432/postgres", prepared.getUrl());
    // Test preparing data source with user-defined catalog
    dataSource = new DataSourceProperties("user", "password", "jdbc:postgresql://localhost:5432?flag=true");
    prepared = parser.prepareDataSource(dataSource, "kylo");
    Assert.assertNotEquals(dataSource, prepared);
    Assert.assertEquals("jdbc:postgresql://localhost:5432/kylo?flag=true", prepared.getUrl());
}