diff --git a/tests/common/src/main/java/tech/ydb/test/integration/docker/YdbDockerContainer.java b/tests/common/src/main/java/tech/ydb/test/integration/docker/YdbDockerContainer.java index 30356487..a1eb88e8 100644 --- a/tests/common/src/main/java/tech/ydb/test/integration/docker/YdbDockerContainer.java +++ b/tests/common/src/main/java/tech/ydb/test/integration/docker/YdbDockerContainer.java @@ -21,10 +21,12 @@ public class YdbDockerContainer extends GenericContainer { public static final int DEFAULT_SECURE_PORT = 2135; public static final int DEFAULT_INSECURE_PORT = 2136; + public static final int DEFAULT_KAFKA_PORT = 9092; private final YdbEnvironment env; private final int grpcsPort; // Secure connection private final int grpcPort; // Non secure connection + private final int kafkaPort; // Non secure kafka port public YdbDockerContainer(YdbEnvironment env, PortsGenerator portGenerator) { super(env.dockerImage()); @@ -33,20 +35,25 @@ public YdbDockerContainer(YdbEnvironment env, PortsGenerator portGenerator) { if (env.useDockerIsolation()) { this.grpcsPort = DEFAULT_SECURE_PORT; this.grpcPort = DEFAULT_INSECURE_PORT; + this.kafkaPort = DEFAULT_KAFKA_PORT; } else { this.grpcsPort = portGenerator.findAvailablePort(); this.grpcPort = portGenerator.findAvailablePort(); + this.kafkaPort = portGenerator.findAvailablePort(); } } public void init() { addExposedPort(grpcPort); addExposedPort(grpcsPort); + addExposedPort(kafkaPort); + withEnv("YDB_KAFKA_PROXY_PORT", String.valueOf(kafkaPort)); if (!env.useDockerIsolation()) { // Host ports and container ports MUST BE equal - ydb implementation limitation addFixedExposedPort(grpcsPort, grpcsPort); addFixedExposedPort(grpcPort, grpcPort); + addFixedExposedPort(kafkaPort, kafkaPort); withEnv("GRPC_PORT", String.valueOf(grpcPort)); withEnv("GRPC_TLS_PORT", String.valueOf(grpcsPort)); @@ -85,6 +92,10 @@ public EndpointRecord secureEndpoint() { return new EndpointRecord(getHost(), getMappedPort(grpcsPort)); } + public String nonSecureKafkaEndpoint() { + return getHost() + ":" + getMappedPort(kafkaPort); + } + public byte[] pemCert() { return copyFileFromContainer(env.dockerPemPath(), is -> { ByteArrayOutputStream baos = new ByteArrayOutputStream();