From 9a652d1735c3602b01d43160f5ef6fc79d441e01 Mon Sep 17 00:00:00 2001 From: Sergey Chernov Date: Fri, 6 Dec 2024 11:28:53 -0800 Subject: [PATCH] fix test --- .../jdbc/internal/JdbcConfigurationTest.java | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/jdbc-v2/src/test/java/com/clickhouse/jdbc/internal/JdbcConfigurationTest.java b/jdbc-v2/src/test/java/com/clickhouse/jdbc/internal/JdbcConfigurationTest.java index 3114a4a32..ec64ae98f 100644 --- a/jdbc-v2/src/test/java/com/clickhouse/jdbc/internal/JdbcConfigurationTest.java +++ b/jdbc-v2/src/test/java/com/clickhouse/jdbc/internal/JdbcConfigurationTest.java @@ -17,19 +17,15 @@ public void testCleanUrl() { String cleanUrl = configuration.cleanUrl(url); assertEquals(cleanUrl, "http://localhost:8123/clickhouse?param1=value1¶m2=value2"); + // we do not support guessing by port numbers url = "jdbc:clickhouse://localhost:8443/clickhouse?param1=value1¶m2=value2"; cleanUrl = configuration.cleanUrl(url); - assertEquals(cleanUrl, "https://localhost:8443/clickhouse?param1=value1¶m2=value2"); + assertEquals(cleanUrl, "http://localhost:8443/clickhouse?param1=value1¶m2=value2"); Properties info = new Properties(); - info.setProperty("ssl", "true"); - configuration = new JdbcConfiguration("jdbc:clickhouse://localhost:8123/clickhouse?param1=value1¶m2=value2", info); - cleanUrl = configuration.cleanUrl(url); - assertEquals(cleanUrl, "https://localhost:8123/clickhouse?param1=value1¶m2=value2"); - - info.setProperty("ssl", "false"); - configuration = new JdbcConfiguration("jdbc:clickhouse://localhost:8443/clickhouse?param1=value1¶m2=value2", info); + configuration = new JdbcConfiguration("jdbc:clickhouse:https://localhost:8123/clickhouse?param1=value1¶m2=value2", info); + url = "jdbc:clickhouse:https://localhost:8443/clickhouse?param1=value1¶m2=value2"; cleanUrl = configuration.cleanUrl(url); - assertEquals(cleanUrl, "http://localhost:8443/clickhouse?param1=value1¶m2=value2"); + assertEquals(cleanUrl, "https://localhost:8443/clickhouse?param1=value1¶m2=value2"); } }