This is an automated email from the ASF dual-hosted git repository. jamesnetherton pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
commit 8d343bd4e2155e90a903cd940a597dee412b9cda Author: Amos Feng <zh.f...@gmail.com> AuthorDate: Tue Nov 2 17:30:33 2021 +0800 Re-enable Kafka ssl sasl tests (#3252) * Revert "Temporarily disable kafka-sasl & kafka-ssl tests due to #3239" This reverts commit 25a3d41b578c610224a0126f52e2176fd05fdf53. * Fix #3239 to override KAFKA_ADVERTISED_LISTENERS env * sync avro.version --- .../org/apache/camel/quarkus/kafka/sasl/KafkaSaslSslTest.java | 2 -- .../camel/quarkus/kafka/sasl/KafkaSaslSslTestResource.java | 9 +++++++++ .../apache/camel/quarkus/kafka/sasl/KafkaSaslBindingTest.java | 2 -- .../java/org/apache/camel/quarkus/kafka/sasl/KafkaSaslIT.java | 2 -- .../camel/quarkus/kafka/sasl/KafkaSaslTestResource.java | 11 ++++++++++- .../java/org/apache/camel/quarkus/kafka/ssl/KafkaSslTest.java | 2 -- .../apache/camel/quarkus/kafka/ssl/KafkaSslTestResource.java | 9 +++++++++ pom.xml | 2 +- 8 files changed, 29 insertions(+), 10 deletions(-) diff --git a/integration-tests/kafka-sasl-ssl/src/test/java/org/apache/camel/quarkus/kafka/sasl/KafkaSaslSslTest.java b/integration-tests/kafka-sasl-ssl/src/test/java/org/apache/camel/quarkus/kafka/sasl/KafkaSaslSslTest.java index 71d482b..947a7ee 100644 --- a/integration-tests/kafka-sasl-ssl/src/test/java/org/apache/camel/quarkus/kafka/sasl/KafkaSaslSslTest.java +++ b/integration-tests/kafka-sasl-ssl/src/test/java/org/apache/camel/quarkus/kafka/sasl/KafkaSaslSslTest.java @@ -22,12 +22,10 @@ import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; import io.restassured.RestAssured; import io.restassured.path.json.JsonPath; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; -@Disabled("https://github.com/apache/camel-quarkus/issues/3239") @QuarkusTest @QuarkusTestResource(KafkaSaslSslTestResource.class) public class KafkaSaslSslTest { diff --git a/integration-tests/kafka-sasl-ssl/src/test/java/org/apache/camel/quarkus/kafka/sasl/KafkaSaslSslTestResource.java b/integration-tests/kafka-sasl-ssl/src/test/java/org/apache/camel/quarkus/kafka/sasl/KafkaSaslSslTestResource.java index a6f55b9..ac807d3 100644 --- a/integration-tests/kafka-sasl-ssl/src/test/java/org/apache/camel/quarkus/kafka/sasl/KafkaSaslSslTestResource.java +++ b/integration-tests/kafka-sasl-ssl/src/test/java/org/apache/camel/quarkus/kafka/sasl/KafkaSaslSslTestResource.java @@ -129,6 +129,15 @@ public class KafkaSaslSslTestResource extends KafkaTestResource { } @Override + protected void configure() { + super.configure(); + + String host = getNetwork() != null ? getNetworkAliases().get(0) : "localhost"; + withEnv("KAFKA_ADVERTISED_LISTENERS", + String.format("SASL_SSL://%s:9093,BROKER://%s:9092", host, host)); + } + + @Override protected void containerIsStarting(InspectContainerResponse containerInfo, boolean reused) { super.containerIsStarting(containerInfo, reused); copyFileToContainer( diff --git a/integration-tests/kafka-sasl/src/test/java/org/apache/camel/quarkus/kafka/sasl/KafkaSaslBindingTest.java b/integration-tests/kafka-sasl/src/test/java/org/apache/camel/quarkus/kafka/sasl/KafkaSaslBindingTest.java index 968749a..c4a246b 100644 --- a/integration-tests/kafka-sasl/src/test/java/org/apache/camel/quarkus/kafka/sasl/KafkaSaslBindingTest.java +++ b/integration-tests/kafka-sasl/src/test/java/org/apache/camel/quarkus/kafka/sasl/KafkaSaslBindingTest.java @@ -22,12 +22,10 @@ import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; import io.restassured.RestAssured; import io.restassured.path.json.JsonPath; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static org.assertj.core.api.AssertionsForClassTypes.assertThat; -@Disabled("https://github.com/apache/camel-quarkus/issues/3239") @QuarkusTest @QuarkusTestResource(KafkaSaslTestResource.class) public class KafkaSaslBindingTest { diff --git a/integration-tests/kafka-sasl/src/test/java/org/apache/camel/quarkus/kafka/sasl/KafkaSaslIT.java b/integration-tests/kafka-sasl/src/test/java/org/apache/camel/quarkus/kafka/sasl/KafkaSaslIT.java index 297a3f4..6b25cb4 100644 --- a/integration-tests/kafka-sasl/src/test/java/org/apache/camel/quarkus/kafka/sasl/KafkaSaslIT.java +++ b/integration-tests/kafka-sasl/src/test/java/org/apache/camel/quarkus/kafka/sasl/KafkaSaslIT.java @@ -16,10 +16,8 @@ */ package org.apache.camel.quarkus.kafka.sasl; -import io.quarkus.test.junit.DisabledOnNativeImage; import io.quarkus.test.junit.NativeImageTest; -@DisabledOnNativeImage("https://github.com/apache/camel-quarkus/issues/3239") @NativeImageTest public class KafkaSaslIT extends KafkaSaslBindingTest { } diff --git a/integration-tests/kafka-sasl/src/test/java/org/apache/camel/quarkus/kafka/sasl/KafkaSaslTestResource.java b/integration-tests/kafka-sasl/src/test/java/org/apache/camel/quarkus/kafka/sasl/KafkaSaslTestResource.java index b42ac32..66c2fe7 100644 --- a/integration-tests/kafka-sasl/src/test/java/org/apache/camel/quarkus/kafka/sasl/KafkaSaslTestResource.java +++ b/integration-tests/kafka-sasl/src/test/java/org/apache/camel/quarkus/kafka/sasl/KafkaSaslTestResource.java @@ -83,7 +83,7 @@ public class KafkaSaslTestResource extends KafkaTestResource { SaslKafkaContainer(final DockerImageName dockerImageName) { super(dockerImageName); - String protocolMap = "SASL_PLAINTEXT:SASL_PLAINTEXT,BROKER:SASL_PLAINTEXT"; + String protocolMap = "SASL_PLAINTEXT:SASL_PLAINTEXT,BROKER:PLAINTEXT"; String listeners = "SASL_PLAINTEXT://0.0.0.0:" + KAFKA_PORT + ",BROKER://0.0.0.0:9092"; withEnv("KAFKA_OPTS", "-Djava.security.auth.login.config=/etc/kafka/kafka_server_jaas.conf"); @@ -103,6 +103,15 @@ public class KafkaSaslTestResource extends KafkaTestResource { } @Override + protected void configure() { + super.configure(); + + String host = getNetwork() != null ? getNetworkAliases().get(0) : "localhost"; + withEnv("KAFKA_ADVERTISED_LISTENERS", + String.format("SASL_PLAINTEXT://%s:9093,BROKER://%s:9092", host, host)); + } + + @Override protected void containerIsStarting(InspectContainerResponse containerInfo, boolean reused) { super.containerIsStarting(containerInfo, reused); copyFileToContainer( diff --git a/integration-tests/kafka-ssl/src/test/java/org/apache/camel/quarkus/kafka/ssl/KafkaSslTest.java b/integration-tests/kafka-ssl/src/test/java/org/apache/camel/quarkus/kafka/ssl/KafkaSslTest.java index f25e8c0..8cc3a89 100644 --- a/integration-tests/kafka-ssl/src/test/java/org/apache/camel/quarkus/kafka/ssl/KafkaSslTest.java +++ b/integration-tests/kafka-ssl/src/test/java/org/apache/camel/quarkus/kafka/ssl/KafkaSslTest.java @@ -22,13 +22,11 @@ import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; import io.restassured.RestAssured; import io.restassured.path.json.JsonPath; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; import static org.hamcrest.Matchers.is; -@Disabled("https://github.com/apache/camel-quarkus/issues/3239") @QuarkusTest @QuarkusTestResource(KafkaSslTestResource.class) public class KafkaSslTest { diff --git a/integration-tests/kafka-ssl/src/test/java/org/apache/camel/quarkus/kafka/ssl/KafkaSslTestResource.java b/integration-tests/kafka-ssl/src/test/java/org/apache/camel/quarkus/kafka/ssl/KafkaSslTestResource.java index ea775dd..ed0e0da 100644 --- a/integration-tests/kafka-ssl/src/test/java/org/apache/camel/quarkus/kafka/ssl/KafkaSslTestResource.java +++ b/integration-tests/kafka-ssl/src/test/java/org/apache/camel/quarkus/kafka/ssl/KafkaSslTestResource.java @@ -122,6 +122,15 @@ public class KafkaSslTestResource extends KafkaTestResource { } @Override + protected void configure() { + super.configure(); + + String host = getNetwork() != null ? getNetworkAliases().get(0) : "localhost"; + withEnv("KAFKA_ADVERTISED_LISTENERS", + String.format("SSL://%s:9093,BROKER://%s:9092", host, host)); + } + + @Override protected void containerIsStarting(InspectContainerResponse containerInfo, boolean reused) { super.containerIsStarting(containerInfo, reused); copyFileToContainer( diff --git a/pom.xml b/pom.xml index 898b4e2..d1b5b62 100644 --- a/pom.xml +++ b/pom.xml @@ -60,7 +60,7 @@ <ahc.version>${ahc-version}</ahc.version> <animal-sniffer.version>1.18</animal-sniffer.version> <antlr3.version>3.5.2</antlr3.version><!-- Spark, Stringtemplate and probably others --> - <avro.version>1.10.2</avro.version><!-- @sync io.quarkus:quarkus-bom:${quarkus.version} dep:org.apache.avro:avro --> + <avro.version>1.11.0</avro.version><!-- @sync io.quarkus:quarkus-bom:${quarkus.version} dep:org.apache.avro:avro --> <aws-java-sdk.version>1.11.714</aws-java-sdk.version> <azure-sdk-bom.version>${azure-sdk-bom-version}</azure-sdk-bom.version> <bouncycastle.version>1.69</bouncycastle.version><!-- @sync io.quarkus:quarkus-bom:${quarkus.version} dep:org.bouncycastle:bcprov-jdk15on -->