Skip to content

Commit 06127d6

Browse files
committed
Adapt Kafka SSL smoke test with changes in Testcontainers
See gh-42670
1 parent 29bd974 commit 06127d6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-kafka/src/dockerTest/java/smoketest/kafka/ssl/SampleKafkaSslApplicationTests.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import org.junit.jupiter.api.Test;
2323
import org.testcontainers.junit.jupiter.Container;
2424
import org.testcontainers.junit.jupiter.Testcontainers;
25-
import org.testcontainers.kafka.KafkaContainer;
25+
import org.testcontainers.kafka.ConfluentKafkaContainer;
2626
import org.testcontainers.utility.MountableFile;
2727
import smoketest.kafka.Consumer;
2828
import smoketest.kafka.Producer;
@@ -55,8 +55,8 @@
5555
class SampleKafkaSslApplicationTests {
5656

5757
@Container
58-
public static KafkaContainer kafka = TestImage.container(KafkaContainer.class)
59-
.withEnv("KAFKA_LISTENER_SECURITY_PROTOCOL_MAP", "PLAINTEXT:SSL,BROKER:PLAINTEXT")
58+
public static ConfluentKafkaContainer kafka = TestImage.container(ConfluentKafkaContainer.class)
59+
.withEnv("KAFKA_LISTENER_SECURITY_PROTOCOL_MAP", "PLAINTEXT:SSL,BROKER:PLAINTEXT,CONTROLLER:PLAINTEXT")
6060
.withEnv("KAFKA_AUTO_CREATE_TOPICS_ENABLE", "true")
6161
.withEnv("KAFKA_SSL_CLIENT_AUTH", "required")
6262
.withEnv("KAFKA_SSL_KEYSTORE_LOCATION", "/etc/kafka/secrets/certs/test-server.p12")
@@ -75,7 +75,7 @@ class SampleKafkaSslApplicationTests {
7575
@DynamicPropertySource
7676
static void kafkaProperties(DynamicPropertyRegistry registry) {
7777
registry.add("spring.kafka.bootstrap-servers",
78-
() -> String.format("%s:%s", kafka.getHost(), kafka.getMappedPort(9093)));
78+
() -> String.format("%s:%s", kafka.getHost(), kafka.getMappedPort(9092)));
7979
}
8080

8181
@Autowired

0 commit comments

Comments
 (0)