18
18
19
19
public class JdbcConfigurationTest {
20
20
21
+
21
22
@ Test (dataProvider = "testConnectionUrlDataProvider" )
22
23
public void testConnectionUrl (String jdbcUrl , String connectionUrl , Properties properties , Map <String , String > expectedClientProps ) throws Exception {
23
24
JdbcConfiguration configuration = new JdbcConfiguration (jdbcUrl , properties );
@@ -38,7 +39,7 @@ public static Object[][] testConnectionUrlDataProvider() {
38
39
Map <String , String > useSSLParams = Map .of ("ssl" , "true" );
39
40
Map <String , String > withListParams = Map .of ("database" , "default" , "param1" , "value1" , "custom_header1" , "val1,val2,val3" , "user" , "default" , "password" , "" );
40
41
Map <String , String > withListParamsQuotes = Map .of ("database" , "default" , "param1" , "value1" , "custom_header1" , "\" role 1,3,4\" ,'val2',val3" , "user" , "default" , "password" , "" );
41
-
42
+ Map < String , String > useDatabaseSSLParams = Map . of ( "database" , "clickhouse" , "ssl" , "true" , "user" , "default" , "password" , "" );
42
43
43
44
return new Object [][] {
44
45
{"jdbc:clickhouse://localhost:8123/" , "http://localhost:8123" , defaultProps , defaultParams },
@@ -47,7 +48,7 @@ public static Object[][] testConnectionUrlDataProvider() {
47
48
{"jdbc:clickhouse://localhost:8443/" , "https://localhost:8443" , useSSL , useSSLParams },
48
49
{"jdbc:clickhouse://localhost:8443/default?param1=value1&custom_header1=val1,val2,val3" , "http://localhost:8443" , defaultProps , withListParams },
49
50
{"jdbc:clickhouse://localhost:8443/default?custom_header1=\" role 1,3,4\" ,'val2',val3¶m1=value1" , "http://localhost:8443" , defaultProps , withListParamsQuotes },
50
-
51
+ { "jdbc:clickhouse://localhost:8443/clickhouse?ssl=true" , "https://localhost:8443" , defaultProps , useDatabaseSSLParams },
51
52
};
52
53
}
53
54
0 commit comments