Add service connection from Testcontainers Redpanda

Redpanda (https://redpanda.com/) is Kafka-compatible and
Testcontainers provides a module. This commit adds support for
creating KafkaConnectionDetails from a
@ServiceConnection-annotated RedpandaContainer.

See gh-34780
This commit is contained in:
Eddu Melendez
2023-04-18 12:29:43 +01:00
committed by Andy Wilkinson
parent 341396f33b
commit f4bcf99d30
6 changed files with 192 additions and 1 deletions

View File

@@ -22,6 +22,7 @@ import org.testcontainers.utility.DockerImageName;
* Create {@link DockerImageName} instances for services used in integration tests.
*
* @author Stephane Nicoll
* @author Eddú Meléndez
* @since 2.3.6
*/
public final class DockerImageNames {
@@ -46,6 +47,8 @@ public final class DockerImageNames {
private static final String REDIS_VERSION = "4.0.14";
private static final String REDPANDA_VERSION = "v23.1.2";
private static final String REGISTRY_VERSION = "2.7.1";
private DockerImageNames() {
@@ -131,6 +134,14 @@ public final class DockerImageNames {
return DockerImageName.parse("redis").withTag(REDIS_VERSION);
}
/**
* Return a {@link DockerImageName} suitable for running Redpanda.
* @return a docker image name for running redpanda
*/
public static DockerImageName redpanda() {
return DockerImageName.parse("docker.redpanda.com/redpandadata/redpanda").withTag(REDPANDA_VERSION);
}
/**
* Return a {@link DockerImageName} suitable for running a Docker registry.
* @return a docker image name for running a registry