@@ -32,9 +32,7 @@ public class JdbcConfigurationTest {
3232 new JdbcConfigurationTestData ("jdbc:clickhouse://localhost" )
3333 .withAdditionalConnectionParameters (
3434 Map .of (JdbcConfiguration .USE_SSL_PROP , "true" ))
35- .withExpectedConnectionURL ("https://localhost:8443" )
36- .withAdditionalExpectedClientProperties (
37- Map .of ("ssl" , "true" )),
35+ .withExpectedConnectionURL ("https://localhost:8443" ), // ssl should not be passed to client
3836 new JdbcConfigurationTestData ("jdbc:clickhouse://[::1]" )
3937 .withExpectedConnectionURL ("http://[::1]:8123" ),
4038 new JdbcConfigurationTestData ("jdbc:clickhouse://[::1]:8123" )
@@ -60,59 +58,59 @@ public class JdbcConfigurationTest {
6058 new JdbcConfigurationTestData ("jdbc:clickhouse://localhost/☺" )
6159 .withAdditionalExpectedClientProperties (
6260 Map .of ("database" , "☺" )),
63- new JdbcConfigurationTestData ("jdbc:clickhouse://localhost/db?key1 =val1&key2 =val2" )
61+ new JdbcConfigurationTestData ("jdbc:clickhouse://localhost/db?custom_key1 =val1&custom_key2 =val2" )
6462 .withAdditionalExpectedClientProperties (
6563 Map .of (
6664 "database" , "db" ,
67- "key1 " , "val1" ,
68- "key2 " , "val2"
65+ "custom_key1 " , "val1" ,
66+ "custom_key2 " , "val2"
6967 )),
70- new JdbcConfigurationTestData ("jdbc:clickhouse://localhost/db?key1 =val%201" )
68+ new JdbcConfigurationTestData ("jdbc:clickhouse://localhost/db?custom_key1 =val%201" )
7169 .withAdditionalExpectedClientProperties (
7270 Map .of (
7371 "database" , "db" ,
74- "key1 " , "val 1"
72+ "custom_key1 " , "val 1"
7573 )),
76- new JdbcConfigurationTestData ("jdbc:clickhouse://localhost/?key1 =val1" )
74+ new JdbcConfigurationTestData ("jdbc:clickhouse://localhost/?custom_key1 =val1" )
7775 .withAdditionalExpectedClientProperties (
7876 Map .of (
79- "key1 " , "val1"
77+ "custom_key1 " , "val1"
8078 )),
81- new JdbcConfigurationTestData ("jdbc:clickhouse://localhost?key1 =val1" )
79+ new JdbcConfigurationTestData ("jdbc:clickhouse://localhost?custom_key1 =val1" )
8280 .withAdditionalExpectedClientProperties (
8381 Map .of (
84- "key1 " , "val1"
82+ "custom_key1 " , "val1"
8583 )),
86- new JdbcConfigurationTestData ("jdbc:clickhouse://localhost:8123?key1 =val1" )
84+ new JdbcConfigurationTestData ("jdbc:clickhouse://localhost:8123?custom_key1 =val1" )
8785 .withExpectedConnectionURL ("http://localhost:8123" )
8886 .withAdditionalExpectedClientProperties (
8987 Map .of (
90- "key1 " , "val1"
88+ "custom_key1 " , "val1"
9189 )),
92- new JdbcConfigurationTestData ("jdbc:clickhouse://localhost:8123/?key1 =val1" )
90+ new JdbcConfigurationTestData ("jdbc:clickhouse://localhost:8123/?custom_key1 =val1" )
9391 .withExpectedConnectionURL ("http://localhost:8123" )
9492 .withAdditionalExpectedClientProperties (
9593 Map .of (
96- "key1 " , "val1"
94+ "custom_key1 " , "val1"
9795 )),
98- new JdbcConfigurationTestData ("jdbc:clickhouse://localhost?key1 =☺" )
96+ new JdbcConfigurationTestData ("jdbc:clickhouse://localhost?custom_key1 =☺" )
9997 .withAdditionalExpectedClientProperties (
10098 Map .of (
101- "key1 " , "☺"
99+ "custom_key1 " , "☺"
102100 )),
103- new JdbcConfigurationTestData ("jdbc:clickhouse://localhost?key1 =val1,val2" )
101+ new JdbcConfigurationTestData ("jdbc:clickhouse://localhost?custom_key1 =val1,val2" )
104102 .withAdditionalExpectedClientProperties (
105103 Map .of (
106- "key1 " , "val1,val2"
104+ "custom_key1 " , "val1,val2"
107105 )),
108106 new JdbcConfigurationTestData (
109- "jdbc:clickhouse://localhost:8443/default?custom_header1 =%22role%201,3,4%22,%27val2%27,val3¶m1=value1 " )
107+ "jdbc:clickhouse://localhost:8443/default?http_header_roles =%22role%201,3,4%22,%27val2%27,val3&ssl=false " )
110108 .withExpectedConnectionURL ("http://localhost:8443" )
111109 .withAdditionalExpectedClientProperties (
112110 Map .of (
113111 "database" , "default" ,
114- "custom_header1 " , "\" role 1,3,4\" ,'val2',val3" ,
115- "param1" , "value1"
112+ "http_header_roles " , "\" role 1,3,4\" ,'val2',val3"
113+ // ssl should not be passed to client
116114 ))
117115 };
118116
@@ -124,7 +122,7 @@ public void testParseURLValid(String jdbcURL, Properties properties,
124122 {
125123 JdbcConfiguration configuration = new JdbcConfiguration (jdbcURL , properties );
126124 assertEquals (configuration .getConnectionUrl (), connectionURL );
127- assertEquals (configuration .clientProperties , expectedClientProps );
125+ assertEquals (configuration .clientProperties , expectedClientProps , "clientProperties" + configuration . clientProperties + " vs " + expectedClientProps );
128126 Client .Builder bob = new Client .Builder ();
129127 configuration .applyClientProperties (bob );
130128 Client client = bob .build ();
0 commit comments