|
|
|
|
@ -22,7 +22,7 @@ import org.awaitility.Awaitility;
@@ -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;
@@ -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 {
@@ -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 |
|
|
|
|
|