Skip to content

Commit

Permalink
Re-enable Kafka ssl sasl tests (#3252)
Browse files Browse the repository at this point in the history
* Revert "Temporarily disable kafka-sasl & kafka-ssl tests due to #3239"

This reverts commit 25a3d41.

* Fix #3239 to override KAFKA_ADVERTISED_LISTENERS env

* sync avro.version
  • Loading branch information
zhfeng committed Nov 2, 2021
1 parent 25a3d41 commit 16f53f2
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
*/
package org.apache.camel.quarkus.kafka.sasl;

import io.quarkus.test.junit.DisabledOnNativeImage;
import io.quarkus.test.junit.NativeImageTest;
import org.junit.jupiter.api.Disabled;

@DisabledOnNativeImage("https://github.com/apache/camel-quarkus/issues/3239")
@Disabled("https://github.com/apache/camel-quarkus/issues/2729")
@NativeImageTest
public class KafkaSaslSslIT extends KafkaSaslSslTest {
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,10 @@
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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,15 @@ public String getBootstrapServers() {
return String.format("SASL_SSL://%s:%s", getHost(), getMappedPort(KAFKA_PORT));
}

@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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,10 @@
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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
}
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ static final class SaslKafkaContainer extends KafkaContainer {
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");
Expand All @@ -102,6 +102,15 @@ public String getBootstrapServers() {
return String.format("SASL_PLAINTEXT://%s:%s", getHost(), getMappedPort(KAFKA_PORT));
}

@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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
*/
package org.apache.camel.quarkus.kafka.ssl;

import io.quarkus.test.junit.DisabledOnNativeImage;
import io.quarkus.test.junit.NativeImageTest;
import org.junit.jupiter.api.Disabled;

@DisabledOnNativeImage("https://github.com/apache/camel-quarkus/issues/3239")
@Disabled("https://github.com/apache/camel-quarkus/issues/2729")
@NativeImageTest
public class KafkaSslIT extends KafkaSslTest {
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,11 @@
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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,15 @@ public String getBootstrapServers() {
return String.format("SSL://%s:%s", getHost(), getMappedPort(KAFKA_PORT));
}

@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);
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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 -->
Expand Down

0 comments on commit 16f53f2

Please sign in to comment.