Skip to content

Commit

Permalink
Adapt Kafka SSL smoke test with changes in Testcontainers
Browse files Browse the repository at this point in the history
  • Loading branch information
snicoll committed Oct 15, 2024
1 parent 29bd974 commit 06127d6
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
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;
Expand Down Expand Up @@ -55,8 +55,8 @@
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")
Expand All @@ -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
Expand Down

0 comments on commit 06127d6

Please sign in to comment.