Skip to content

Commit e719d7e

Browse files
committed
adjust auth test for conf strings
1 parent 82da49a commit e719d7e

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

connector/src/test/java/io/questdb/kafka/QuestDBSinkConnectorEmbeddedAuthTest.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public class QuestDBSinkConnectorEmbeddedAuthTest {
4646
private static final GenericContainer<?> tlsProxy = newTlsProxyContainer();
4747

4848
private static GenericContainer<?> newQuestDbConnector() {
49-
FixedHostPortGenericContainer<?> container = new FixedHostPortGenericContainer<>("questdb/questdb:7.3.3");
49+
FixedHostPortGenericContainer<?> container = new FixedHostPortGenericContainer<>("questdb/questdb:9.0.1");
5050
container.addExposedPort(QuestDBUtils.QUESTDB_HTTP_PORT);
5151
container.addExposedPort(QuestDBUtils.QUESTDB_ILP_PORT);
5252
container.setWaitStrategy(new LogMessageWaitStrategy().withRegEx(".*server-main enjoy.*"));
@@ -96,15 +96,15 @@ public void tearDown() {
9696
public void testSmoke(boolean useTls) {
9797
connect.kafka().createTopic(topicName, 1);
9898
Map<String, String> props = ConnectTestUtils.baseConnectorProps(questDBContainer, topicName, false);
99-
props.put(QuestDBSinkConnectorConfig.USERNAME, TEST_USER_NAME);
100-
props.put(QuestDBSinkConnectorConfig.TOKEN, TEST_USER_TOKEN);
101-
99+
String confString;
102100
if (useTls) {
103-
props.put(QuestDBSinkConnectorConfig.TLS, "true");
104-
props.put(QuestDBSinkConnectorConfig.TLS_VALIDATION_MODE_CONFIG, "insecure");
105-
// override the host to point to the TLS proxy
106-
props.put("host", "localhost:" + tlsProxy.getMappedPort(443));
101+
confString = "tcps::addr=localhost:" + tlsProxy.getMappedPort(443) + ";protocol_version=2;tls_verify=unsafe_off;";
102+
} else {
103+
confString = "tcp::addr=" + questDBContainer.getHost() + ":" + questDBContainer.getMappedPort(QuestDBUtils.QUESTDB_ILP_PORT) + ";protocol_version=2;";
107104
}
105+
confString += "username=" + TEST_USER_NAME + ";token=" + TEST_USER_TOKEN + ";";
106+
// override the original confString with the one that has auth info
107+
props.put("client.conf.string", confString);
108108

109109
connect.configureConnector(ConnectTestUtils.CONNECTOR_NAME, props);
110110
ConnectTestUtils.assertConnectorTaskRunningEventually(connect);

0 commit comments

Comments
 (0)