Skip to content

Commit

Permalink
Merge pull request #2006 from ClickHouse/v2_fix_the_test
Browse files Browse the repository at this point in the history
[jdbc-v2] Fixed tests
  • Loading branch information
chernser authored Dec 6, 2024
2 parents 5e304cb + 9a652d1 commit 95c580e
Showing 1 changed file with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,15 @@ public void testCleanUrl() {
String cleanUrl = configuration.cleanUrl(url);
assertEquals(cleanUrl, "http://localhost:8123/clickhouse?param1=value1&param2=value2");

// we do not support guessing by port numbers
url = "jdbc:clickhouse://localhost:8443/clickhouse?param1=value1&param2=value2";
cleanUrl = configuration.cleanUrl(url);
assertEquals(cleanUrl, "https://localhost:8443/clickhouse?param1=value1&param2=value2");
assertEquals(cleanUrl, "http://localhost:8443/clickhouse?param1=value1&param2=value2");

Properties info = new Properties();
info.setProperty("ssl", "true");
configuration = new JdbcConfiguration("jdbc:clickhouse://localhost:8123/clickhouse?param1=value1&param2=value2", info);
cleanUrl = configuration.cleanUrl(url);
assertEquals(cleanUrl, "https://localhost:8123/clickhouse?param1=value1&param2=value2");

info.setProperty("ssl", "false");
configuration = new JdbcConfiguration("jdbc:clickhouse://localhost:8443/clickhouse?param1=value1&param2=value2", info);
configuration = new JdbcConfiguration("jdbc:clickhouse:https://localhost:8123/clickhouse?param1=value1&param2=value2", info);
url = "jdbc:clickhouse:https://localhost:8443/clickhouse?param1=value1&param2=value2";
cleanUrl = configuration.cleanUrl(url);
assertEquals(cleanUrl, "http://localhost:8443/clickhouse?param1=value1&param2=value2");
assertEquals(cleanUrl, "https://localhost:8443/clickhouse?param1=value1&param2=value2");
}
}

0 comments on commit 95c580e

Please sign in to comment.