-
Notifications
You must be signed in to change notification settings - Fork 542
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1702 from ClickHouse/fix_ssl_properties
[client-v2] fixed passing properties to old client
- Loading branch information
Showing
4 changed files
with
58 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
client-v2/src/test/java/com/clickhouse/client/ClientTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package com.clickhouse.client; | ||
|
||
import com.clickhouse.client.api.Client; | ||
import com.clickhouse.client.api.enums.Protocol; | ||
import com.clickhouse.client.api.query.GenericRecord; | ||
import org.junit.Assert; | ||
import org.testng.annotations.Test; | ||
|
||
import java.util.Optional; | ||
|
||
public class ClientTests extends BaseIntegrationTest { | ||
|
||
|
||
@Test(enabled = false) | ||
public void testWithSSL() { | ||
|
||
ClickHouseNode secureNode = getSecureServer(ClickHouseProtocol.HTTP); | ||
Client client = new Client.Builder() | ||
.addEndpoint(Protocol.HTTP, "localhost", secureNode.getPort(), true) | ||
.setUsername("default") | ||
.setPassword("") | ||
.build(); | ||
|
||
|
||
Optional<GenericRecord> genericRecord = client | ||
.queryAll("SELECT hostname()").stream().findFirst(); | ||
Assert.assertTrue(genericRecord.isPresent()); | ||
|
||
System.out.println(genericRecord.get().getString(1)); | ||
} | ||
} |