Documentation

Java Go

Description

Consul is a service mesh and distributed key-value store.

With the increasing popularity of Consul and config externalization, applications are now needing to source properties from Consul. This can prove challenging in the development phase without a running Consul instance readily on hand. This module solves integration testing with Consul. You can also use it to test how your application behaves with Consul by writing different test scenarios.

Examples

Dependency:
<dependency>
    <groupId>org.testcontainers</groupId>
    <artifactId>consul</artifactId>
    <version>1.20.0</version>
    <scope>test</scope>
</dependency>
Usage:
var consul = new ConsulContainer(DockerImageName.parse("hashicorp/consul:1.15"));
consul.start();
Dependency:
go get github.com/testcontainers/testcontainers-go/modules/consul
Usage:
consulContainer, err := consul.Run(ctx, "hashicorp/consul:1.15")