From 06127d60b68ea74f517382dc552cf90f00998f08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Nicoll?= Date: Tue, 15 Oct 2024 16:50:57 +0200 Subject: [PATCH] Adapt Kafka SSL smoke test with changes in Testcontainers See gh-42670 --- .../kafka/ssl/SampleKafkaSslApplicationTests.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-kafka/src/dockerTest/java/smoketest/kafka/ssl/SampleKafkaSslApplicationTests.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-kafka/src/dockerTest/java/smoketest/kafka/ssl/SampleKafkaSslApplicationTests.java index 62d093b664..ddd17bfc05 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-kafka/src/dockerTest/java/smoketest/kafka/ssl/SampleKafkaSslApplicationTests.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-kafka/src/dockerTest/java/smoketest/kafka/ssl/SampleKafkaSslApplicationTests.java @@ -22,7 +22,7 @@ import org.awaitility.Awaitility; import org.junit.jupiter.api.Test; import org.testcontainers.junit.jupiter.Container; import org.testcontainers.junit.jupiter.Testcontainers; -import org.testcontainers.kafka.KafkaContainer; +import org.testcontainers.kafka.ConfluentKafkaContainer; import org.testcontainers.utility.MountableFile; import smoketest.kafka.Consumer; import smoketest.kafka.Producer; @@ -55,8 +55,8 @@ import static org.hamcrest.Matchers.not; class SampleKafkaSslApplicationTests { @Container - public static KafkaContainer kafka = TestImage.container(KafkaContainer.class) - .withEnv("KAFKA_LISTENER_SECURITY_PROTOCOL_MAP", "PLAINTEXT:SSL,BROKER:PLAINTEXT") + public static ConfluentKafkaContainer kafka = TestImage.container(ConfluentKafkaContainer.class) + .withEnv("KAFKA_LISTENER_SECURITY_PROTOCOL_MAP", "PLAINTEXT:SSL,BROKER:PLAINTEXT,CONTROLLER:PLAINTEXT") .withEnv("KAFKA_AUTO_CREATE_TOPICS_ENABLE", "true") .withEnv("KAFKA_SSL_CLIENT_AUTH", "required") .withEnv("KAFKA_SSL_KEYSTORE_LOCATION", "/etc/kafka/secrets/certs/test-server.p12") @@ -75,7 +75,7 @@ class SampleKafkaSslApplicationTests { @DynamicPropertySource static void kafkaProperties(DynamicPropertyRegistry registry) { registry.add("spring.kafka.bootstrap-servers", - () -> String.format("%s:%s", kafka.getHost(), kafka.getMappedPort(9093))); + () -> String.format("%s:%s", kafka.getHost(), kafka.getMappedPort(9092))); } @Autowired