What problem are you trying to solve?
- replace org.testcontainers.container.KafkaContainer with the new implementation org.testcontainers.kafka.KafkaContainer
- replace the Confluent Kafka Image with the much faster Apache Kafka Native Image
What precondition(s) should be checked before applying this recipe?
Requires Testcontainers 1.20.1
Describe the situation before applying the recipe
import org.testcontainers.containers.KafkaContainer;
@TestContainers
class KafkaTests {
@Container
KafkaContainer kafka = new KafkaContainer(DockerImageName.parse("confluentinc/cp-kafka:7.5.3"));
}
Describe the situation after applying the recipe
import org.testcontainers.kafka.KafkaContainer;
@TestContainers
class KafkaTests {
@Container
KafkaContainer kafka = new KafkaContainer(DockerImageName.parse("apache/kafka-native:3.8.0"));
}
Have you considered any alternatives or workarounds?
No.
Any additional context
Docker image versions don't map 1:1.
Yes!
What problem are you trying to solve?
What precondition(s) should be checked before applying this recipe?
Requires Testcontainers 1.20.1
Describe the situation before applying the recipe
Describe the situation after applying the recipe
Have you considered any alternatives or workarounds?
No.
Any additional context
Docker image versions don't map 1:1.
Are you interested in contributing this recipe to OpenRewrite?
Yes!