diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
index 3a7ea347cb3..9131ce06da3 100644
--- a/.devcontainer/devcontainer.json
+++ b/.devcontainer/devcontainer.json
@@ -1,23 +1,13 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.241.1/containers/java-8
{
- "name": "Java 8",
- "image": "mcr.microsoft.com/devcontainers/java:1-8-bullseye",
+ "name": "Java 17",
+ "image": "mcr.microsoft.com/devcontainers/java:0-17",
// Configure tool-specific properties.
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
- // Set *default* container specific settings.json values on container create.
- "settings": {
- "java.import.gradle.java.home": "/usr/local/sdkman/candidates/java/current",
- "java.configuration.runtimes": [{
- "default": true,
- "name": "JavaSE-1.8",
- "path": "/usr/local/sdkman/candidates/java/current"
- }]
- },
-
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"vscjava.vscode-java-pack"
diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml
index 81e3dbbd900..c31dd05e048 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.yaml
+++ b/.github/ISSUE_TEMPLATE/bug_report.yaml
@@ -17,21 +17,27 @@ body:
- ActiveMQ
- Azure
- Cassandra
+ - ChromaDB
- Clickhouse
- CockroachDB
- Consul
- Couchbase
- CrateDB
+ - Databend
- DB2
- Dynalite
- Elasticsearch
- GCloud
+ - Grafana
- HiveMQ
- InfluxDB
- K3S
+ - K6
- Kafka
+ - LDAP
- LocalStack
- MariaDB
+ - Milvus
- MinIO
- MockServer
- MongoDB
@@ -39,22 +45,31 @@ body:
- MySQL
- Neo4j
- NGINX
+ - OceanBase
+ - Ollama
+ - OpenFGA
- Oracle Free
- Oracle XE
- OrientDB
+ - Pinecone
- PostgreSQL
- Presto
- Pulsar
+ - Qdrant
- QuestDB
- RabbitMQ
- Redpanda
+ - ScyllaDB
- Selenium
- Solace
- Solr
- TiDB
+ - Timeplus
- ToxiProxy
- Trino
+ - Typesense
- Vault
+ - Weaviate
- YugabyteDB
validations:
required: true
diff --git a/.github/ISSUE_TEMPLATE/enhancement.yaml b/.github/ISSUE_TEMPLATE/enhancement.yaml
index d073f8f1674..9b9a06ecf6a 100644
--- a/.github/ISSUE_TEMPLATE/enhancement.yaml
+++ b/.github/ISSUE_TEMPLATE/enhancement.yaml
@@ -17,21 +17,27 @@ body:
- ActiveMQ
- Azure
- Cassandra
+ - ChromaDB
- Clickhouse
- CockroachDB
- Consul
- Couchbase
- CrateDB
+ - Databend
- DB2
- Dynalite
- Elasticsearch
- GCloud
+ - Grafana
- HiveMQ
- InfluxDB
- K3S
+ - K6
- Kafka
+ - LDAP
- LocalStack
- MariaDB
+ - Milvus
- MinIO
- MockServer
- MongoDB
@@ -39,22 +45,31 @@ body:
- MySQL
- Neo4j
- NGINX
+ - OceanBase
+ - Ollama
+ - OpenFGA
- Oracle Free
- Oracle XE
- OrientDB
+ - Pinecone
- PostgreSQL
- Presto
- Pulsar
+ - Qdrant
- QuestDB
- RabbitMQ
- Redpanda
+ - ScyllaDB
- Selenium
- Solace
- Solr
- TiDB
+ - Timeplus
- ToxiProxy
- Trino
+ - Typesense
- Vault
+ - Weaviate
- YugabyteDB
validations:
required: true
diff --git a/.github/ISSUE_TEMPLATE/feature.yaml b/.github/ISSUE_TEMPLATE/feature.yaml
index dedccecd4e5..b655b4ac505 100644
--- a/.github/ISSUE_TEMPLATE/feature.yaml
+++ b/.github/ISSUE_TEMPLATE/feature.yaml
@@ -17,21 +17,27 @@ body:
- ActiveMQ
- Azure
- Cassandra
+ - ChromaDB
- Clickhouse
- CockroachDB
- CrateDB
- Consul
- Couchbase
+ - Databend
- DB2
- Dynalite
- Elasticsearch
- GCloud
+ - Grafana
- HiveMQ
- InfluxDB
- K3S
+ - K6
- Kafka
+ - LDAP
- LocalStack
- MariaDB
+ - Milvus
- MinIO
- MockServer
- MongoDB
@@ -39,22 +45,31 @@ body:
- MySQL
- Neo4j
- NGINX
+ - OceanBase
+ - Ollama
+ - OpenFGA
- Oracle Free
- Oracle XE
- OrientDB
+ - Pinecone
- PostgreSQL
+ - Qdrant
- QuestDB
- Presto
- Pulsar
- RabbitMQ
- Redpanda
+ - ScyllaDB
- Selenium
- Solace
- Solr
- TiDB
+ - Timeplus
- ToxiProxy
- Trino
+ - Typesense
- Vault
+ - Weaviate
- YugabyteDB
- New Module
- type: textarea
@@ -75,7 +90,7 @@ body:
id: benefit
attributes:
label: Benefit
- description: What's the benefit of addng this feature to the project?
+ description: What's the benefit of adding this feature to the project?
validations:
required: true
- type: textarea
diff --git a/.github/actions/setup-build/action.yml b/.github/actions/setup-build/action.yml
index 23204529408..0ab491cbb20 100644
--- a/.github/actions/setup-build/action.yml
+++ b/.github/actions/setup-build/action.yml
@@ -1,9 +1,16 @@
name: Set up Build
description: Sets up Build
+inputs:
+ java-version:
+ description: 'The Java version to set up'
+ required: true
+ default: '17'
runs:
using: "composite"
steps:
- uses: ./.github/actions/setup-java
+ with:
+ java-version: ${{ inputs.java-version }}
- name: Clear existing docker image cache
shell: bash
run: docker image prune -af
diff --git a/.github/actions/setup-gradle/action.yml b/.github/actions/setup-gradle/action.yml
index 58499f75e57..76d1b0ff4b2 100644
--- a/.github/actions/setup-gradle/action.yml
+++ b/.github/actions/setup-gradle/action.yml
@@ -4,10 +4,9 @@ runs:
using: "composite"
steps:
- name: Setup Gradle Build Action
- uses: gradle/gradle-build-action@v2
+ uses: gradle/actions/setup-gradle@v6
with:
gradle-home-cache-includes: |
caches
notifications
jdks
- gradle-home-cache-cleanup: true
diff --git a/.github/actions/setup-java/action.yml b/.github/actions/setup-java/action.yml
index 8d9733f02ba..093fbc2e7fd 100644
--- a/.github/actions/setup-java/action.yml
+++ b/.github/actions/setup-java/action.yml
@@ -1,9 +1,14 @@
name: Set up Java
description: Sets up Java version
+inputs:
+ java-version:
+ description: 'The Java version to set up'
+ required: true
+ default: '17'
runs:
using: "composite"
steps:
- - uses: actions/setup-java@v3
+ - uses: actions/setup-java@v5
with:
- java-version: '8'
+ java-version: ${{ inputs.java-version }}
distribution: temurin
diff --git a/.github/actions/setup-junit-report/action.yml b/.github/actions/setup-junit-report/action.yml
index 86092d06bcc..df0af39297f 100644
--- a/.github/actions/setup-junit-report/action.yml
+++ b/.github/actions/setup-junit-report/action.yml
@@ -4,7 +4,7 @@ runs:
using: "composite"
steps:
- name: Publish Test Report
- uses: mikepenz/action-junit-report@v3
+ uses: mikepenz/action-junit-report@v6
if: always() # always run even if the previous step fails
with:
report_paths: '**/build/test-results/test/TEST-*.xml'
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
index e3506109406..789ec351da2 100644
--- a/.github/dependabot.yml
+++ b/.github/dependabot.yml
@@ -16,10 +16,14 @@ updates:
update-types: [ "version-update:semver-major" ]
- dependency-name: "org.mockito:mockito-core"
update-types: [ "version-update:semver-major" ]
- - dependency-name: "org.yaml:snakeyaml"
- update-types: [ "version-update:semver-major" ]
- dependency-name: "com.fasterxml.jackson.datatype:jackson-datatype-jsr310"
update-types: [ "version-update:semver-minor", "version-update:semver-patch" ]
+ - dependency-name: "org.junit.jupiter:junit-jupiter"
+ update-types: [ "version-update:semver-major" ]
+ - dependency-name: "org.junit.platform:junit-platform-launcher"
+ update-types: [ "version-update:semver-major" ]
+ - dependency-name: "io.rest-assured:rest-assured"
+ update-types: [ "version-update:semver-major" ]
- package-ecosystem: "gradle"
directory: "/"
allow:
@@ -29,6 +33,13 @@ updates:
schedule:
interval: "weekly"
open-pull-requests-limit: 10
+ ignore:
+ - dependency-name: "com.gradleup.shadow"
+ update-types: [ "version-update:semver-major" ]
+ - dependency-name: "org.junit.jupiter:junit-jupiter"
+ update-types: [ "version-update:semver-major" ]
+ - dependency-name: "org.junit.platform:junit-platform-launcher"
+ update-types: [ "version-update:semver-major" ]
# Explicit entry for each module
- package-ecosystem: "gradle"
@@ -39,80 +50,106 @@ updates:
- package-ecosystem: "gradle"
directory: "/modules/azure"
schedule:
- interval: "weekly"
+ interval: "monthly"
open-pull-requests-limit: 10
- package-ecosystem: "gradle"
directory: "/modules/cassandra"
schedule:
- interval: "weekly"
+ interval: "monthly"
open-pull-requests-limit: 10
ignore:
- dependency-name: "io.dropwizard.metrics:metrics-core"
update-types: [ "version-update:semver-major" ]
+ - package-ecosystem: "gradle"
+ directory: "/modules/chromadb"
+ schedule:
+ interval: "monthly"
+ open-pull-requests-limit: 10
+ ignore:
+ - dependency-name: "io.rest-assured:rest-assured"
+ update-types: [ "version-update:semver-major" ]
- package-ecosystem: "gradle"
directory: "/modules/clickhouse"
schedule:
- interval: "weekly"
+ interval: "monthly"
open-pull-requests-limit: 10
- package-ecosystem: "gradle"
directory: "/modules/cockroachdb"
schedule:
- interval: "weekly"
+ interval: "monthly"
open-pull-requests-limit: 10
- package-ecosystem: "gradle"
directory: "/modules/consul"
schedule:
- interval: "weekly"
+ interval: "monthly"
open-pull-requests-limit: 10
+ ignore:
+ - dependency-name: "io.rest-assured:rest-assured"
+ update-types: [ "version-update:semver-major" ]
- package-ecosystem: "gradle"
directory: "/modules/couchbase"
schedule:
- interval: "weekly"
+ interval: "monthly"
open-pull-requests-limit: 10
- package-ecosystem: "gradle"
directory: "/modules/cratedb"
schedule:
- interval: "weekly"
+ interval: "monthly"
open-pull-requests-limit: 10
- package-ecosystem: "gradle"
directory: "/modules/database-commons"
schedule:
- interval: "weekly"
+ interval: "monthly"
+ - package-ecosystem: "gradle"
+ directory: "/modules/databend"
+ schedule:
+ interval: "monthly"
open-pull-requests-limit: 10
- package-ecosystem: "gradle"
directory: "/modules/db2"
schedule:
- interval: "weekly"
+ interval: "monthly"
open-pull-requests-limit: 10
- package-ecosystem: "gradle"
directory: "/modules/dynalite"
schedule:
- interval: "weekly"
+ interval: "monthly"
open-pull-requests-limit: 10
- package-ecosystem: "gradle"
directory: "/modules/elasticsearch"
schedule:
- interval: "weekly"
+ interval: "monthly"
open-pull-requests-limit: 10
- package-ecosystem: "gradle"
directory: "/modules/gcloud"
schedule:
- interval: "weekly"
+ interval: "monthly"
open-pull-requests-limit: 10
+ - package-ecosystem: "gradle"
+ directory: "/modules/grafana"
+ schedule:
+ interval: "monthly"
+ open-pull-requests-limit: 10
+ ignore:
+ - dependency-name: "io.rest-assured:rest-assured"
+ update-types: [ "version-update:semver-major" ]
- package-ecosystem: "gradle"
directory: "/modules/hivemq"
schedule:
- interval: "weekly"
+ interval: "monthly"
open-pull-requests-limit: 10
- package-ecosystem: "gradle"
directory: "/modules/influxdb"
schedule:
- interval: "weekly"
+ interval: "monthly"
open-pull-requests-limit: 10
+ ignore:
+ - dependency-name: "com.influxdb:influxdb-java-client"
+ update-types: [ "version-update:semver-major" ]
- package-ecosystem: "gradle"
directory: "/modules/jdbc"
schedule:
- interval: "weekly"
+ interval: "monthly"
open-pull-requests-limit: 10
ignore:
- dependency-name: "org.mockito:mockito-core"
@@ -120,74 +157,96 @@ updates:
- package-ecosystem: "gradle"
directory: "/modules/jdbc-test"
schedule:
- interval: "weekly"
+ interval: "monthly"
open-pull-requests-limit: 10
ignore:
- dependency-name: "org.apache.tomcat:tomcat-jdbc"
update-types: [ "version-update:semver-minor" ]
+ - dependency-name: "org.junit.jupiter:junit-jupiter"
+ update-types: [ "version-update:semver-major" ]
- package-ecosystem: "gradle"
directory: "/modules/junit-jupiter"
schedule:
- interval: "weekly"
+ interval: "monthly"
open-pull-requests-limit: 10
ignore:
- dependency-name: "org.mockito:mockito-core"
update-types: [ "version-update:semver-major" ]
+ - dependency-name: "org.junit:junit-bom"
+ update-types: [ "version-update:semver-major" ]
- package-ecosystem: "gradle"
directory: "/modules/k3s"
schedule:
- interval: "weekly"
+ interval: "monthly"
open-pull-requests-limit: 10
ignore:
- dependency-name: "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml"
update-types: [ "version-update:semver-minor", "version-update:semver-patch" ]
+ - package-ecosystem: "gradle"
+ directory: "/modules/k6"
+ schedule:
+ interval: "monthly"
+ open-pull-requests-limit: 10
- package-ecosystem: "gradle"
directory: "/modules/kafka"
schedule:
- interval: "weekly"
+ interval: "monthly"
+ open-pull-requests-limit: 10
+ - package-ecosystem: "gradle"
+ directory: "/modules/ldap"
+ schedule:
+ interval: "monthly"
open-pull-requests-limit: 10
- package-ecosystem: "gradle"
directory: "/modules/localstack"
schedule:
- interval: "weekly"
+ interval: "monthly"
open-pull-requests-limit: 10
- package-ecosystem: "gradle"
directory: "/modules/mariadb"
schedule:
- interval: "weekly"
+ interval: "monthly"
open-pull-requests-limit: 10
ignore:
- dependency-name: "org.mariadb:r2dbc-mariadb"
update-types: [ "version-update:semver-minor" ]
+ - package-ecosystem: "gradle"
+ directory: "/modules/milvus"
+ schedule:
+ interval: "monthly"
+ open-pull-requests-limit: 10
- package-ecosystem: "gradle"
directory: "/modules/minio"
schedule:
- interval: "weekly"
+ interval: "monthly"
open-pull-requests-limit: 10
- package-ecosystem: "gradle"
directory: "/modules/mockserver"
schedule:
- interval: "weekly"
+ interval: "monthly"
open-pull-requests-limit: 10
+ ignore:
+ - dependency-name: "io.rest-assured:rest-assured"
+ update-types: [ "version-update:semver-major" ]
- package-ecosystem: "gradle"
directory: "/modules/mongodb"
schedule:
- interval: "weekly"
+ interval: "monthly"
open-pull-requests-limit: 10
- package-ecosystem: "gradle"
directory: "/modules/mssqlserver"
schedule:
- interval: "weekly"
+ interval: "monthly"
open-pull-requests-limit: 10
- package-ecosystem: "gradle"
directory: "/modules/mysql"
schedule:
- interval: "weekly"
+ interval: "monthly"
open-pull-requests-limit: 10
- package-ecosystem: "gradle"
directory: "/modules/neo4j"
schedule:
- interval: "weekly"
+ interval: "monthly"
open-pull-requests-limit: 10
ignore:
- dependency-name: "org.neo4j.driver:neo4j-java-driver"
@@ -197,64 +256,107 @@ updates:
- package-ecosystem: "gradle"
directory: "/modules/nginx"
schedule:
- interval: "weekly"
+ interval: "monthly"
+ open-pull-requests-limit: 10
+ - package-ecosystem: "gradle"
+ directory: "/modules/oceanbase"
+ schedule:
+ interval: "monthly"
open-pull-requests-limit: 10
+ - package-ecosystem: "gradle"
+ directory: "/modules/ollama"
+ schedule:
+ interval: "monthly"
+ open-pull-requests-limit: 10
+ ignore:
+ - dependency-name: "io.rest-assured:rest-assured"
+ update-types: [ "version-update:semver-major" ]
+ - package-ecosystem: "gradle"
+ directory: "/modules/openfga"
+ schedule:
+ interval: "monthly"
- package-ecosystem: "gradle"
directory: "/modules/oracle-free"
schedule:
- interval: "weekly"
+ interval: "monthly"
- package-ecosystem: "gradle"
directory: "/modules/oracle-xe"
schedule:
- interval: "weekly"
+ interval: "monthly"
open-pull-requests-limit: 10
- package-ecosystem: "gradle"
directory: "/modules/orientdb"
schedule:
- interval: "weekly"
+ interval: "monthly"
open-pull-requests-limit: 10
- package-ecosystem: "gradle"
directory: "/modules/postgresql"
schedule:
- interval: "weekly"
+ interval: "monthly"
open-pull-requests-limit: 10
- package-ecosystem: "gradle"
directory: "/modules/presto"
schedule:
- interval: "weekly"
+ interval: "monthly"
open-pull-requests-limit: 10
+ - package-ecosystem: "gradle"
+ directory: "/modules/pinecone"
+ schedule:
+ interval: "monthly"
+ open-pull-requests-limit: 10
+ ignore:
+ - dependency-name: "io.pinecone:pinecone-client"
+ update-types: [ "version-update:semver-major" ]
- package-ecosystem: "gradle"
directory: "/modules/pulsar"
schedule:
- interval: "weekly"
+ interval: "monthly"
+ open-pull-requests-limit: 10
+ ignore:
+ - dependency-name: "org.apache.pulsar:pulsar-bom"
+ update-types: [ "version-update:semver-patch" ]
+ - package-ecosystem: "gradle"
+ directory: "/modules/qdrant"
+ schedule:
+ interval: "monthly"
open-pull-requests-limit: 10
- package-ecosystem: "gradle"
directory: "/modules/questdb"
schedule:
- interval: "weekly"
+ interval: "monthly"
open-pull-requests-limit: 10
- package-ecosystem: "gradle"
directory: "/modules/r2dbc"
schedule:
- interval: "weekly"
+ interval: "monthly"
open-pull-requests-limit: 10
ignore:
- dependency-name: "io.r2dbc:r2dbc-spi"
update-types: [ "version-update:semver-major", "version-update:semver-minor" ]
+ - dependency-name: "org.junit.jupiter:junit-jupiter"
+ update-types: [ "version-update:semver-major" ]
- package-ecosystem: "gradle"
directory: "/modules/rabbitmq"
schedule:
- interval: "weekly"
+ interval: "monthly"
open-pull-requests-limit: 10
- package-ecosystem: "gradle"
directory: "/modules/redpanda"
schedule:
- interval: "weekly"
+ interval: "monthly"
+ open-pull-requests-limit: 10
+ ignore:
+ - dependency-name: "io.rest-assured:rest-assured"
+ update-types: [ "version-update:semver-major" ]
+ - package-ecosystem: "gradle"
+ directory: "/modules/scylladb"
+ schedule:
+ interval: "monthly"
open-pull-requests-limit: 10
- package-ecosystem: "gradle"
directory: "/modules/selenium"
schedule:
- interval: "weekly"
+ interval: "monthly"
open-pull-requests-limit: 10
ignore:
- dependency-name: "org.seleniumhq.selenium:selenium-bom"
@@ -262,7 +364,7 @@ updates:
- package-ecosystem: "gradle"
directory: "/modules/solace"
schedule:
- interval: "weekly"
+ interval: "monthly"
open-pull-requests-limit: 10
ignore:
- dependency-name: "org.apache.qpid:qpid-jms-client"
@@ -270,7 +372,7 @@ updates:
- package-ecosystem: "gradle"
directory: "/modules/solr"
schedule:
- interval: "weekly"
+ interval: "monthly"
open-pull-requests-limit: 10
ignore:
- dependency-name: "org.apache.solr:solr-solrj"
@@ -278,39 +380,60 @@ updates:
- package-ecosystem: "gradle"
directory: "/modules/spock"
schedule:
- interval: "weekly"
+ interval: "monthly"
+ ignore:
+ - dependency-name: "org.junit:junit-bom"
+ update-types: [ "version-update:semver-major" ]
open-pull-requests-limit: 10
- package-ecosystem: "gradle"
directory: "/modules/tidb"
schedule:
- interval: "weekly"
+ interval: "monthly"
+ open-pull-requests-limit: 10
+ - package-ecosystem: "gradle"
+ directory: "/modules/timeplus"
+ schedule:
+ interval: "monthly"
open-pull-requests-limit: 10
- package-ecosystem: "gradle"
directory: "/modules/toxiproxy"
schedule:
- interval: "weekly"
+ interval: "monthly"
open-pull-requests-limit: 10
- package-ecosystem: "gradle"
directory: "/modules/trino"
schedule:
- interval: "weekly"
+ interval: "monthly"
+ open-pull-requests-limit: 10
+ - package-ecosystem: "gradle"
+ directory: "/modules/typesense"
+ schedule:
+ interval: "monthly"
open-pull-requests-limit: 10
- package-ecosystem: "gradle"
directory: "/modules/vault"
schedule:
- interval: "weekly"
+ interval: "monthly"
+ open-pull-requests-limit: 10
+ ignore:
+ - dependency-name: "io.rest-assured:rest-assured"
+ update-types: [ "version-update:semver-major" ]
+ - package-ecosystem: "gradle"
+ directory: "/modules/weaviate"
+ schedule:
+ interval: "monthly"
open-pull-requests-limit: 10
- package-ecosystem: "gradle"
directory: "/modules/yugabytedb"
schedule:
- interval: "weekly"
+ interval: "monthly"
open-pull-requests-limit: 10
# Examples
- package-ecosystem: "gradle"
directory: "/examples"
schedule:
- interval: "weekly"
+ interval: "monthly"
open-pull-requests-limit: 10
ignore:
- dependency-name: "ch.qos.logback:logback-classic"
@@ -326,11 +449,41 @@ updates:
- dependency-name: "org.springframework.boot"
update-types: [ "version-update:semver-major" ]
- dependency-name: "com.diffplug.spotless"
+ update-types: [ "version-update:semver-major", "version-update:semver-minor" ]
+ - dependency-name: "com.hazelcast:hazelcast"
update-types: [ "version-update:semver-minor" ]
+ - dependency-name: "org.junit.jupiter:junit-jupiter"
+ update-types: [ "version-update:semver-major" ]
+ - dependency-name: "org.junit.platform:junit-platform-launcher"
+ update-types: [ "version-update:semver-major" ]
+ - dependency-name: "org.junit:junit-bom"
+ update-types: [ "version-update:semver-major" ]
+ - dependency-name: "com.gradleup.shadow"
+ update-types: [ "version-update:semver-major" ]
+
+# Smoke test
+ - package-ecosystem: "gradle"
+ directory: "/smoke-test"
+ schedule:
+ interval: "monthly"
+ open-pull-requests-limit: 10
+ ignore:
+ - dependency-name: "ch.qos.logback:logback-classic"
+ update-types: [ "version-update:semver-minor" ]
+ - dependency-name: "com.diffplug.spotless"
+ update-types: [ "version-update:semver-major", "version-update:semver-minor" ]
+ - dependency-name: "org.junit.jupiter:junit-jupiter"
+ update-types: [ "version-update:semver-major" ]
+ - dependency-name: "org.junit.platform:junit-platform-launcher"
+ update-types: [ "version-update:semver-major" ]
+ - dependency-name: "com.gradleup.shadow"
+ update-types: [ "version-update:semver-major" ]
# GitHub Actions
- package-ecosystem: "github-actions"
- directory: "/"
+ directories:
+ - /.github/workflows
+ - /.github/actions/**
schedule:
interval: "weekly"
open-pull-requests-limit: 10
diff --git a/.github/labeler.yml b/.github/labeler.yml
index e3bce388744..f4649bd7f99 100644
--- a/.github/labeler.yml
+++ b/.github/labeler.yml
@@ -5,6 +5,10 @@
- core/src/main/java/org/testcontainers/containers/ComposeDelegate.java
- core/src/main/java/org/testcontainers/containers/DockerComposeContainer.java
- core/src/main/java/org/testcontainers/containers/DockerComposeFiles.java
+ - core/src/test/java/org/testcontainers/containers/Compose*Test.java
+ - core/src/test/java/org/testcontainers/containers/DockerCompose*Test.java
+ - core/src/test/java/org/testcontainers/junit/Compose*Test.java
+ - core/src/test/java/org/testcontainers/junit/DockerCompose*Test.java
"github_actions":
- changed-files:
- any-glob-to-any-file:
@@ -27,6 +31,10 @@
- changed-files:
- any-glob-to-any-file:
- modules/cassandra/**/*
+"modules/chromadb":
+ - changed-files:
+ - any-glob-to-any-file:
+ - modules/chromadb/**/*
"modules/clickhouse":
- changed-files:
- any-glob-to-any-file:
@@ -47,6 +55,10 @@
- changed-files:
- any-glob-to-any-file:
- modules/cratedb/**/*
+"modules/databend":
+ - changed-files:
+ - any-glob-to-any-file:
+ - modules/databend/**/*
"modules/db2":
- changed-files:
- any-glob-to-any-file:
@@ -63,6 +75,10 @@
- changed-files:
- any-glob-to-any-file:
- modules/gcloud/**/*
+"modules/grafana":
+ - changed-files:
+ - any-glob-to-any-file:
+ - modules/grafana/**/*
"modules/hivemq":
- changed-files:
- any-glob-to-any-file:
@@ -83,10 +99,18 @@
- changed-files:
- any-glob-to-any-file:
- modules/k3s/**/*
+"modules/k6":
+ - changed-files:
+ - any-glob-to-any-file:
+ - modules/k6/**/*
"modules/kafka":
- changed-files:
- any-glob-to-any-file:
- modules/kafka/**/*
+"modules/ldap":
+ - changed-files:
+ - any-glob-to-any-file:
+ - modules/ldap/**/*
"modules/localstack":
- changed-files:
- any-glob-to-any-file:
@@ -95,6 +119,10 @@
- changed-files:
- any-glob-to-any-file:
- modules/mariadb/**/*
+"modules/milvus":
+ - changed-files:
+ - any-glob-to-any-file:
+ - modules/milvus/**/*
"modules/minio":
- changed-files:
- any-glob-to-any-file:
@@ -123,6 +151,18 @@
- changed-files:
- any-glob-to-any-file:
- modules/nginx/**/*
+"modules/oceanbase":
+ - changed-files:
+ - any-glob-to-any-file:
+ - modules/oceanbase/**/*
+"modules/ollama":
+ - changed-files:
+ - any-glob-to-any-file:
+ - modules/ollama/**/*
+"modules/openfga":
+ - changed-files:
+ - any-glob-to-any-file:
+ - modules/openfga/**/*
"modules/oracle":
- changed-files:
- any-glob-to-any-file:
@@ -132,6 +172,10 @@
- changed-files:
- any-glob-to-any-file:
- modules/orientdb/**/*
+"modules/pinecone":
+ - changed-files:
+ - any-glob-to-any-file:
+ - modules/pinecone/**/*
"modules/postgres":
- changed-files:
- any-glob-to-any-file:
@@ -144,6 +188,10 @@
- changed-files:
- any-glob-to-any-file:
- modules/pulsar/**/*
+"modules/qdrant":
+ - changed-files:
+ - any-glob-to-any-file:
+ - modules/qdrant/**/*
"modules/questdb":
- changed-files:
- any-glob-to-any-file:
@@ -160,6 +208,10 @@
- changed-files:
- any-glob-to-any-file:
- modules/redpanda/**/*
+"modules/scylladb":
+ - changed-files:
+ - any-glob-to-any-file:
+ - modules/scylladb/**/*
"modules/selenium":
- changed-files:
- any-glob-to-any-file:
@@ -180,6 +232,10 @@
- changed-files:
- any-glob-to-any-file:
- modules/tidb/**/*
+"modules/timeplus":
+ - changed-files:
+ - any-glob-to-any-file:
+ - modules/timeplus/**/*
"modules/toxiproxy":
- changed-files:
- any-glob-to-any-file:
@@ -188,10 +244,18 @@
- changed-files:
- any-glob-to-any-file:
- modules/trino/**/*
+"modules/typesense":
+ - changed-files:
+ - any-glob-to-any-file:
+ - modules/typesense/**/*
"modules/vault":
- changed-files:
- any-glob-to-any-file:
- modules/vault/**/*
+"modules/weaviate":
+ - changed-files:
+ - any-glob-to-any-file:
+ - modules/weaviate/**/*
"modules/yugabytedb":
- changed-files:
- any-glob-to-any-file:
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
index 31553ebfff1..6137bf623e3 100644
--- a/.github/pull_request_template.md
+++ b/.github/pull_request_template.md
@@ -1,6 +1,8 @@
-[Creating a Redis container (JUnit 4)](../examples/junit4/generic/src/test/java/generic/ContainerCreationTest.java) inside_block:simple
+[Creating a Redis container](../examples/junit5/redis/src/test/java/quickstart/RedisBackedCacheIntTest.java) inside_block:container
-Further options may be specified:
-
-
-[Creating a container with more options (JUnit 4)](../examples/junit4/generic/src/test/java/generic/ContainerCreationTest.java) inside_block:withOptions
-
-
-These containers, as `@ClassRule`s, will be started before any tests in the class run, and will be destroyed after all
+The container, as `@Container`, will be started before any tests in the class run, and will be destroyed after all
tests have run.
diff --git a/docs/features/creating_images.md b/docs/features/creating_images.md
index e4e6315a405..8a239d342cc 100644
--- a/docs/features/creating_images.md
+++ b/docs/features/creating_images.md
@@ -13,9 +13,9 @@ Testcontainers will `docker build` a temporary container image, and will use it
`ImageFromDockerfile` accepts arbitrary files, strings or classpath resources to be used as files in the build context.
At least one of these needs to be a `Dockerfile`.
+
```java
-@Rule
-public GenericContainer dslContainer = new GenericContainer(
+GenericContainer container = new GenericContainer(
new ImageFromDockerfile()
.withFileFromString("folder/someFile.txt", "hello")
.withFileFromClasspath("test.txt", "mappable-resource/test-resource.txt")
@@ -51,7 +51,7 @@ new GenericContainer(
new ImageFromDockerfile()
.withDockerfileFromBuilder(builder ->
builder
- .from("alpine:3.16")
+ .from("alpine:3.17")
.run("apk add --update nginx")
.cmd("nginx", "-g", "daemon off;")
.build()))
diff --git a/docs/features/image_name_substitution.md b/docs/features/image_name_substitution.md
index cf2b09d3d8e..0948e9fa2c7 100644
--- a/docs/features/image_name_substitution.md
+++ b/docs/features/image_name_substitution.md
@@ -125,6 +125,13 @@ Note that it is also possible to provide this same configuration property:
Please see [the documentation on configuration mechanisms](./configuration.md) for more information.
+Also, you can use the `ServiceLoader` mechanism to provide the fully qualified class name of the `ImageNameSubstitutor` implementation:
+
+=== "`src/test/resources/META-INF/services/org.testcontainers.utility.ImageNameSubstitutor`"
+ ```text
+ com.mycompany.testcontainers.ExampleImageNameSubstitutor
+ ```
+
## Overriding image names individually in configuration
diff --git a/docs/features/reuse.md b/docs/features/reuse.md
index b36669876c2..884f3d5ac33 100644
--- a/docs/features/reuse.md
+++ b/docs/features/reuse.md
@@ -16,7 +16,10 @@ opt-in mechanism per environment. To reuse a container, the container configurat
## How to use it
-* Enable `Reusable Containers` in `~/.testcontainers.properties`, by adding `testcontainers.reuse.enable=true`
+* Enable `Reusable Containers`
+ * through environment variable `TESTCONTAINERS_REUSE_ENABLE=true`
+ * through user property file `~/.testcontainers.properties`, by adding `testcontainers.reuse.enable=true`
+ * **not** through classpath properties file [see this comment](https://github.com/testcontainers/testcontainers-java/issues/5364#issuecomment-1125907734)
* Define a container and subscribe to reuse the container using `withReuse(true)`
```java
diff --git a/docs/index.md b/docs/index.md
index 90cb81bf3af..40304dd22ed 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -82,7 +82,7 @@ and then use dependencies without specifying a version:
```xml
org.testcontainers
- mysql
+ testcontainers-mysqltest
```
@@ -92,7 +92,7 @@ Using Gradle 5.0 or higher, you can add the following to the `dependencies` sect
=== "Gradle"
```groovy
implementation platform('org.testcontainers:testcontainers-bom:{{latest_version}}') //import bom
- testImplementation('org.testcontainers:mysql') //no version specified
+ testImplementation('org.testcontainers:testcontainers-mysql') //no version specified
```
@@ -221,6 +221,8 @@ A huge thank you to our sponsors:
* [Spark ClickHouse Connector](https://github.com/housepower/spark-clickhouse-connector) - Integration tests for Apache Spark with both single node ClickHouse instance and multi-node ClickHouse cluster.
* [Quarkus](https://github.com/quarkusio/quarkus) - Testcontainers is used extensively for Quarkus' [DevServices](https://quarkus.io/guides/dev-services) feature.
* [Apache Kyuubi](https://kyuubi.apache.org) - Integration testing with Trino as data source engine, Kafka, etc.
+* [Dash0](https://www.dash0.com) - Integration testing for OpenTelemetry Observability product.
+
## License
diff --git a/docs/modules/activemq.md b/docs/modules/activemq.md
index 6f1ef2e9252..7959c47576a 100644
--- a/docs/modules/activemq.md
+++ b/docs/modules/activemq.md
@@ -1,7 +1,7 @@
# ActiveMQ
-Testcontainers module for [ActiveMQ](https://hub.docker.com/r/apache/activemq-classic) and
-[Artemis](https://hub.docker.com/r/apache/activemq-artemis).
+Testcontainers module for [ActiveMQ](https://hub.docker.com/r/apache/activemq) and
+[Artemis](https://hub.docker.com/r/apache/artemis).
## ActiveMQContainer's usage examples
@@ -43,14 +43,14 @@ Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:activemq:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-activemq:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- activemq
+ testcontainers-activemq{{latest_version}}test
diff --git a/docs/modules/azure.md b/docs/modules/azure.md
index 5e80270e90c..461fcc9f679 100644
--- a/docs/modules/azure.md
+++ b/docs/modules/azure.md
@@ -5,20 +5,147 @@ This module is INCUBATING. While it is ready for use and operational in the curr
Testcontainers module for the Microsoft Azure's [SDK](https://github.com/Azure/azure-sdk-for-java).
-Currently, the module supports `CosmosDB` emulator. In order to use it, you should use the following class:
+Currently, the module supports `Azurite`, `Azure Event Hubs`, `Azure Service Bus` and `CosmosDB` emulators. In order to use them, you should use the following classes:
Class | Container Image
-|-
+AzuriteContainer | [mcr.microsoft.com/azure-storage/azurite](https://github.com/microsoft/containerregistry)
+EventHubsEmulatorContainer | [mcr.microsoft.com/azure-messaging/eventhubs-emulator](https://github.com/microsoft/containerregistry)
+ServiceBusEmulatorContainer | [mcr.microsoft.com/azure-messaging/servicebus-emulator](https://github.com/microsoft/containerregistry)
CosmosDBEmulatorContainer | [mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator](https://github.com/microsoft/containerregistry)
## Usage example
+### Azurite Storage Emulator
+
+Start Azurite Emulator during a test:
+
+
+[Starting an Azurite container](../../modules/azure/src/test/java/org/testcontainers/azure/AzuriteContainerTest.java) inside_block:emulatorContainer
+
+
+!!! note
+ SSL configuration is possible using the `withSsl(MountableFile, String)` and `withSsl(MountableFile, MountableFile)` methods.
+
+Newer Azure Storage SDK versions can send API versions that Azurite does not support. Use `withCommandOptions(...)` to append extra Azurite flags such as `--skipApiVersionCheck`. `AzuriteContainer` rebuilds its process command in `configure()`, so `.withCommand(...)` cannot be used for extra flags.
+
+
+[Pass extra Azurite command options](../../modules/azure/src/test/java/org/testcontainers/azure/AzuriteContainerCommandTest.java) inside_block:commandOptions
+
+
+If the tested application needs to use more than one set of credentials, the container can be configured to use custom credentials.
+Please see some examples below.
+
+
+[Starting an Azurite Blob container with one account and two keys](../../modules/azure/src/test/java/org/testcontainers/azure/AzuriteContainerTest.java) inside_block:withTwoAccountKeys
+
+
+
+[Starting an Azurite Blob container with more accounts and keys](../../modules/azure/src/test/java/org/testcontainers/azure/AzuriteContainerTest.java) inside_block:withMoreAccounts
+
+
+#### Using with Blob
+
+Build Azure Blob client:
+
+
+[Build Azure Blob Service client](../../modules/azure/src/test/java/org/testcontainers/azure/AzuriteContainerTest.java) inside_block:createBlobClient
+
+
+In case the application needs to use custom credentials, we can obtain them with a different method:
+
+
+[Obtain connection string with non-default credentials](../../modules/azure/src/test/java/org/testcontainers/azure/AzuriteContainerTest.java) inside_block:useNonDefaultCredentials
+
+
+#### Using with Queue
+
+Build Azure Queue client:
+
+
+[Build Azure Queue Service client](../../modules/azure/src/test/java/org/testcontainers/azure/AzuriteContainerTest.java) inside_block:createQueueClient
+
+
+!!! note
+ We can use custom credentials the same way as defined in the Blob section.
+
+#### Using with Table
+
+Build Azure Table client:
+
+
+[Build Azure Table Service client](../../modules/azure/src/test/java/org/testcontainers/azure/AzuriteContainerTest.java) inside_block:createTableClient
+
+
+!!! note
+ We can use custom credentials the same way as defined in the Blob section.
+
+### Azure Event Hubs Emulator
+
+
+[Configuring the Azure Event Hubs Emulator container](../../modules/azure/src/test/resources/eventhubs_config.json)
+
+
+Start Azure Event Hubs Emulator during a test:
+
+
+[Setting up a network](../../modules/azure/src/test/java/org/testcontainers/azure/EventHubsEmulatorContainerTest.java) inside_block:network
+
+
+
+[Starting an Azurite container as dependency](../../modules/azure/src/test/java/org/testcontainers/azure/EventHubsEmulatorContainerTest.java) inside_block:azuriteContainer
+
+
+
+[Starting an Azure Event Hubs Emulator container](../../modules/azure/src/test/java/org/testcontainers/azure/EventHubsEmulatorContainerTest.java) inside_block:emulatorContainer
+
+
+#### Using Azure Event Hubs clients
+
+Configure the consumer and the producer clients:
+
+
+[Configuring the clients](../../modules/azure/src/test/java/org/testcontainers/azure/EventHubsEmulatorContainerTest.java) inside_block:createProducerAndConsumer
+
+
+### Azure Service Bus Emulator
+
+
+[Configuring the Azure Service Bus Emulator container](../../modules/azure/src/test/resources/service-bus-config.json)
+
+
+Start Azure Service Bus Emulator during a test:
+
+
+[Setting up a network](../../modules/azure/src/test/java/org/testcontainers/azure/ServiceBusEmulatorContainerTest.java) inside_block:network
+
+
+
+[Starting a SQL Server container as dependency](../../modules/azure/src/test/java/org/testcontainers/azure/ServiceBusEmulatorContainerTest.java) inside_block:sqlContainer
+
+
+
+[Starting a Service Bus Emulator container](../../modules/azure/src/test/java/org/testcontainers/azure/ServiceBusEmulatorContainerTest.java) inside_block:emulatorContainer
+
+
+#### Using Azure Service Bus clients
+
+Configure the sender and the processor clients:
+
+
+[Configuring the sender client](../../modules/azure/src/test/java/org/testcontainers/azure/ServiceBusEmulatorContainerTest.java) inside_block:senderClient
+
+
+
+[Configuring the processor client](../../modules/azure/src/test/java/org/testcontainers/azure/ServiceBusEmulatorContainerTest.java) inside_block:processorClient
+
+
### CosmosDB
Start Azure CosmosDB Emulator during a test:
-[Starting a Azure CosmosDB Emulator container](../../modules/azure/src/test/java/org/testcontainers/containers/CosmosDBEmulatorContainerTest.java) inside_block:emulatorContainer
+[Starting an Azure CosmosDB Emulator container](../../modules/azure/src/test/java/org/testcontainers/containers/CosmosDBEmulatorContainerTest.java) inside_block:emulatorContainer
Prepare KeyStore to use for SSL.
@@ -51,14 +178,14 @@ Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:azure:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-azure:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- azure
+ testcontainers-azure{{latest_version}}test
diff --git a/docs/modules/chromadb.md b/docs/modules/chromadb.md
new file mode 100644
index 00000000000..bb50dfe3c02
--- /dev/null
+++ b/docs/modules/chromadb.md
@@ -0,0 +1,30 @@
+# ChromaDB
+
+Testcontainers module for [ChromaDB](https://registry.hub.docker.com/r/chromadb/chroma)
+
+## ChromaDB's usage examples
+
+You can start a ChromaDB container instance from any Java application by using:
+
+
+[Default ChromaDB container](../../modules/chromadb/src/test/java/org/testcontainers/chromadb/ChromaDBContainerTest.java) inside_block:container
+
+
+## Adding this module to your project dependencies
+
+Add the following dependency to your `pom.xml`/`build.gradle` file:
+
+=== "Gradle"
+```groovy
+testImplementation "org.testcontainers:testcontainers-chromadb:{{latest_version}}"
+```
+
+=== "Maven"
+```xml
+
+org.testcontainers
+testcontainers-chromadb
+{{latest_version}}
+test
+
+```
diff --git a/docs/modules/consul.md b/docs/modules/consul.md
index f9f21bfb541..bcdf7146da3 100644
--- a/docs/modules/consul.md
+++ b/docs/modules/consul.md
@@ -21,14 +21,14 @@ Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:consul:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-consul:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- consul
+ testcontainers-consul{{latest_version}}test
diff --git a/docs/modules/databases/cassandra.md b/docs/modules/databases/cassandra.md
index 73f93bf203a..9cc5e12499b 100644
--- a/docs/modules/databases/cassandra.md
+++ b/docs/modules/databases/cassandra.md
@@ -2,14 +2,36 @@
## Usage example
-This example connects to the Cassandra Cluster, creates a keyspaces and asserts that is has been created.
+This example connects to the Cassandra cluster:
+
+1. Define a container:
+
+ [Container definition](../../../modules/cassandra/src/test/java/org/testcontainers/cassandra/CassandraContainerTest.java) inside_block:container-definition
+
+
+2. Build a `CqlSession`:
+
+ [Building CqlSession](../../../modules/cassandra/src/test/java/org/testcontainers/cassandra/CassandraContainerTest.java) inside_block:cql-session
+
+
+3. Define a container with custom `cassandra.yaml` located in a directory `cassandra-auth-required-configuration`:
+
+
+ [Running init script with required authentication](../../../modules/cassandra/src/test/java/org/testcontainers/cassandra/CassandraContainerTest.java) inside_block:init-with-auth
+
+
+## Using secure connection (TLS)
+
+If you override the default `cassandra.yaml` with a version setting the property `client_encryption_options.optional`
+to `false`, you have to provide a valid client certificate and key (PEM format) when you initialize your container:
-[Building CqlSession](../../../modules/cassandra/src/test/java/org/testcontainers/containers/CassandraDriver3Test.java) inside_block:cassandra
+[SSL setup](../../../modules/cassandra/src/test/java/org/testcontainers/cassandra/CassandraContainerTest.java) inside_block:with-ssl-config
-!!! warning
- All methods returning instances of the Cassandra Driver's Cluster object in `CassandraContainer` have been deprecated. Providing these methods unnecessarily couples the Container to the Driver and creates potential breaking changes if the driver is updated.
+!!! hint
+ To generate the client certificate and key, please refer to
+ [this documentation](https://docs.datastax.com/en/cassandra-oss/3.x/cassandra/configuration/secureSSLCertificates.html).
## Adding this module to your project dependencies
@@ -17,14 +39,14 @@ Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:cassandra:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-cassandra:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- cassandra
+ testcontainers-cassandra{{latest_version}}test
diff --git a/docs/modules/databases/clickhouse.md b/docs/modules/databases/clickhouse.md
index b3494867edf..4e49c69c276 100644
--- a/docs/modules/databases/clickhouse.md
+++ b/docs/modules/databases/clickhouse.md
@@ -1,19 +1,35 @@
# Clickhouse Module
+Testcontainers module for [ClickHouse](https://hub.docker.com/r/clickhouse/clickhouse-server)
+
+## Usage example
+
+You can start a ClickHouse container instance from any Java application by using:
+
+
+[Container definition](../../../modules/clickhouse/src/test/java/org/testcontainers/clickhouse/ClickHouseContainerTest.java) inside_block:container
+
+
+### Testcontainers JDBC URL
+
+`jdbc:tc:clickhouse:18.10.3:///databasename`
+
+See [JDBC](./jdbc.md) for documentation.
+
## Adding this module to your project dependencies
Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:clickhouse:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-clickhouse:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- clickhouse
+ testcontainers-clickhouse{{latest_version}}test
diff --git a/docs/modules/databases/cockroachdb.md b/docs/modules/databases/cockroachdb.md
index 45e3f75b86c..add1b9cd1aa 100644
--- a/docs/modules/databases/cockroachdb.md
+++ b/docs/modules/databases/cockroachdb.md
@@ -1,21 +1,37 @@
# CockroachDB Module
+Testcontainers module for [CockroachDB](https://hub.docker.com/r/cockroachdb/cockroach)
+
+## Usage example
+
+You can start a CockroachDB container instance from any Java application by using:
+
+
+[Container definition](../../../modules/cockroachdb/src/test/java/org/testcontainers/cockroachdb/CockroachContainerTest.java) inside_block:container
+
+
See [Database containers](./index.md) for documentation and usage that is common to all relational database container types.
+### Testcontainers JDBC URL
+
+`jdbc:tc:cockroach:v21.2.3:///databasename`
+
+See [JDBC](./jdbc.md) for documentation.
+
## Adding this module to your project dependencies
Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:cockroachdb:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-cockroachdb:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- cockroachdb
+ testcontainers-cockroachdb{{latest_version}}test
diff --git a/docs/modules/databases/couchbase.md b/docs/modules/databases/couchbase.md
index 5c1ff9f5580..997347611e2 100644
--- a/docs/modules/databases/couchbase.md
+++ b/docs/modules/databases/couchbase.md
@@ -29,13 +29,13 @@ Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:couchbase:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-couchbase:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- couchbase
+ testcontainers-couchbase{{latest_version}}test
diff --git a/docs/modules/databases/cratedb.md b/docs/modules/databases/cratedb.md
index 74ec23dda00..25fd1642a9d 100644
--- a/docs/modules/databases/cratedb.md
+++ b/docs/modules/databases/cratedb.md
@@ -1,20 +1,36 @@
# CrateDB Module
+Testcontainers module for [CrateDB](https://hub.docker.com/_/crate)
+
+## Usage example
+
+You can start a CrateDB container instance from any Java application by using:
+
+
+[Container definition](../../../modules/cratedb/src/test/java/org/testcontainers/junit/cratedb/SimpleCrateDBTest.java) inside_block:container
+
+
See [Database containers](./index.md) for documentation and usage that is common to all relational database container types.
+### Testcontainers JDBC URL
+
+`jdbc:tc:cratedb:5.2.3:///databasename`
+
+See [JDBC](./jdbc.md) for documentation.
+
## Adding this module to your project dependencies
Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:cratedb:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-cratedb:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- cratedb
+ testcontainers-cratedb{{latest_version}}test
diff --git a/docs/modules/databases/databend.md b/docs/modules/databases/databend.md
new file mode 100644
index 00000000000..510dffb2f3e
--- /dev/null
+++ b/docs/modules/databases/databend.md
@@ -0,0 +1,40 @@
+# Databend Module
+
+Testcontainers module for [Databend](https://hub.docker.com/r/datafuselabs/databend)
+
+## Usage example
+
+You can start a Databend container instance from any Java application by using:
+
+
+[Container definition](../../../modules/databend/src/test/java/org/testcontainers/databend/DatabendContainerTest.java) inside_block:container
+
+
+### Testcontainers JDBC URL
+
+`jdbc:tc:databend:v1.2.615:///databasename`
+
+See [JDBC](./jdbc.md) for documentation.
+
+## Adding this module to your project dependencies
+
+Add the following dependency to your `pom.xml`/`build.gradle` file:
+
+=== "Gradle"
+ ```groovy
+ testImplementation "org.testcontainers:testcontainers-databend:{{latest_version}}"
+ ```
+
+=== "Maven"
+ ```xml
+
+ org.testcontainers
+ testcontainers-databend
+ {{latest_version}}
+ test
+
+ ```
+
+!!! hint
+Adding this Testcontainers library JAR will not automatically add a database driver JAR to your project. You should ensure that your project also has a suitable database driver as a dependency.
+
diff --git a/docs/modules/databases/db2.md b/docs/modules/databases/db2.md
index 945536cac05..ce05f6ae308 100644
--- a/docs/modules/databases/db2.md
+++ b/docs/modules/databases/db2.md
@@ -1,33 +1,25 @@
# DB2 Module
-!!! note
- This module is INCUBATING. While it is ready for use and operational in the current version of Testcontainers, it is possible that it may receive breaking changes in the future. See [our contributing guidelines](/contributing/#incubating-modules) for more information on our incubating modules policy.
-
-See [Database containers](./index.md) for documentation and usage that is common to all relational database container types.
+Testcontainers module for [DB2](https://www.ibm.com/docs/en/db2/11.5.x?topic=deployments-db2-community-edition-docker)
## Usage example
-Running DB2 as a stand-in for in a test:
-
-```java
-public class SomeTest {
+You can start a DB2 container instance from any Java application by using:
- @ClassRule
- public Db2Container db2 = new Db2Container()
- .acceptLicense();
-
- @Test
- public void someTestMethod() {
- String url = db2.getJdbcUrl();
-
- ... create a connection and run test as normal
- }
-```
+
+[Container definition](../../../modules/db2/src/test/java/org/testcontainers/db2/Db2ContainerTest.java) inside_block:container
+
!!! warning "EULA Acceptance"
Due to licencing restrictions you are required to accept an EULA for this container image. To indicate that you accept the DB2 image EULA, call the `acceptLicense()` method, or place a file at the root of the classpath named `container-license-acceptance.txt`, e.g. at `src/test/resources/container-license-acceptance.txt`. This file should contain the line: `ibmcom/db2:11.5.0.0a` (or, if you are overriding the docker image name/tag, update accordingly).
-
- Please see the [`ibmcom/db2` image documentation](https://hub.docker.com/r/ibmcom/db2) for a link to the EULA document.
+
+See [Database containers](./index.md) for documentation and usage that is common to all relational database container types.
+
+### Testcontainers JDBC URL
+
+`jdbc:tc:db2:11.5.0.0a:///databasename`
+
+See [JDBC](./jdbc.md) for documentation.
## Adding this module to your project dependencies
@@ -35,13 +27,13 @@ Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:db2:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-db2:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- db2
+ testcontainers-db2{{latest_version}}test
diff --git a/docs/modules/databases/dynalite.md b/docs/modules/databases/dynalite.md
deleted file mode 100644
index 8807ad7f025..00000000000
--- a/docs/modules/databases/dynalite.md
+++ /dev/null
@@ -1,47 +0,0 @@
-# Dynalite Module
-
-Testcontainers module for [Dynalite](https://github.com/mhart/dynalite). Dynalite is a clone of DynamoDB, enabling local testing.
-
-## Usage example
-
-Running Dynalite as a stand-in for DynamoDB in a test:
-
-```java
-public class SomeTest {
-
- @Rule
- public DynaliteContainer dynamoDB = new DynaliteContainer();
-
- @Test
- public void someTestMethod() {
- // getClient() returns a preconfigured DynamoDB client that is connected to the
- // dynalite container
- final AmazonDynamoDB client = dynamoDB.getClient();
-
- ... interact with client as if using DynamoDB normally
-```
-
-## Why Dynalite for DynamoDB testing?
-
-In part, because it's light and quick to run. Also, please see the [reasons given](https://github.com/mhart/dynalite#why-not-amazons-dynamodb-local) by the author of Dynalite and the [problems with Amazon's DynamoDB Local](https://github.com/mhart/dynalite#problems-with-amazons-dynamodb-local-updated-2016-04-19).
-
-## Adding this module to your project dependencies
-
-Add the following dependency to your `pom.xml`/`build.gradle` file:
-
-=== "Gradle"
- ```groovy
- testImplementation "org.testcontainers:dynalite:{{latest_version}}"
- ```
-=== "Maven"
- ```xml
-
- org.testcontainers
- dynalite
- {{latest_version}}
- test
-
- ```
-
-!!! hint
- Adding this Testcontainers library JAR will not automatically add an AWS SDK JAR to your project. You should ensure that your project also has a suitable AWS SDK JAR as a dependency.
diff --git a/docs/modules/databases/influxdb.md b/docs/modules/databases/influxdb.md
index 8055f6aed57..9644a5eb92b 100644
--- a/docs/modules/databases/influxdb.md
+++ b/docs/modules/databases/influxdb.md
@@ -90,7 +90,7 @@ Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
-testImplementation "org.testcontainers:influxdb:{{latest_version}}"
+testImplementation "org.testcontainers:testcontainers-influxdb:{{latest_version}}"
```
=== "Maven"
@@ -99,7 +99,7 @@ testImplementation "org.testcontainers:influxdb:{{latest_version}}"
org.testcontainers
- influxdb
+ testcontainers-influxdb{{latest_version}}test
diff --git a/docs/modules/databases/jdbc.md b/docs/modules/databases/jdbc.md
index dc11954153a..72539aef44e 100644
--- a/docs/modules/databases/jdbc.md
+++ b/docs/modules/databases/jdbc.md
@@ -37,11 +37,11 @@ Insert `tc:` after `jdbc:` as follows. Note that the hostname, port and database
#### Using CrateDB
-`jdbc:tc:cratedb:5.2.3//localhost:5432/crate`
+`jdbc:tc:cratedb:5.2.3:///databasename`
#### Using DB2
-`jdbc:tc:db2:11.5.0.0a//localhost:5432/crate`
+`jdbc:tc:db2:11.5.0.0a:///databasename`
#### Using MariaDB
@@ -55,6 +55,10 @@ Insert `tc:` after `jdbc:` as follows. Note that the hostname, port and database
`jdbc:tc:sqlserver:2017-CU12:///databasename`
+#### Using OceanBase
+
+`jdbc:tc:oceanbasece:4.2.1-lts:///databasename`
+
#### Using Oracle
`jdbc:tc:oracle:21-slim-faststart:///databasename`
@@ -75,10 +79,18 @@ Insert `tc:` after `jdbc:` as follows. Note that the hostname, port and database
`jdbc:tc:timescaledb:2.1.0-pg13:///databasename`
+#### Using PGVector
+
+`jdbc:tc:pgvector:pg16:///databasename`
+
#### Using TiDB
`jdbc:tc:tidb:v6.1.0:///databasename`
+#### Using Timeplus
+
+`jdbc:tc:timeplus:2.3.21:///databasename`
+
#### Using Trino
`jdbc:tc:trino:352://localhost/memory/default`
@@ -123,7 +135,7 @@ By default database container is being stopped as soon as last connection is clo
`jdbc:tc:mysql:8.0.36:///databasename?TC_DAEMON=true`
-With this parameter database container will keep running even when there're no open connections.
+With this parameter database container will keep running even when there's no open connections.
### Running container with tmpfs options
diff --git a/docs/modules/databases/mariadb.md b/docs/modules/databases/mariadb.md
index 25367d629bd..d90f9381cb5 100644
--- a/docs/modules/databases/mariadb.md
+++ b/docs/modules/databases/mariadb.md
@@ -1,7 +1,23 @@
# MariaDB Module
+Testcontainers module for [MariaDB](https://hub.docker.com/_/mariadb)
+
+## Usage example
+
+You can start a MySQL container instance from any Java application by using:
+
+
+[Container definition](../../../modules/mariadb/src/test/java/org/testcontainers/mariadb/MariaDBContainerTest.java) inside_block:container
+
+
See [Database containers](./index.md) for documentation and usage that is common to all relational database container types.
+### Testcontainers JDBC URL
+
+`jdbc:tc:mariadb:10.3.39:///databasename`
+
+See [JDBC](./jdbc.md) for documentation.
+
## MariaDB `root` user password
If no custom password is specified, the container will use the default user password `test` for the `root` user as well.
@@ -14,13 +30,13 @@ Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:mariadb:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-mariadb:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- mariadb
+ testcontainers-mariadb{{latest_version}}test
diff --git a/docs/modules/databases/mongodb.md b/docs/modules/databases/mongodb.md
index 9e81e28c39f..b861d83bb2c 100644
--- a/docs/modules/databases/mongodb.md
+++ b/docs/modules/databases/mongodb.md
@@ -1,20 +1,24 @@
# MongoDB Module
-!!! note
- This module is INCUBATING. While it is ready for use and operational in the current version of Testcontainers, it is possible that it may receive breaking changes in the future. See [our contributing guidelines](/contributing/#incubating-modules) for more information on our incubating modules policy.
+The MongoDB module provides two Testcontainers for MongoDB unit testing:
+
+* [MongoDBContainer](#mongodbcontainer) - the core MongoDB database
+* [MongoDBAtlasLocalContainer](#mongodbatlaslocalcontainer) - the core MongoDB database combined with MongoDB Atlas Search + Atlas Vector Search
+
+## MongoDBContainer
-## Usage example
+### Usage example
The following example shows how to create a MongoDBContainer:
-[Creating a MongoDB container](../../../modules/mongodb/src/test/java/org/testcontainers/containers/MongoDBContainerTest.java) inside_block:creatingMongoDBContainer
+[Creating a MongoDB container](../../../modules/mongodb/src/test/java/org/testcontainers/mongodb/MongoDBContainerTest.java) inside_block:creatingMongoDBContainer
And how to start it:
-[Starting a MongoDB container](../../../modules/mongodb/src/test/java/org/testcontainers/containers/MongoDBContainerTest.java) inside_block:startingMongoDBContainer
+[Starting a MongoDB container](../../../modules/mongodb/src/test/java/org/testcontainers/mongodb/MongoDBContainerTest.java) inside_block:startingMongoDBContainer
!!! note
@@ -36,26 +40,57 @@ For instance, to initialize a single node replica set on fixed ports via Docker,
As we can see, there is a lot of operations to execute and we even haven't touched a non-fixed port approach.
That's where the MongoDBContainer might come in handy.
+## MongoDBAtlasLocalContainer
+
+### Usage example
+
+The following example shows how to create a MongoDBAtlasLocalContainer:
+
+
+[Creating a MongoDB Atlas Local Container](../../../modules/mongodb/src/test/java/org/testcontainers/mongodb/MongoDBAtlasLocalContainerTest.java) inside_block:creatingAtlasLocalContainer
+
+
+And how to start it:
+
+
+[Start the Container](../../../modules/mongodb/src/test/java/org/testcontainers/mongodb/MongoDBAtlasLocalContainerTest.java) inside_block:startingAtlasLocalContainer
+
+
+The connection string provided by the MongoDBAtlasLocalContainer's getConnectionString() method includes the dynamically allocated port:
+
+
+[Get the Connection String](../../../modules/mongodb/src/test/java/org/testcontainers/mongodb/MongoDBAtlasLocalContainerTest.java) inside_block:getConnectionStringAtlasLocalContainer
+
+
+e.g. `mongodb://localhost:12345/?directConnection=true`
+
+### References
+MongoDB Atlas Local combines the MongoDB database engine with MongoT, a sidecar process for advanced searching capabilities built by MongoDB and powered by [Apache Lucene](https://lucene.apache.org/).
+
+The container (mongodb/mongodb-atlas-local) documentation can be found [here](https://www.mongodb.com/docs/atlas/cli/current/atlas-cli-deploy-docker/).
+
+General information about Atlas Search can be found [here](https://www.mongodb.com/docs/atlas/atlas-search/).
+
## Adding this module to your project dependencies
Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:mongodb:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-mongodb:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- mongodb
+ testcontainers-mongodb{{latest_version}}test
```
!!! hint
-Adding this Testcontainers library JAR will not automatically add a database driver JAR to your project. You should ensure that your project also has a suitable database driver as a dependency
+ Adding this Testcontainers library JAR will not automatically add a database driver JAR to your project. You should ensure that your project also has a suitable database driver as a dependency
#### Copyright
Copyright (c) 2019 Konstantin Silaev
diff --git a/docs/modules/databases/mssqlserver.md b/docs/modules/databases/mssqlserver.md
index 9d0912f2563..5c9d7b0a9fb 100644
--- a/docs/modules/databases/mssqlserver.md
+++ b/docs/modules/databases/mssqlserver.md
@@ -1,43 +1,41 @@
# MS SQL Server Module
-See [Database containers](./index.md) for documentation and usage that is common to all relational database container types.
+Testcontainers module for [MS SQL Server](https://mcr.microsoft.com/en-us/artifact/mar/mssql/server/)
## Usage example
-Running MS SQL Server as a stand-in for in a test:
-
-```java
-public class SomeTest {
+You can start a MS SQL Server container instance from any Java application by using:
- @Rule
- public MSSQLServerContainer mssqlserver = new MSSQLServerContainer()
- .acceptLicense();
-
- @Test
- public void someTestMethod() {
- String url = mssqlserver.getJdbcUrl();
-
- ... create a connection and run test as normal
-```
+
+[Container definition](../../../modules/mssqlserver/src/test/java/org/testcontainers/mssqlserver/MSSQLServerContainerTest.java) inside_block:container
+
!!! warning "EULA Acceptance"
Due to licencing restrictions you are required to accept an EULA for this container image. To indicate that you accept the MS SQL Server image EULA, call the `acceptLicense()` method, or place a file at the root of the classpath named `container-license-acceptance.txt`, e.g. at `src/test/resources/container-license-acceptance.txt`. This file should contain the line: `mcr.microsoft.com/mssql/server:2017-CU12` (or, if you are overriding the docker image name/tag, update accordingly).
Please see the [`microsoft-mssql-server` image documentation](https://hub.docker.com/_/microsoft-mssql-server#environment-variables) for a link to the EULA document.
+See [Database containers](./index.md) for documentation and usage that is common to all relational database container types.
+
+### Testcontainers JDBC URL
+
+`jdbc:tc:sqlserver:2017-CU12:///databasename`
+
+See [JDBC](./jdbc.md) for documentation.
+
## Adding this module to your project dependencies
Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:mssqlserver:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-mssqlserver:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- mssqlserver
+ testcontainers-mssqlserver{{latest_version}}test
diff --git a/docs/modules/databases/mysql.md b/docs/modules/databases/mysql.md
index 9d03d52b109..1747989766f 100644
--- a/docs/modules/databases/mysql.md
+++ b/docs/modules/databases/mysql.md
@@ -1,7 +1,23 @@
# MySQL Module
+Testcontainers module for [MySQL](https://hub.docker.com/_/mysql)
+
+## Usage example
+
+You can start a MySQL container instance from any Java application by using:
+
+
+[Container definition](../../../modules/mysql/src/test/java/org/testcontainers/mysql/MySQLContainerTest.java) inside_block:container
+
+
See [Database containers](./index.md) for documentation and usage that is common to all relational database container types.
+### Testcontainers JDBC URL
+
+`jdbc:tc:mysql:8.0.36:///databasename`
+
+See [JDBC](./jdbc.md) for documentation.
+
## Overriding MySQL my.cnf settings
For MySQL databases, it is possible to override configuration settings using resources on the classpath. Assuming `somepath/mysql_conf_override`
@@ -24,13 +40,13 @@ Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:mysql:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-mysql:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- mysql
+ testcontainers-mysql{{latest_version}}test
diff --git a/docs/modules/databases/neo4j.md b/docs/modules/databases/neo4j.md
index 17c58c7edff..c7b06e99fe7 100644
--- a/docs/modules/databases/neo4j.md
+++ b/docs/modules/databases/neo4j.md
@@ -9,19 +9,12 @@ the Testcontainers integration supports also newer 5.x images of Neo4j.
## Usage example
-Declare your Testcontainers as a `@ClassRule` or `@Rule` in a JUnit 4 test or as static or member attribute of a JUnit 5 test annotated with `@Container` as you would with other Testcontainers.
-You can either use call `getBoltUrl()` or `getHttpUrl()` on the Neo4j container.
-`getBoltUrl()` is meant to be used with one of the [official Bolt drivers](https://neo4j.com/developer/language-guides/) while `getHttpUrl()` gives you the HTTP-address of the transactional HTTP endpoint.
-On the JVM you would most likely use the [Java driver](https://github.com/neo4j/neo4j-java-driver).
-
-The following example uses the JUnit 5 extension `@Testcontainers` and demonstrates both the usage of the Java Driver and the REST endpoint:
+You can start a Neo4j container instance from any Java application by using:
-[JUnit 5 example](../../../examples/neo4j-container/src/test/java/org/testcontainers/containers/Neo4jExampleTest.java) inside_block:junitExample
+[Neo4j container](../../../modules/neo4j/src/test/java/org/testcontainers/neo4j/Neo4jContainerTest.java) inside_block:container
-You are not limited to Unit tests, and you can use an instance of the Neo4j Testcontainers in vanilla Java code as well.
-
## Additional features
### Custom password
@@ -29,7 +22,7 @@ You are not limited to Unit tests, and you can use an instance of the Neo4j Test
A custom password can be provided:
-[Custom password](../../../modules/neo4j/src/test/java/org/testcontainers/containers/Neo4jContainerTest.java) inside_block:withAdminPassword
+[Custom password](../../../modules/neo4j/src/test/java/org/testcontainers/neo4j/Neo4jContainerTest.java) inside_block:withAdminPassword
### Disable authentication
@@ -37,7 +30,7 @@ A custom password can be provided:
Authentication can be disabled:
-[Disable authentication](../../../modules/neo4j/src/test/java/org/testcontainers/containers/Neo4jContainerTest.java) inside_block:withoutAuthentication
+[Disable authentication](../../../modules/neo4j/src/test/java/org/testcontainers/neo4j/Neo4jContainerTest.java) inside_block:withoutAuthentication
### Random password
@@ -45,7 +38,7 @@ Authentication can be disabled:
A random (`UUID`-random based) password can be set:
-[Random password](../../../modules/neo4j/src/test/java/org/testcontainers/containers/Neo4jContainerTest.java) inside_block:withRandomPassword
+[Random password](../../../modules/neo4j/src/test/java/org/testcontainers/neo4j/Neo4jContainerTest.java) inside_block:withRandomPassword
### Neo4j-Configuration
@@ -54,7 +47,7 @@ Neo4j's Docker image needs Neo4j configuration options in a dedicated format.
The container takes care of that, and you can configure the database with standard options like the following:
-[Neo4j configuration](../../../modules/neo4j/src/test/java/org/testcontainers/containers/Neo4jContainerTest.java) inside_block:neo4jConfiguration
+[Neo4j configuration](../../../modules/neo4j/src/test/java/org/testcontainers/neo4j/Neo4jContainerTest.java) inside_block:neo4jConfiguration
### Add custom plugins
@@ -62,27 +55,26 @@ The container takes care of that, and you can configure the database with standa
Custom plugins, like APOC, can be copied over to the container from any classpath or host resource like this:
-[Plugin jar](../../../modules/neo4j/src/test/java/org/testcontainers/containers/Neo4jContainerTest.java) inside_block:registerPluginsJar
+[Plugin jar](../../../modules/neo4j/src/test/java/org/testcontainers/neo4j/Neo4jContainerTest.java) inside_block:registerPluginsJar
Whole directories work as well:
-[Plugin folder](../../../modules/neo4j/src/test/java/org/testcontainers/containers/Neo4jContainerTest.java) inside_block:registerPluginsPath
+[Plugin folder](../../../modules/neo4j/src/test/java/org/testcontainers/neo4j/Neo4jContainerTest.java) inside_block:registerPluginsPath
### Add Neo4j Docker Labs plugins
-Add any Neo4j Labs plugin from the [Neo4j Docker Labs plugin list](https://neo4j.com/docs/operations-manual/4.4/docker/operations/#docker-neo4jlabs-plugins).
+Add any Neo4j Labs plugin from the [Neo4j 4.4 Docker Labs plugin list](https://neo4j.com/docs/operations-manual/4.4/docker/operations/#docker-neo4jlabs-plugins)
+or [Neo4j 5 plugin list](https://neo4j.com/docs/operations-manual/5/configuration/plugins/).
!!! note
- At the moment only the plugins available from the list Neo4j Docker 4.4 are supported by type.
- If you want to register another supported Neo4j Labs plugin, you have to add it manually
- by using the method `withLabsPlugins(String... neo4jLabsPlugins)`.
- Please refer to the list of [supported Docker image plugins](https://neo4j.com/docs/operations-manual/current/docker/operations/#docker-neo4jlabs-plugins).
+ The methods `withLabsPlugins(Neo4jLabsPlugin...)` and `withLabsPlugins(String... plugins)` are deprecated.
+ Please the method `withPlugins(String... plugins)`.
-[Configure Neo4j Labs Plugins](../../../modules/neo4j/src/test/java/org/testcontainers/containers/Neo4jContainerTest.java) inside_block:configureLabsPlugins
+[Configure Neo4j Labs Plugins](../../../modules/neo4j/src/test/java/org/testcontainers/neo4j/Neo4jContainerTest.java) inside_block:configureLabsPlugins
@@ -91,7 +83,7 @@ Add any Neo4j Labs plugin from the [Neo4j Docker Labs plugin list](https://neo4j
If you have an existing database (`graph.db`) you want to work with, copy it over to the container like this:
-[Copy database](../../../modules/neo4j/src/test/java/org/testcontainers/containers/Neo4jContainerTest.java) inside_block:copyDatabase
+[Copy database](../../../modules/neo4j/src/test/java/org/testcontainers/neo4j/Neo4jContainerTest.java) inside_block:copyDatabase
!!! note
@@ -102,7 +94,7 @@ If you have an existing database (`graph.db`) you want to work with, copy it ove
If you need the Neo4j enterprise license, you can declare your Neo4j container like this:
-[Enterprise edition](../../../modules/neo4j/src/test/java/org/testcontainers/containers/Neo4jContainerTest.java) inside_block:enterpriseEdition
+[Enterprise edition](../../../modules/neo4j/src/test/java/org/testcontainers/neo4j/Neo4jContainerTest.java) inside_block:enterpriseEdition
This creates a Testcontainers based on the Docker image build with the Enterprise version of Neo4j 4.4.
@@ -121,13 +113,13 @@ Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:neo4j:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-neo4j:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- neo4j
+ testcontainers-neo4j{{latest_version}}test
diff --git a/docs/modules/databases/oceanbase.md b/docs/modules/databases/oceanbase.md
new file mode 100644
index 00000000000..c315a871058
--- /dev/null
+++ b/docs/modules/databases/oceanbase.md
@@ -0,0 +1,41 @@
+# OceanBase Module
+
+Testcontainers module for [OceanBase](https://hub.docker.com/r/oceanbase/oceanbase-ce)
+
+## Usage example
+
+You can start an OceanBase container instance from any Java application by using:
+
+
+[Container definition](../../../modules/oceanbase/src/test/java/org/testcontainers/oceanbase/SimpleOceanBaseCETest.java) inside_block:container
+
+
+See [Database containers](./index.md) for documentation and usage that is common to all relational database container types.
+
+### Testcontainers JDBC URL
+
+`jdbc:tc:oceanbasece:4.2.1-lts:///databasename`
+
+See [JDBC](./jdbc.md) for documentation.
+
+## Adding this module to your project dependencies
+
+Add the following dependency to your `pom.xml`/`build.gradle` file:
+
+=== "Gradle"
+ ```groovy
+ testImplementation "org.testcontainers:testcontainers-oceanbase:{{latest_version}}"
+ ```
+
+=== "Maven"
+ ```xml
+
+ org.testcontainers
+ testcontainers-oceanbase
+ {{latest_version}}
+ test
+
+ ```
+
+!!! hint
+Adding this Testcontainers library JAR will not automatically add a database driver JAR to your project. You should ensure that your project also has a suitable database driver as a dependency.
diff --git a/docs/modules/databases/oraclefree.md b/docs/modules/databases/oraclefree.md
index c85d672f140..75f3d677ffc 100644
--- a/docs/modules/databases/oraclefree.md
+++ b/docs/modules/databases/oraclefree.md
@@ -1,27 +1,36 @@
# Oracle Database Free Module
-See [Database containers](./index.md) for documentation and usage that is common to all relational database container types.
+Testcontainers module for [Oracle Free](https://hub.docker.com/r/gvenzl/oracle-free)
## Usage example
-You can use `OracleContainer` like any other JDBC container:
+You can start an Oracle-Free container instance from any Java application by using:
+
-[Container creation](../../../modules/oracle-free/src/test/java/org/testcontainers/junit/oracle/SimpleOracleTest.java) inside_block:constructor
+[Container creation](../../../modules/oracle-free/src/test/java/org/testcontainers/junit/oracle/SimpleOracleTest.java) inside_block:container
+See [Database containers](./index.md) for documentation and usage that is common to all relational database container types.
+
+### Testcontainers JDBC URL
+
+`jdbc:tc:oracle:21-slim-faststart:///databasename`
+
+See [JDBC](./jdbc.md) for documentation.
+
## Adding this module to your project dependencies
Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:oracle-free:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-oracle-free:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- oracle-free
+ testcontainers-oracle-free{{latest_version}}test
diff --git a/docs/modules/databases/oraclexe.md b/docs/modules/databases/oraclexe.md
index bfc06d9a106..8d060ed65be 100644
--- a/docs/modules/databases/oraclexe.md
+++ b/docs/modules/databases/oraclexe.md
@@ -1,27 +1,36 @@
# Oracle-XE Module
-See [Database containers](./index.md) for documentation and usage that is common to all relational database container types.
+Testcontainers module for [Oracle XE](https://hub.docker.com/r/gvenzl/oracle-xe)
## Usage example
-You can use `OracleContainer` like any other JDBC container:
+You can start an Oracle-XE container instance from any Java application by using:
+
-[Container creation](../../../modules/oracle-xe/src/test/java/org/testcontainers/junit/oracle/SimpleOracleTest.java) inside_block:constructor
+[Container creation](../../../modules/oracle-xe/src/test/java/org/testcontainers/junit/oracle/SimpleOracleTest.java) inside_block:container
+See [Database containers](./index.md) for documentation and usage that is common to all relational database container types.
+
+### Testcontainers JDBC URL
+
+`jdbc:tc:oracle:21-slim-faststart:///databasename`
+
+See [JDBC](./jdbc.md) for documentation.
+
## Adding this module to your project dependencies
Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:oracle-xe:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-oracle-xe:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- oracle-xe
+ testcontainers-oracle-xe{{latest_version}}test
diff --git a/docs/modules/databases/orientdb.md b/docs/modules/databases/orientdb.md
index 57839cd99f0..f3be7e2bbdb 100644
--- a/docs/modules/databases/orientdb.md
+++ b/docs/modules/databases/orientdb.md
@@ -1,46 +1,14 @@
# OrientDB Module
-!!! note
- This module is INCUBATING. While it is ready for use and operational in the current version of Testcontainers, it is possible that it may receive breaking changes in the future. See [our contributing guidelines](/contributing/#incubating-modules) for more information on our incubating modules policy.
-
-
-This module helps running [OrientDB](https://orientdb.org/download) using Testcontainers.
-
-Note that it's based on the [official Docker image](https://hub.docker.com/_/orientdb/) provided by OrientDB.
+Testcontainers module for [OrientDB](https://hub.docker.com/_/orientdb/)
## Usage example
-Declare your Testcontainers instance as a `@ClassRule` or `@Rule` in a JUnit 4 test or as static or member attribute of a JUnit 5 test annotated with `@Container` as you would with other Testcontainers.
-You can call `getDbUrl()` OrientDB container and build the `ODatabaseSession` by your own, but a more useful `getSession()` method is provided.
-On the JVM you would most likely use the [Java driver](https://github.com/).
-
-The following example uses the JUnit 5 extension `@Testcontainers` and demonstrates both the usage of the Java Client:
-
-=== "JUnit 5 example"
- ```java
- @Testcontainers
- public class ExampleTest {
-
- @Container
- private static OrientDBContainer container = new OrientDBContainer();
-
- @Test
- void testDbCreation() {
-
- final ODatabaseSession session = container.getSession();
-
- session.command("CREATE CLASS Person EXTENDS V");
- session.command("INSERT INTO Person set name='john'");
- session.command("INSERT INTO Person set name='jane'");
-
- assertThat(session.query("SELECT FROM Person").stream()).hasSize(2);
- }
-
- }
- ```
-
-You are not limited to Unit tests and can of course use an instance of the OrientDB Testcontainers implementation in vanilla Java code as well.
+You can start an OrientDB container instance from any Java application by using:
+
+[Container creation](../../../modules/orientdb/src/test/java/org/testcontainers/orientdb/OrientDBContainerTest.java) inside_block:container
+
## Adding this module to your project dependencies
@@ -48,13 +16,13 @@ Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:orientdb:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-orientdb:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- orientdb
+ testcontainers-orientdb{{latest_version}}test
diff --git a/docs/modules/databases/postgres.md b/docs/modules/databases/postgres.md
index b7632d78293..f27752b8354 100644
--- a/docs/modules/databases/postgres.md
+++ b/docs/modules/databases/postgres.md
@@ -1,20 +1,61 @@
# Postgres Module
+Testcontainers module for [PostgresSQL](https://hub.docker.com/_/postgres)
+
+## Usage example
+
+You can start a PostgreSQL container instance from any Java application by using:
+
+
+[Container creation](../../../modules/postgresql/src/test/java/org/testcontainers/postgresql/PostgreSQLContainerTest.java) inside_block:container
+
+
See [Database containers](./index.md) for documentation and usage that is common to all relational database container types.
+### Testcontainers JDBC URL
+
+* PostgreSQL: `jdbc:tc:postgresql:9.6.8:///databasename`
+* PostGIS: `jdbc:tc:postgis:9.6-2.5:///databasename`
+* TimescaleDB: `jdbc:tc:timescaledb:2.1.0-pg13:///databasename`
+* PGvector: `jdbc:tc:pgvector:pg16:///databasename`
+
+See [JDBC](./jdbc.md) for documentation.
+
+## Compatible images
+
+`PostgreSQLContainer` can also be used with the following images:
+
+* [pgvector/pgvector](https://hub.docker.com/r/pgvector/pgvector)
+
+
+[Using pgvector](../../../modules/postgresql/src/test/java/org/testcontainers/postgresql/CompatibleImageTest.java) inside_block:pgvectorContainer
+
+
+* [postgis/postgis](https://registry.hub.docker.com/r/postgis/postgis)
+
+
+[Using PostGIS](../../../modules/postgresql/src/test/java/org/testcontainers/postgresql/CompatibleImageTest.java) inside_block:postgisContainer
+
+
+* [timescale/timescaledb](https://hub.docker.com/r/timescale/timescaledb)
+
+
+[Using TimescaleDB](../../../modules/postgresql/src/test/java/org/testcontainers/postgresql/CompatibleImageTest.java) inside_block:timescaledbContainer
+
+
## Adding this module to your project dependencies
Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:postgresql:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-postgresql:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- postgresql
+ testcontainers-postgresql{{latest_version}}test
diff --git a/docs/modules/databases/presto.md b/docs/modules/databases/presto.md
index d0a47fc1d7a..4e9a6e7c95d 100644
--- a/docs/modules/databases/presto.md
+++ b/docs/modules/databases/presto.md
@@ -69,13 +69,13 @@ Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:presto:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-presto:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- presto
+ testcontainers-presto{{latest_version}}test
diff --git a/docs/modules/databases/questdb.md b/docs/modules/databases/questdb.md
index 8783dd4b757..eb5c466f371 100644
--- a/docs/modules/databases/questdb.md
+++ b/docs/modules/databases/questdb.md
@@ -1,11 +1,24 @@
# QuestDB Module
-Testcontainers module for [QuestDB](https://github.com/questdb/questdb). QuestDB is a high-performance, open-source SQL
-database for applications in financial services, IoT, machine learning, DevOps and observability.
+Testcontainers module for [QuestDB](https://hub.docker.com/r/questdb/questdb)
+
+## Usage example
+
+You can start a QuestDB container instance from any Java application by using:
+
+
+[Container creation](../../../modules/questdb/src/test/java/org/testcontainers/junit/questdb/SimpleQuestDBTest.java) inside_block:container
+
See [Database containers](./index.md) for documentation and usage that is common to all relational database container
types.
+### Testcontainers JDBC URL
+
+`jdbc:tc:questdb:6.5.3:///databasename`
+
+See [JDBC](./jdbc.md) for documentation.
+
## Adding this module to your project dependencies
Add the following dependency to your `pom.xml`/`build.gradle` file:
@@ -13,7 +26,7 @@ Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
-testImplementation "org.testcontainers:questdb:{{latest_version}}"
+testImplementation "org.testcontainers:testcontainers-questdb:{{latest_version}}"
```
=== "Maven"
@@ -22,7 +35,7 @@ testImplementation "org.testcontainers:questdb:{{latest_version}}"
org.testcontainers
- questdb
+ testcontainers-questdb{{latest_version}}test
diff --git a/docs/modules/databases/r2dbc.md b/docs/modules/databases/r2dbc.md
index 22c76e83dd8..91580811887 100644
--- a/docs/modules/databases/r2dbc.md
+++ b/docs/modules/databases/r2dbc.md
@@ -12,7 +12,7 @@ As long as you have Testcontainers and the appropriate R2DBC driver on your clas
The started container will be terminated when the `ConnectionFactory` is closed.
!!! warning
- Both the database module (e.g. `org.testcontainers:mysql`) **and** `org.testcontainers:r2dbc` need to be on your application's classpath at runtime.
+ Both the database module (e.g. `org.testcontainers:testcontainers-mysql`) **and** `org.testcontainers:testcontainers-r2dbc` need to be on your application's classpath at runtime.
**Original URL**: `r2dbc:mysql://localhost:3306/databasename`
@@ -33,6 +33,10 @@ So that the URL becomes:
### R2DBC URL examples
+#### Using ClickHouse
+
+`r2dbc:tc:clickhouse:///databasename?TC_IMAGE_TAG=21.11.11-alpine`
+
#### Using MySQL
`r2dbc:tc:mysql:///databasename?TC_IMAGE_TAG=8.0.36`
diff --git a/docs/modules/databases/scylladb.md b/docs/modules/databases/scylladb.md
new file mode 100644
index 00000000000..bde40e3b599
--- /dev/null
+++ b/docs/modules/databases/scylladb.md
@@ -0,0 +1,58 @@
+# ScyllaDB
+
+Testcontainers module for [ScyllaDB](https://hub.docker.com/r/scylladb/scylla)
+
+## ScyllaDB's usage examples
+
+You can start a ScyllaDB container instance from any Java application by using:
+
+
+[Create container](../../../modules/scylladb/src/test/java/org/testcontainers/scylladb/ScyllaDBContainerTest.java) inside_block:container
+
+
+
+[Custom config file](../../../modules/scylladb/src/test/java/org/testcontainers/scylladb/ScyllaDBContainerTest.java) inside_block:customConfiguration
+
+
+### Building CqlSession
+
+
+[Using CQL port](../../../modules/scylladb/src/test/java/org/testcontainers/scylladb/ScyllaDBContainerTest.java) inside_block:session
+
+
+
+[Using SSL](../../../modules/scylladb/src/test/java/org/testcontainers/scylladb/ScyllaDBContainerTest.java) inside_block:sslContext
+
+
+
+[Using Shard Awareness port](../../../modules/scylladb/src/test/java/org/testcontainers/scylladb/ScyllaDBContainerTest.java) inside_block:shardAwarenessSession
+
+
+### Alternator
+
+
+[Enabling Alternator](../../../modules/scylladb/src/test/java/org/testcontainers/scylladb/ScyllaDBContainerTest.java) inside_block:alternator
+
+
+
+[DynamoDbClient with Alternator](../../../modules/scylladb/src/test/java/org/testcontainers/scylladb/ScyllaDBContainerTest.java) inside_block:dynamodDbClient
+
+
+## Adding this module to your project dependencies
+
+Add the following dependency to your `pom.xml`/`build.gradle` file:
+
+=== "Gradle"
+ ```groovy
+ testImplementation "org.testcontainers:testcontainers-scylladb:{{latest_version}}"
+ ```
+
+=== "Maven"
+ ```xml
+
+ org.testcontainers
+ testcontainers-scylladb
+ {{latest_version}}
+ test
+
+ ```
diff --git a/docs/modules/databases/tidb.md b/docs/modules/databases/tidb.md
index 01c6b4cfcd4..17cb66b21c3 100644
--- a/docs/modules/databases/tidb.md
+++ b/docs/modules/databases/tidb.md
@@ -1,21 +1,37 @@
# TiDB Module
+Testcontainers module for [TiDB](https://hub.docker.com/r/pingcap/tidb)
+
+## Usage example
+
+You can start a TiDB container instance from any Java application by using:
+
+
+[Container creation](../../../modules/tidb/src/test/java/org/testcontainers/tidb/TiDBContainerTest.java) inside_block:container
+
+
See [Database containers](./index.md) for documentation and usage that is common to all relational database container types.
+### Testcontainers JDBC URL
+
+`jdbc:tc:tidb:v6.1.0:///databasename`
+
+See [JDBC](./jdbc.md) for documentation.
+
## Adding this module to your project dependencies
Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:tidb:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-tidb:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- tidb
+ testcontainers-tidb{{latest_version}}test
diff --git a/docs/modules/databases/timeplus.md b/docs/modules/databases/timeplus.md
new file mode 100644
index 00000000000..ee5e5767223
--- /dev/null
+++ b/docs/modules/databases/timeplus.md
@@ -0,0 +1,40 @@
+# Timeplus Module
+
+Testcontainers module for [Timeplus](https://hub.docker.com/r/timeplus/timeplusd)
+
+## Usage example
+
+You can start a Timeplus container instance from any Java application by using:
+
+
+[Container creation](../../../modules/timeplus/src/test/java/org/testcontainers/timeplus/TimeplusContainerTest.java) inside_block:container
+
+
+### Testcontainers JDBC URL
+
+`jdbc:tc:timeplus:2.3.21:///databasename`
+
+See [JDBC](./jdbc.md) for documentation.
+
+## Adding this module to your project dependencies
+
+Add the following dependency to your `pom.xml`/`build.gradle` file:
+
+=== "Gradle"
+ ```groovy
+ testImplementation "org.testcontainers:testcontainers-timeplus:{{latest_version}}"
+ ```
+
+=== "Maven"
+ ```xml
+
+ org.testcontainers
+ testcontainers-timeplus
+ {{latest_version}}
+ test
+
+ ```
+
+!!! hint
+ Adding this Testcontainers library JAR will not automatically add a database driver JAR to your project. You should ensure that your project also has a suitable database driver as a dependency.
+
diff --git a/docs/modules/databases/trino.md b/docs/modules/databases/trino.md
index b6aeddafb40..81fb4ea5b98 100644
--- a/docs/modules/databases/trino.md
+++ b/docs/modules/databases/trino.md
@@ -1,67 +1,22 @@
# Trino Module
-!!! note
- This module is INCUBATING. While it is ready for use and operational in the current version of Testcontainers, it is possible that it may receive breaking changes in the future. See [our contributing guidelines](/contributing/#incubating-modules) for more information on our incubating modules policy.
-
-See [Database containers](./index.md) for documentation and usage that is common to all database container types.
+Testcontainers module for [Trino](https://hub.docker.com/r/trinodb/trino)
## Usage example
-Running Trino as a stand-in for in a test:
-
-```java
-public class SomeTest {
-
- @Rule
- public TrinoContainer trino = new TrinoContainer();
-
- @Test
- public void someTestMethod() {
- String url = trino.getJdbcUrl();
+You can start a Trino container instance from any Java application by using:
- ... create a connection and run test as normal
-```
+
+[Container creation](../../../modules/trino/src/test/java/org/testcontainers/trino/TrinoContainerTest.java) inside_block:container
+
-Trino comes with several catalogs preconfigured. Most useful ones for testing are
-
-* `tpch` catalog using the [Trino TPCH Connector](https://trino.io/docs/current/connector/tpch.html).
- This is a read-only catalog that defines standard TPCH schema, so is available for querying without a need
- to create any tables.
-* `memory` catalog using the [Trino Memory Connector](https://trino.io/docs/current/connector/memory.html).
- This catalog can be used for creating schemas and tables and does not require any storage, as everything
- is stored fully in-memory.
-
-Example test using the `tpch` and `memory` catalogs:
+See [Database containers](./index.md) for documentation and usage that is common to all database container types.
-```java
-public class SomeTest {
- @Rule
- public TrinoContainer trino = new TrinoContainer();
+### Testcontainers JDBC URL
- @Test
- public void queryMemoryAndTpchConnectors() throws SQLException {
- try (Connection connection = trino.createConnection();
- Statement statement = connection.createStatement()) {
- // Prepare data
- statement.execute("CREATE TABLE memory.default.table_with_array AS SELECT 1 id, ARRAY[1, 42, 2, 42, 4, 42] my_array");
+`jdbc:tc:trino:352:///defaultname`
- // Query Trino using newly created table and a builtin connector
- try (ResultSet resultSet = statement.executeQuery("" +
- "SELECT nationkey, element " +
- "FROM tpch.tiny.nation " +
- "JOIN memory.default.table_with_array twa ON nationkey = twa.id " +
- "LEFT JOIN UNNEST(my_array) a(element) ON true " +
- "ORDER BY element OFFSET 1 FETCH NEXT 3 ROWS WITH TIES ")) {
- List actualElements = new ArrayList<>();
- while (resultSet.next()) {
- actualElements.add(resultSet.getInt("element"));
- }
- Assert.assertEquals(Arrays.asList(2, 4, 42, 42, 42), actualElements);
- }
- }
- }
-}
-```
+See [JDBC](./jdbc.md) for documentation.
## Adding this module to your project dependencies
@@ -69,14 +24,14 @@ Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:trino:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-trino:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- trino
+ testcontainers-trino{{latest_version}}test
diff --git a/docs/modules/databases/yugabytedb.md b/docs/modules/databases/yugabytedb.md
index 4ab3436b57c..4409712241b 100644
--- a/docs/modules/databases/yugabytedb.md
+++ b/docs/modules/databases/yugabytedb.md
@@ -1,11 +1,11 @@
# YugabyteDB Module
-!!! note
- This module is INCUBATING. While it is ready for use and operational in the current version of Testcontainers, it is possible that it may receive breaking changes in the future. See [our contributing guidelines](/contributing/#incubating-modules) for more information on our incubating modules policy.
+Testcontainers module for [YugabyteDB](https://hub.docker.com/r/yugabytedb/yugabyte)
See [Database containers](./index.md) for documentation and usage that is common to all database container types.
-YugabyteDB supports two APIs.
+YugabyteDB supports two APIs.
+
- Yugabyte Structured Query Language [YSQL](https://docs.yugabyte.com/latest/api/ysql/) is a fully-relational API that is built by the PostgreSQL code
- Yugabyte Cloud Query Language [YCQL](https://docs.yugabyte.com/latest/api/ycql/) is a semi-relational SQL API that has its roots in the Cassandra Query Language
@@ -17,11 +17,11 @@ YugabyteDB supports two APIs.
[Creating a YSQL container](../../../modules/yugabytedb/src/test/java/org/testcontainers/junit/yugabytedb/YugabyteDBYSQLTest.java) inside_block:creatingYSQLContainer
+### Testcontainers JDBC URL
-
-[Starting a YSQL container](../../../modules/yugabytedb/src/test/java/org/testcontainers/junit/yugabytedb/YugabyteDBYSQLTest.java) inside_block:startingYSQLContainer
-
+`jdbc:tc:yugabyte:2.14.4.0-b26:///databasename`
+See [JDBC](./jdbc.md) for documentation.
### YCQL API
@@ -30,24 +30,19 @@ YugabyteDB supports two APIs.
-
-[Starting a YCQL container](../../../modules/yugabytedb/src/test/java/org/testcontainers/junit/yugabytedb/YugabyteDBYCQLTest.java) inside_block:startingYCQLContainer
-
-
-
## Adding this module to your project dependencies
Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:yugabytedb:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-yugabytedb:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- yugabytedb
+ testcontainers-yugabytedb{{latest_version}}test
diff --git a/docs/modules/docker_compose.md b/docs/modules/docker_compose.md
index 10f1aee61aa..3d3d7a510c2 100644
--- a/docs/modules/docker_compose.md
+++ b/docs/modules/docker_compose.md
@@ -2,141 +2,121 @@
## Benefits
-Similar to generic containers support, it's also possible to run a bespoke set of services
-specified in a `docker-compose.yml` file.
+Similar to generic container support, it's also possible to run a bespoke set of services specified in a
+`docker-compose.yml` file.
-This is intended to be useful on projects where Docker Compose is already used in dev or other environments to define
-services that an application may be dependent upon.
+This is especially useful for projects where Docker Compose is already used in development
+or other environments to define services that an application may be dependent upon.
-Behind the scenes, Testcontainers actually launches a temporary Docker Compose client - in a container, of course, so
-it's not necessary to have it installed on all developer/test machines.
+The `ComposeContainer` leverages [Compose V2](https://www.docker.com/blog/announcing-compose-v2-general-availability/),
+making it easy to use the same dependencies from the development environment within tests.
## Example
-A single class rule, pointing to a `docker-compose.yml` file, should be sufficient to launch any number of services
-required by your tests:
-```java
-@ClassRule
-public static DockerComposeContainer environment =
- new DockerComposeContainer(new File("src/test/resources/compose-test.yml"))
- .withExposedService("redis_1", REDIS_PORT)
- .withExposedService("elasticsearch_1", ELASTICSEARCH_PORT);
-```
+A single class `ComposeContainer`, defined based on a `docker-compose.yml` file,
+should be sufficient to launch any number of services required by our tests:
+
+
+[Create a ComposeContainer](../../core/src/test/java/org/testcontainers/junit/ComposeContainerTest.java) inside_block:composeContainerConstructor
+
+
+!!! note
+ Make sure the service names use a `-` rather than `_` as separator.
-In this example, `compose-test.yml` should have content such as:
+In this example, Docker Compose file should have content such as:
```yaml
-redis:
- image: redis
-elasticsearch:
- image: elasticsearch
+services:
+ redis:
+ image: redis
+ db:
+ image: mysql:8.0.36
```
-Note that it is not necessary to define ports to be exposed in the YAML file; this would inhibit reuse/inclusion of the
-file in other contexts.
+Note that it is not necessary to define ports to be exposed in the YAML file,
+as this would inhibit the reuse/inclusion of the file in other contexts.
+
+Instead, Testcontainers will spin up a small `ambassador` container,
+which will proxy between the Compose-managed containers and ports that are accessible to our tests.
+
+## ComposeContainer vs DockerComposeContainer
-Instead, Testcontainers will spin up a small 'ambassador' container, which will proxy
-between the Compose-managed containers and ports that are accessible to your tests. This is done using a separate, minimal
-container that runs socat as a TCP proxy.
+So far, we discussed `ComposeContainer`, which supports docker compose [version 2](https://www.docker.com/blog/announcing-compose-v2-general-availability/).
-## Accessing a container from tests
+On the other hand, `DockerComposeContainer` utilizes Compose V1, which has been marked deprecated by Docker.
-The rule provides methods for discovering how your tests can interact with the containers:
+The two APIs are quite similar, and most examples provided on this page can be applied to both of them.
+
+## Accessing a Container
+
+`ComposeContainer` provides methods for discovering how your tests can interact with the containers:
* `getServiceHost(serviceName, servicePort)` returns the IP address where the container is listening (via an ambassador
container)
* `getServicePort(serviceName, servicePort)` returns the Docker mapped port for a port that has been exposed (via an
ambassador container)
-For example, with the Redis example above, the following will allow your tests to access the Redis service:
-```java
-String redisUrl = environment.getServiceHost("redis_1", REDIS_PORT)
- + ":" +
- environment.getServicePort("redis_1", REDIS_PORT);
-```
+Let's use this API to create the URL that will enable our tests to access the Redis service:
+
+[Access a Service's host and port](../../core/src/test/java/org/testcontainers/junit/ComposeContainerTest.java) inside_block:getServiceHostAndPort
+
-## Startup timeout
+## Wait Strategies and Startup Timeouts
Ordinarily Testcontainers will wait for up to 60 seconds for each exposed container's first mapped network port to start listening.
-
This simple measure provides a basic check whether a container is ready for use.
-There are overloaded `withExposedService` methods that take a `WaitStrategy` so you can specify a timeout strategy per container.
+There are overloaded `withExposedService` methods that take a `WaitStrategy`
+where we can specify a timeout strategy per container.
-### Waiting for startup examples
+We can either use the fluent API to crate a [custom strategy](../features/startup_and_waits.md) or use one of the already existing ones,
+accessible via the static factory methods from of the `Wait` class.
-Waiting for exposed port to start listening:
-```java
-@ClassRule
-public static DockerComposeContainer environment =
- new DockerComposeContainer(new File("src/test/resources/compose-test.yml"))
- .withExposedService("redis_1", REDIS_PORT,
- Wait.forListeningPort().withStartupTimeout(Duration.ofSeconds(30)));
-```
+For instance, we can wait for exposed port and set a custom timeout:
+
+[Wait for the exposed port and use a custom timeout](../../core/src/test/java/org/testcontainers/junit/ComposeContainerWithWaitStrategiesTest.java) inside_block:composeContainerWaitForPortWithTimeout
+
-Wait for arbitrary status codes on an HTTPS endpoint:
-```java
-@ClassRule
-public static DockerComposeContainer environment =
- new DockerComposeContainer(new File("src/test/resources/compose-test.yml"))
- .withExposedService("elasticsearch_1", ELASTICSEARCH_PORT,
- Wait.forHttp("/all")
- .forStatusCode(200)
- .forStatusCode(401)
- .usingTls());
-```
+Needless to say, we can define different strategies for each service in our Docker Compose setup.
-Separate wait strategies for each container:
-```java
-@ClassRule
-public static DockerComposeContainer environment =
- new DockerComposeContainer(new File("src/test/resources/compose-test.yml"))
- .withExposedService("redis_1", REDIS_PORT, Wait.forListeningPort())
- .withExposedService("elasticsearch_1", ELASTICSEARCH_PORT,
- Wait.forHttp("/all")
- .forStatusCode(200)
- .forStatusCode(401)
- .usingTls());
-```
+For example, our Redis container can wait for a successful redis-cli command,
+while our db service waits for a specific log message:
-Alternatively, you can use `waitingFor(serviceName, waitStrategy)`,
-for example if you need to wait on a log message from a service, but don't need to expose a port.
+
+[Wait for a custom command and a log message](../../core/src/test/java/org/testcontainers/junit/ComposeContainerWithWaitStrategiesTest.java) inside_block:composeContainerWithCombinedWaitStrategies
+
-```java
-@ClassRule
-public static DockerComposeContainer environment =
- new DockerComposeContainer(new File("src/test/resources/compose-test.yml"))
- .withExposedService("redis_1", REDIS_PORT, Wait.forListeningPort())
- .waitingFor("db_1", Wait.forLogMessage("started", 1));
-```
-## 'Local compose' mode
-You can override Testcontainers' default behaviour and make it use a `docker-compose` binary installed on the local machine.
-This will generally yield an experience that is closer to running docker-compose locally, with the caveat that Docker Compose needs to be present on dev and CI machines.
-```java
-public static DockerComposeContainer environment =
- new DockerComposeContainer(new File("src/test/resources/compose-test.yml"))
- .withExposedService("redis_1", REDIS_PORT, Wait.forListeningPort())
- .waitingFor("db_1", Wait.forLogMessage("started", 1))
- .withLocalCompose(true);
-```
+## The 'Local Compose' Mode
-## Compose V2
+We can override Testcontainers' default behaviour and make it use a `docker-compose` binary installed on the local machine.
-[Compose V2 is GA](https://www.docker.com/blog/announcing-compose-v2-general-availability/) and it relies on the `docker` command itself instead of `docker-compose`.
-Testcontainers provides `ComposeContainer` if you want to use Compose V2.
+This will generally yield an experience that is closer to running _docker compose_ locally,
+with the caveat that Docker Compose needs to be present on dev and CI machines.
-```java
-public static ComposeContainer environment =
- new ComposeContainer(new File("src/test/resources/compose-test.yml"))
- .withExposedService("redis-1", REDIS_PORT, Wait.forListeningPort())
- .waitingFor("db-1", Wait.forLogMessage("started", 1));
-```
+
+[Use ComposeContainer in 'Local Compose' mode](../../core/src/test/java/org/testcontainers/containers/ComposeProfilesOptionTest.java) inside_block:composeContainerWithLocalCompose
+
+
+## Build Working Directory
+
+We can select what files should be copied only via `withCopyFilesInContainer`:
+
+
+[Use ComposeContainer in 'Local Compose' mode](../../core/src/test/java/org/testcontainers/junit/ComposeContainerWithCopyFilesTest.java) inside_block:composeContainerWithCopyFiles
+
+
+In this example, only docker compose and env files are copied over into the container that will run the Docker Compose file.
+By default, all files in the same directory as the compose file are copied over.
+
+We can use file and directory references.
+They are always resolved relative to the directory where the compose file resides.
!!! note
- Make sure the service name use a `-` instead of `_` as separator using `ComposeContainer`.
+ This can be used with `DockerComposeContainer` and `ComposeContainer`, but **only in the containerized Compose (not with `Local Compose` mode)**.
## Using private repositories in Docker compose
-When Docker Compose is used in container mode (not local), it's needs to be made aware of Docker settings for private repositories.
+When Docker Compose is used in container mode (not local), it needs to be made aware of Docker
+settings for private repositories.
By default, those setting are located in `$HOME/.docker/config.json`.
There are 3 ways to specify location of the `config.json` for Docker Compose:
diff --git a/docs/modules/docker_mcp_gateway.md b/docs/modules/docker_mcp_gateway.md
new file mode 100644
index 00000000000..af526bab3fe
--- /dev/null
+++ b/docs/modules/docker_mcp_gateway.md
@@ -0,0 +1,32 @@
+# Docker MCP Gateway
+
+Testcontainers module for [Docker MCP Gateway](https://hub.docker.com/r/docker/mcp-gateway).
+
+## DockerMcpGatewayContainer's usage examples
+
+You can start a Docker MCP Gateway container instance from any Java application by using:
+
+
+[Create a DockerMcpGatewayContainer](../../core/src/test/java/org/testcontainers/containers/DockerMcpGatewayContainerTest.java) inside_block:container
+
+
+## Adding this module to your project dependencies
+
+*Docker MCP Gateway support is part of the core Testcontainers library.*
+
+Add the following dependency to your `pom.xml`/`build.gradle` file:
+
+=== "Gradle"
+ ```groovy
+ testImplementation "org.testcontainers:testcontainers:{{latest_version}}"
+ ```
+=== "Maven"
+ ```xml
+
+ org.testcontainers
+ testcontainers
+ {{latest_version}}
+ test
+
+ ```
+
diff --git a/docs/modules/docker_model_runner.md b/docs/modules/docker_model_runner.md
new file mode 100644
index 00000000000..b610279e93b
--- /dev/null
+++ b/docs/modules/docker_model_runner.md
@@ -0,0 +1,41 @@
+# Docker Model Runner
+
+This module helps connect to [Docker Model Runner](https://docs.docker.com/desktop/features/model-runner/)
+provided by Docker Desktop 4.40.0.
+
+## DockerModelRunner's usage examples
+
+You can start a Docker Model Runner proxy container instance from any Java application by using:
+
+
+[Create a DockerModelRunnerContainer](../../core/src/test/java/org/testcontainers/containers/DockerModelRunnerContainerTest.java) inside_block:container
+
+
+### Pulling the model
+
+Pulling the model is as simple as:
+
+
+[Pull model](../../core/src/test/java/org/testcontainers/containers/DockerModelRunnerContainerTest.java) inside_block:pullModel
+
+
+## Adding this module to your project dependencies
+
+*Docker Model Runner support is part of the core Testcontainers library.*
+
+Add the following dependency to your `pom.xml`/`build.gradle` file:
+
+=== "Gradle"
+ ```groovy
+ testImplementation "org.testcontainers:testcontainers:{{latest_version}}"
+ ```
+=== "Maven"
+ ```xml
+
+ org.testcontainers
+ testcontainers
+ {{latest_version}}
+ test
+
+ ```
+
diff --git a/docs/modules/elasticsearch.md b/docs/modules/elasticsearch.md
index 3372d2fdea0..5817a21de02 100644
--- a/docs/modules/elasticsearch.md
+++ b/docs/modules/elasticsearch.md
@@ -10,7 +10,9 @@ Note that it's based on the [official Docker image](https://www.elastic.co/guide
You can start an elasticsearch container instance from any Java application by using:
-[HttpClient](../../modules/elasticsearch/src/test/java/org/testcontainers/elasticsearch/ElasticsearchContainerTest.java) inside_block:httpClientContainer
+[HttpClient](../../modules/elasticsearch/src/test/java/org/testcontainers/elasticsearch/ElasticsearchContainerTest.java) inside_block:httpClientContainer7
+[HttpClient with Elasticsearch 8](../../modules/elasticsearch/src/test/java/org/testcontainers/elasticsearch/ElasticsearchContainerTest.java) inside_block:httpClientContainer8
+[HttpClient with Elasticsearch 8 and SSL disabled](../../modules/elasticsearch/src/test/java/org/testcontainers/elasticsearch/ElasticsearchContainerTest.java) inside_block:httpClientContainerNoSSL8
[TransportClient](../../modules/elasticsearch/src/test/java/org/testcontainers/elasticsearch/ElasticsearchContainerTest.java) inside_block:transportClientContainer
@@ -28,20 +30,47 @@ You can turn on security by providing a password:
[HttpClient](../../modules/elasticsearch/src/test/java/org/testcontainers/elasticsearch/ElasticsearchContainerTest.java) inside_block:httpClientSecuredContainer
+## Kibana container
+
+This module also provides a `KibanaContainer` for testing with [Kibana](https://www.elastic.co/kibana).
+Kibana requires a connection to Elasticsearch and `KibanaContainer` supports two modes: managed and external.
+
+### Managed mode
+
+In managed mode, `KibanaContainer` automatically connects to an `ElasticsearchContainer`:
+
+
+[Kibana with Elasticsearch](../../modules/elasticsearch/src/test/java/org/testcontainers/elasticsearch/KibanaContainerTest.java) inside_block:managedModeCanStartAndReachElasticsearchInSameExplicitNetwork
+
+
+When using managed mode with explicit networks, both containers must share the same `Network` instance.
+Alternatively, you can omit the network configuration entirely, and `KibanaContainer` will do its best effort to create a shared, ad-hoc network automatically.
+
+### External mode
+
+In external mode, `KibanaContainer` connects to an external Elasticsearch instance via URL and using provided credentials:
+
+
+[Kibana with external Elasticsearch](../../modules/elasticsearch/src/test/java/org/testcontainers/elasticsearch/KibanaContainerTest.java) inside_block:externalModeCanWorkWithUsernamePassword
+
+
+For external mode with HTTPS, use `withElasticsearchCaCertificate()` to provide the CA certificate.
+You can authenticate using either username/password (`withElasticsearchCredentials()`) or service account tokens (`withElasticsearchServiceAccountToken()`).
+
## Adding this module to your project dependencies
Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:elasticsearch:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-elasticsearch:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- elasticsearch
+ testcontainers-elasticsearch{{latest_version}}test
diff --git a/docs/modules/gcloud.md b/docs/modules/gcloud.md
index 31542a5d387..9660461d5a0 100644
--- a/docs/modules/gcloud.md
+++ b/docs/modules/gcloud.md
@@ -23,11 +23,11 @@ PubSubEmulatorContainer | [gcr.io/google.com/cloudsdktool/google-cloud-cli:emula
Start BigQuery Emulator during a test:
-[Starting a BigQuery Emulator container](../../modules/gcloud/src/test/java/org/testcontainers/containers/BigQueryEmulatorContainerTest.java) inside_block:emulatorContainer
+[Starting a BigQuery Emulator container](../../modules/gcloud/src/test/java/org/testcontainers/gcloud/BigQueryEmulatorContainerTest.java) inside_block:emulatorContainer
-[Creating BigQuery Client](../../modules/gcloud/src/test/java/org/testcontainers/containers/BigQueryEmulatorContainerTest.java) inside_block:bigQueryClient
+[Creating BigQuery Client](../../modules/gcloud/src/test/java/org/testcontainers/gcloud/BigQueryEmulatorContainerTest.java) inside_block:bigQueryClient
### Bigtable
@@ -35,19 +35,19 @@ Start BigQuery Emulator during a test:
Start Bigtable Emulator during a test:
-[Starting a Bigtable Emulator container](../../modules/gcloud/src/test/java/org/testcontainers/containers/BigtableEmulatorContainerTest.java) inside_block:emulatorContainer
+[Starting a Bigtable Emulator container](../../modules/gcloud/src/test/java/org/testcontainers/gcloud/BigtableEmulatorContainerTest.java) inside_block:emulatorContainer
Create a test Bigtable table in the Emulator:
-[Create a test table](../../modules/gcloud/src/test/java/org/testcontainers/containers/BigtableEmulatorContainerTest.java) inside_block:createTable
+[Create a test table](../../modules/gcloud/src/test/java/org/testcontainers/gcloud/BigtableEmulatorContainerTest.java) inside_block:createTable
Test against the Emulator:
-[Testing with a Bigtable Emulator container](../../modules/gcloud/src/test/java/org/testcontainers/containers/BigtableEmulatorContainerTest.java) inside_block:testWithEmulatorContainer
+[Testing with a Bigtable Emulator container](../../modules/gcloud/src/test/java/org/testcontainers/gcloud/BigtableEmulatorContainerTest.java) inside_block:testWithEmulatorContainer
### Datastore
@@ -55,18 +55,18 @@ Test against the Emulator:
Start Datastore Emulator during a test:
-[Starting a Datastore Emulator container](../../modules/gcloud/src/test/java/org/testcontainers/containers/DatastoreEmulatorContainerTest.java) inside_block:creatingDatastoreEmulatorContainer
+[Starting a Datastore Emulator container](../../modules/gcloud/src/test/java/org/testcontainers/gcloud/DatastoreEmulatorContainerTest.java) inside_block:creatingDatastoreEmulatorContainer
And test against the Emulator:
-[Testing with a Datastore Emulator container](../../modules/gcloud/src/test/java/org/testcontainers/containers/DatastoreEmulatorContainerTest.java) inside_block:startingDatastoreEmulatorContainer
+[Testing with a Datastore Emulator container](../../modules/gcloud/src/test/java/org/testcontainers/gcloud/DatastoreEmulatorContainerTest.java) inside_block:startingDatastoreEmulatorContainer
See more examples:
- * [Full sample code](https://github.com/testcontainers/testcontainers-java/tree/main/modules/gcloud/src/test/java/org/testcontainers/containers/DatastoreEmulatorContainerTest.java)
+ * [Full sample code](https://github.com/testcontainers/testcontainers-java/tree/main/modules/gcloud/src/test/java/org/testcontainers/gcloud/DatastoreEmulatorContainerTest.java)
* [With Spring Boot](https://github.com/saturnism/testcontainers-gcloud-examples/tree/main/springboot/datastore-example/src/test/java/com/example/springboot/datastore)
### Firestore
@@ -74,18 +74,18 @@ See more examples:
Start Firestore Emulator during a test:
-[Starting a Firestore Emulator container](../../modules/gcloud/src/test/java/org/testcontainers/containers/FirestoreEmulatorContainerTest.java) inside_block:emulatorContainer
+[Starting a Firestore Emulator container](../../modules/gcloud/src/test/java/org/testcontainers/gcloud/FirestoreEmulatorContainerTest.java) inside_block:emulatorContainer
And test against the Emulator:
-[Testing with a Firestore Emulator container](../../modules/gcloud/src/test/java/org/testcontainers/containers/FirestoreEmulatorContainerTest.java) inside_block:testWithEmulatorContainer
+[Testing with a Firestore Emulator container](../../modules/gcloud/src/test/java/org/testcontainers/gcloud/FirestoreEmulatorContainerTest.java) inside_block:testWithEmulatorContainer
See more examples:
- * [Full sample code](https://github.com/testcontainers/testcontainers-java/tree/main/modules/gcloud/src/test/java/org/testcontainers/containers/FirestoreEmulatorContainerTest.java)
+ * [Full sample code](https://github.com/testcontainers/testcontainers-java/tree/main/modules/gcloud/src/test/java/org/testcontainers/gcloud/FirestoreEmulatorContainerTest.java)
* [With Spring Boot](https://github.com/saturnism/testcontainers-gcloud-examples/tree/main/springboot/firestore-example/src/test/java/com/example/springboot/firestore/FirestoreIntegrationTests.java)
### Spanner
@@ -93,30 +93,30 @@ See more examples:
Start Spanner Emulator during a test:
-[Starting a Spanner Emulator container](../../modules/gcloud/src/test/java/org/testcontainers/containers/SpannerEmulatorContainerTest.java) inside_block:emulatorContainer
+[Starting a Spanner Emulator container](../../modules/gcloud/src/test/java/org/testcontainers/gcloud/SpannerEmulatorContainerTest.java) inside_block:emulatorContainer
Create a test Spanner Instance in the Emulator:
-[Create a test Spanner instance](../../modules/gcloud/src/test/java/org/testcontainers/containers/SpannerEmulatorContainerTest.java) inside_block:createInstance
+[Create a test Spanner instance](../../modules/gcloud/src/test/java/org/testcontainers/gcloud/SpannerEmulatorContainerTest.java) inside_block:createInstance
Create a test Database in the Emulator:
-[Creating a test Spanner database](../../modules/gcloud/src/test/java/org/testcontainers/containers/SpannerEmulatorContainerTest.java) inside_block:createDatabase
+[Creating a test Spanner database](../../modules/gcloud/src/test/java/org/testcontainers/gcloud/SpannerEmulatorContainerTest.java) inside_block:createDatabase
And test against the Emulator:
-[Testing with a Firestore Emulator container](../../modules/gcloud/src/test/java/org/testcontainers/containers/SpannerEmulatorContainerTest.java) inside_block:testWithEmulatorContainer
+[Testing with a Spanner Emulator container](../../modules/gcloud/src/test/java/org/testcontainers/gcloud/SpannerEmulatorContainerTest.java) inside_block:testWithEmulatorContainer
See more examples:
- * [Full sample code](https://github.com/testcontainers/testcontainers-java/tree/main/modules/gcloud/src/test/java/org/testcontainers/containers/SpannerEmulatorContainerTest.java)
+ * [Full sample code](https://github.com/testcontainers/testcontainers-java/tree/main/modules/gcloud/src/test/java/org/testcontainers/gcloud/SpannerEmulatorContainerTest.java)
* [With Spring Boot](https://github.com/saturnism/testcontainers-gcloud-examples/tree/main/springboot/spanner-example/src/test/java/com/example/springboot/spanner/SpannerIntegrationTests.java)
### Pub/Sub
@@ -124,30 +124,30 @@ See more examples:
Start Pub/Sub Emulator during a test:
-[Starting a Pub/Sub Emulator container](../../modules/gcloud/src/test/java/org/testcontainers/containers/PubSubEmulatorContainerTest.java) inside_block:emulatorContainer
+[Starting a Pub/Sub Emulator container](../../modules/gcloud/src/test/java/org/testcontainers/gcloud/PubSubEmulatorContainerTest.java) inside_block:emulatorContainer
Create a test Pub/Sub topic in the Emulator:
-[Create a test topic](../../modules/gcloud/src/test/java/org/testcontainers/containers/PubSubEmulatorContainerTest.java) inside_block:createTopic
+[Create a test topic](../../modules/gcloud/src/test/java/org/testcontainers/gcloud/PubSubEmulatorContainerTest.java) inside_block:createTopic
Create a test Pub/Sub subscription in the Emulator:
-[Create a test subscription](../../modules/gcloud/src/test/java/org/testcontainers/containers/PubSubEmulatorContainerTest.java) inside_block:createSubscription
+[Create a test subscription](../../modules/gcloud/src/test/java/org/testcontainers/gcloud/PubSubEmulatorContainerTest.java) inside_block:createSubscription
And test against the Emulator:
-[Testing with a Pub/Sub Emulator container](../../modules/gcloud/src/test/java/org/testcontainers/containers/PubSubEmulatorContainerTest.java) inside_block:testWithEmulatorContainer
+[Testing with a Pub/Sub Emulator container](../../modules/gcloud/src/test/java/org/testcontainers/gcloud/PubSubEmulatorContainerTest.java) inside_block:testWithEmulatorContainer
See more examples:
- * [Full sample code](https://github.com/testcontainers/testcontainers-java/tree/main/modules/gcloud/src/test/java/org/testcontainers/containers/PubSubEmulatorContainerTest.java)
+ * [Full sample code](https://github.com/testcontainers/testcontainers-java/tree/main/modules/gcloud/src/test/java/org/testcontainers/gcloud/PubSubEmulatorContainerTest.java)
* [With Spring Boot](https://github.com/saturnism/testcontainers-gcloud-examples/tree/main/springboot/pubsub-example/src/test/java/com/example/springboot/pubsub/PubSubIntegrationTests.java)
## Adding this module to your project dependencies
@@ -156,13 +156,13 @@ Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:gcloud:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-gcloud:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- gcloud
+ testcontainers-gcloud{{latest_version}}test
diff --git a/docs/modules/grafana.md b/docs/modules/grafana.md
new file mode 100644
index 00000000000..397ade89ee3
--- /dev/null
+++ b/docs/modules/grafana.md
@@ -0,0 +1,30 @@
+# Grafana
+
+Testcontainers module for [Grafana OTel LGTM](https://hub.docker.com/r/grafana/otel-lgtm).
+
+## LGTM's usage examples
+
+You can start a Grafana OTel LGTM container instance from any Java application by using:
+
+
+[Grafana Otel LGTM container](../../modules/grafana/src/test/java/org/testcontainers/grafana/LgtmStackContainerTest.java) inside_block:container
+
+
+## Adding this module to your project dependencies
+
+Add the following dependency to your `pom.xml`/`build.gradle` file:
+
+=== "Gradle"
+ ```groovy
+ testImplementation "org.testcontainers:testcontainers-grafana:{{latest_version}}"
+ ```
+
+=== "Maven"
+ ```xml
+
+ org.testcontainers
+ testcontainers-grafana
+ {{latest_version}}
+ test
+
+ ```
diff --git a/docs/modules/hivemq.md b/docs/modules/hivemq.md
index 2ebdd7a9ad8..8bba4c18b36 100644
--- a/docs/modules/hivemq.md
+++ b/docs/modules/hivemq.md
@@ -1,8 +1,8 @@
# HiveMQ Module
-
+
-Automatic starting HiveMQ docker containers for JUnit4 and JUnit5 tests.
+Automatic starting HiveMQ docker containers for JUnit5 tests.
This enables testing MQTT client applications and integration testing of custom HiveMQ extensions.
- Community forum: https://community.hivemq.com/
@@ -212,13 +212,13 @@ can be customized as desired.
Add to `build.gradle`:
````groovy
-testImplementation 'org.testcontainers:hivemq:{{latest_version}}'
+testImplementation 'org.testcontainers:testcontainers-hivemq:{{latest_version}}'
````
Add to `build.gradle.kts`:
````kotlin
-testImplementation("org.testcontainers:hivemq:{{latest_version}}")
+testImplementation("org.testcontainers:testcontainers-hivemq:{{latest_version}}")
````
### Maven
@@ -228,7 +228,7 @@ Add to `pom.xml`:
```xml
org.testcontainers
- hivemq
+ testcontainers-hivemq{{latest_version}}test
diff --git a/docs/modules/k3s.md b/docs/modules/k3s.md
index 2df695b1c1e..a9de1b3fd4f 100644
--- a/docs/modules/k3s.md
+++ b/docs/modules/k3s.md
@@ -44,13 +44,13 @@ Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:k3s:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-k3s:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- k3s
+ testcontainers-k3s{{latest_version}}test
diff --git a/docs/modules/k6.md b/docs/modules/k6.md
new file mode 100644
index 00000000000..13e0ddc9252
--- /dev/null
+++ b/docs/modules/k6.md
@@ -0,0 +1,50 @@
+# k6 Module
+
+!!! note
+ This module is INCUBATING.
+ While it is ready for use and operational in the current version of Testcontainers, it is possible that it may receive breaking changes in the future.
+ See [our contributing guidelines](/contributing/#incubating-modules) for more information on our incubating modules policy.
+
+Testcontainers module for [k6](https://registry.hub.docker.com/r/grafana/k6).
+
+[k6](https://k6.io/) is an extensible reliability testing tool built for developer happiness.
+
+## Basic script execution
+
+You can start a K6 container instance from any Java application by using:
+
+
+[Setup the container](../../modules/k6/src/test/java/org/testcontainers/k6/K6ContainerTests.java) inside_block:standard_k6
+
+
+The test above uses a simple k6 script, `test.js`, with command line options and an injected script variable.
+
+Once the container is started, you can wait for the test results to be collected:
+
+
+[Wait for test results](../../modules/k6/src/test/java/org/testcontainers/k6/K6ContainerTests.java) inside_block:wait
+
+
+Create a simple k6 test script to be executed as part of your tests:
+
+
+[Content of `scripts/test.js`](../../modules/k6/src/test/resources/scripts/test.js) inside_block:access_script_vars
+
+
+## Adding this module to your project dependencies
+
+Add the following dependency to your `pom.xml`/`build.gradle` file:
+
+=== "Gradle"
+ ```groovy
+ testImplementation "org.testcontainers:testcontainers-k6:{{latest_version}}"
+ ```
+=== "Maven"
+ ```xml
+
+ org.testcontainers
+ testcontainers-k6
+ {{latest_version}}
+ test
+
+ ```
diff --git a/docs/modules/kafka.md b/docs/modules/kafka.md
index fb953716225..cb2906265d0 100644
--- a/docs/modules/kafka.md
+++ b/docs/modules/kafka.md
@@ -1,55 +1,71 @@
-# Kafka Containers
+# Kafka Module
Testcontainers can be used to automatically instantiate and manage [Apache Kafka](https://kafka.apache.org) containers.
-More precisely Testcontainers uses the official Docker images for [Confluent OSS Platform](https://hub.docker.com/r/confluentinc/cp-kafka/)
+
+Currently, two different Kafka images are supported:
+
+* `org.testcontainers.kafka.ConfluentKafkaContainer` supports
+[confluentinc/cp-kafka](https://hub.docker.com/r/confluentinc/cp-kafka/)
+* `org.testcontainers.kafka.KafkaContainer` supports [apache/kafka](https://hub.docker.com/r/apache/kafka/) and [apache/kafka-native](https://hub.docker.com/r/apache/kafka-native/)
+
+!!! note
+ `org.testcontainers.containers.KafkaContainer` is deprecated.
+ Please use `org.testcontainers.kafka.ConfluentKafkaContainer` or `org.testcontainers.kafka.KafkaContainer` instead, depending on the used image.
## Benefits
* Running a single node Kafka installation with just one line of code
-* No need to manage external Zookeeper installation, required by Kafka. But see [below](#zookeeper)
+* No need to manage external Zookeeper installation, required by Kafka.
## Example
+### Using org.testcontainers.kafka.KafkaContainer
+
Create a `KafkaContainer` to use it in your tests:
+
-[Creating a KafkaContainer](../../modules/kafka/src/test/java/org/testcontainers/containers/KafkaContainerTest.java) inside_block:constructorWithVersion
+[Creating a KafkaContainer](../../modules/kafka/src/test/java/org/testcontainers/kafka/KafkaContainerTest.java) inside_block:constructorWithVersion
-The correspondence between Confluent Platform versions and Kafka versions can be seen [in Confluent documentation](https://docs.confluent.io/current/installation/versions-interoperability.html#cp-and-apache-kafka-compatibility)
-
Now your tests or any other process running on your machine can get access to running Kafka broker by using the following bootstrap server location:
[Bootstrap Servers](../../modules/kafka/src/test/java/org/testcontainers/containers/KafkaContainerTest.java) inside_block:getBootstrapServers
-## Options
-
-### Using external Zookeeper
+### Using org.testcontainers.kafka.ConfluentKafkaContainer
+
+!!! note
+ Compatible with `confluentinc/cp-kafka` images version `7.4.0` and later.
+
+Create a `ConfluentKafkaContainer` to use it in your tests:
-If for some reason you want to use an externally running Zookeeper, then just pass its location during construction:
-[External Zookeeper](../../modules/kafka/src/test/java/org/testcontainers/containers/KafkaContainerTest.java) inside_block:withExternalZookeeper
+[Creating a ConfluentKafkaContainer](../../modules/kafka/src/test/java/org/testcontainers/kafka/ConfluentKafkaContainerTest.java) inside_block:constructorWithVersion
+## Options
+
### Using Kraft mode
-KRaft mode was declared production ready in 3.3.1 (confluentinc/cp-kafka:7.3.x)"
+!!! note
+ Only available for `org.testcontainers.containers.KafkaContainer`
+
+KRaft mode was declared production ready in 3.3.1 (confluentinc/cp-kafka:7.3.x)
[Kraft mode](../../modules/kafka/src/test/java/org/testcontainers/containers/KafkaContainerTest.java) inside_block:withKraftMode
-See the [versions interoperability matrix](https://docs.confluent.io/platform/current/installation/versions-interoperability.html) for more details.
+See the [versions interoperability matrix](https://docs.confluent.io/platform/current/installation/versions-interoperability.html) for more details.
-## Register listeners
+### Register listeners
There are scenarios where additional listeners are needed because the consumer/producer can be in another
-container in the same network or a different process where the port to connect differs from the default
-exposed port `9093`. E.g [Toxiproxy](../../modules/toxiproxy/).
+container in the same network or a different process where the port to connect differs from the default exposed port. E.g [Toxiproxy](../../modules/toxiproxy/).
-[Register additional listener](../../modules/kafka/src/test/java/org/testcontainers/containers/KafkaContainerTest.java) inside_block:registerListener
+[Register additional listener](../../modules/kafka/src/test/java/org/testcontainers/kafka/KafkaContainerTest.java) inside_block:registerListener
Container defined in the same network:
@@ -70,13 +86,13 @@ Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:kafka:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-kafka:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- kafka
+ testcontainers-kafka{{latest_version}}test
diff --git a/docs/modules/ldap.md b/docs/modules/ldap.md
new file mode 100644
index 00000000000..c84469f22ae
--- /dev/null
+++ b/docs/modules/ldap.md
@@ -0,0 +1,30 @@
+# LDAP
+
+Testcontainers module for [LLDAP](https://hub.docker.com/r/lldap/lldap).
+
+## LLdapContainer's usage examples
+
+You can start a LLDAP container instance from any Java application by using:
+
+
+[LLDAP container](../../modules/ldap/src/test/java/org/testcontainers/ldap/LLdapContainerTest.java) inside_block:container
+
+
+## Adding this module to your project dependencies
+
+Add the following dependency to your `pom.xml`/`build.gradle` file:
+
+=== "Gradle"
+ ```groovy
+ testImplementation "org.testcontainers:testcontainers-ldap:{{latest_version}}"
+ ```
+
+=== "Maven"
+ ```xml
+
+ org.testcontainers
+ testcontainers-ldap
+ {{latest_version}}
+ test
+
+ ```
diff --git a/docs/modules/localstack.md b/docs/modules/localstack.md
index b6c82ccf67a..ca51979f5a0 100644
--- a/docs/modules/localstack.md
+++ b/docs/modules/localstack.md
@@ -4,48 +4,26 @@ Testcontainers module for [LocalStack](http://localstack.cloud/), 'a fully funct
## Usage example
-Running LocalStack as a stand-in for AWS S3 during a test:
-
-```java
-DockerImageName localstackImage = DockerImageName.parse("localstack/localstack:0.11.3");
-
-@Rule
-public LocalStackContainer localstack = new LocalStackContainer(localstackImage)
- .withServices(S3);
-```
-
-## Creating a client using AWS SDK
-
-
-[AWS SDK V1](../../modules/localstack/src/test/java/org/testcontainers/containers/localstack/LocalstackContainerTest.java) inside_block:with_aws_sdk_v1
-
+You can start a LocalStack container instance from any Java application by using:
-[AWS SDK V2](../../modules/localstack/src/test/java/org/testcontainers/containers/localstack/LocalstackContainerTest.java) inside_block:with_aws_sdk_v2
+[Container creation](../../modules/localstack/src/test/java/org/testcontainers/localstack/LocalStackContainerTest.java) inside_block:container
-Environment variables listed in [Localstack's README](https://github.com/localstack/localstack#configurations) may be used to customize Localstack's configuration.
+Environment variables listed in the [LocalStack configuration documentation](https://docs.localstack.cloud/references/configuration/) may be used to customize LocalStack's configuration.
Use the `.withEnv(key, value)` method on `LocalStackContainer` to apply configuration settings.
-## `HOSTNAME_EXTERNAL` and hostname-sensitive services
+!!! note
+ Starting March 23, 2026, `localstack/localstack` requires authentication via a `LOCALSTACK_AUTH_TOKEN` environment variable. Without it, the container will fail to start.
-Some Localstack APIs, such as SQS, require the container to be aware of the hostname that it is accessible on - for example, for construction of queue URLs in responses.
+ Use `.withEnv("LOCALSTACK_AUTH_TOKEN", System.getenv("LOCALSTACK_AUTH_TOKEN"))` to pass the token.
+ See the [LocalStack blog post](https://blog.localstack.cloud/localstack-single-image-next-steps/) for more details.
-Testcontainers will inform Localstack of the best hostname automatically, using the `HOSTNAME_EXTERNAL` environment variable:
-
-* when running the Localstack container directly without a custom network defined, it is expected that all calls to the container will be from the test host. As such, the container address will be used (typically localhost or the address where the Docker daemon is running).
-
-
- [Localstack container running without a custom network](../../modules/localstack/src/test/java/org/testcontainers/containers/localstack/LocalstackContainerTest.java) inside_block:without_network
-
-
-* when running the Localstack container [with a custom network defined](/features/networking/#advanced-networking), it is expected that all calls to the container will be **from other containers on that network**. `HOSTNAME_EXTERNAL` will be set to the *last* network alias that has been configured for the Localstack container.
-
-
- [Localstack container running with a custom network](../../modules/localstack/src/test/java/org/testcontainers/containers/localstack/LocalstackContainerTest.java) inside_block:with_network
-
+## Creating a client using AWS SDK
-* Other usage scenarios, such as where the Localstack container is used from both the test host and containers on a custom network are not automatically supported. If you have this use case, you should set `HOSTNAME_EXTERNAL` manually.
+
+[AWS SDK V2](../../modules/localstack/src/test/java/org/testcontainers/localstack/LocalStackContainerTest.java) inside_block:with_aws_sdk_v2
+
## Adding this module to your project dependencies
@@ -53,13 +31,13 @@ Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:localstack:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-localstack:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- localstack
+ testcontainers-localstack{{latest_version}}test
diff --git a/docs/modules/milvus.md b/docs/modules/milvus.md
new file mode 100644
index 00000000000..96772560f80
--- /dev/null
+++ b/docs/modules/milvus.md
@@ -0,0 +1,36 @@
+# Milvus
+
+Testcontainers module for [Milvus](https://hub.docker.com/r/milvusdb/milvus).
+
+## Milvus's usage examples
+
+You can start a Milvus container instance from any Java application by using:
+
+
+[Default config](../../modules/milvus/src/test/java/org/testcontainers/milvus/MilvusContainerTest.java) inside_block:milvusContainer
+
+
+With external Etcd:
+
+
+[External Etcd](../../modules/milvus/src/test/java/org/testcontainers/milvus/MilvusContainerTest.java) inside_block:externalEtcd
+
+
+## Adding this module to your project dependencies
+
+Add the following dependency to your `pom.xml`/`build.gradle` file:
+
+=== "Gradle"
+ ```groovy
+ testImplementation "org.testcontainers:testcontainers-milvus:{{latest_version}}"
+ ```
+
+=== "Maven"
+ ```xml
+
+ org.testcontainers
+ testcontainers-milvus
+ {{latest_version}}
+ test
+
+ ```
diff --git a/docs/modules/minio.md b/docs/modules/minio.md
index 2b872682ebe..165f760425c 100644
--- a/docs/modules/minio.md
+++ b/docs/modules/minio.md
@@ -25,14 +25,14 @@ Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:minio:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-minio:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- minio
+ testcontainers-minio{{latest_version}}test
diff --git a/docs/modules/mockserver.md b/docs/modules/mockserver.md
index c739278acff..e6a0ee91ece 100644
--- a/docs/modules/mockserver.md
+++ b/docs/modules/mockserver.md
@@ -7,13 +7,13 @@ Mock Server can be used to mock HTTP services by matching requests against user-
The following example shows how to start Mockserver.
-[Creating a MockServer container](../../modules/mockserver/src/test/java/org/testcontainers/containers/MockServerContainerRuleTest.java) inside_block:creatingProxy
+[Creating a MockServer container](../../modules/mockserver/src/test/java/org/testcontainers/mockserver/MockServerContainerTest.java) inside_block:creatingProxy
And how to set a simple expectation using the Java MockServerClient.
-[Setting a simple expectation](../../modules/mockserver/src/test/java/org/testcontainers/containers/MockServerContainerRuleTest.java) inside_block:testSimpleExpectation
+[Setting a simple expectation](../../modules/mockserver/src/test/java/org/testcontainers/mockserver/MockServerContainerTest.java) inside_block:testSimpleExpectation
## Adding this module to your project dependencies
@@ -22,13 +22,13 @@ Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:mockserver:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-mockserver:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- mockserver
+ testcontainers-mockserver{{latest_version}}test
diff --git a/docs/modules/nginx.md b/docs/modules/nginx.md
index fb4270ba4a3..6fcdbdaf13f 100644
--- a/docs/modules/nginx.md
+++ b/docs/modules/nginx.md
@@ -7,19 +7,19 @@ Nginx is a web server, reverse proxy and mail proxy and http cache.
The following example shows how to start Nginx.
-[Creating a Nginx container](../../modules/nginx/src/test/java/org/testcontainers/junit/SimpleNginxTest.java) inside_block:creatingContainer
+[Creating a Nginx container](../../modules/nginx/src/test/java/org/testcontainers/nginx/NginxContainerTest.java) inside_block:creatingContainer
How to add custom content to the Nginx server.
-[Creating the static content to serve](../../modules/nginx/src/test/java/org/testcontainers/junit/SimpleNginxTest.java) inside_block:addCustomContent
+[Creating the static content to serve](../../modules/nginx/src/test/java/org/testcontainers/nginx/NginxContainerTest.java) inside_block:addCustomContent
And how to query the Nginx server for the custom content added.
-[Creating the static content to serve](../../modules/nginx/src/test/java/org/testcontainers/junit/SimpleNginxTest.java) inside_block:getFromNginxServer
+[Creating the static content to serve](../../modules/nginx/src/test/java/org/testcontainers/nginx/NginxContainerTest.java) inside_block:getFromNginxServer
## Adding this module to your project dependencies
@@ -28,13 +28,13 @@ Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:nginx:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-nginx:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- nginx
+ testcontainers-nginx{{latest_version}}test
diff --git a/docs/modules/ollama.md b/docs/modules/ollama.md
new file mode 100644
index 00000000000..56c1574d4db
--- /dev/null
+++ b/docs/modules/ollama.md
@@ -0,0 +1,52 @@
+# Ollama
+
+Testcontainers module for [Ollama](https://hub.docker.com/r/ollama/ollama) .
+
+## Ollama's usage examples
+
+You can start an Ollama container instance from any Java application by using:
+
+
+[Ollama container](../../modules/ollama/src/test/java/org/testcontainers/ollama/OllamaContainerTest.java) inside_block:container
+
+
+### Pulling the model
+
+Testcontainers allows [executing commands in the container](../features/commands.md). So, pulling the model is as simple as:
+
+
+[Pull model](../../modules/ollama/src/test/java/org/testcontainers/ollama/OllamaContainerTest.java) inside_block:pullModel
+
+
+### Create a new Image
+
+In order to create a new image that contains the model, you can use the following code:
+
+
+[Commit Image](../../modules/ollama/src/test/java/org/testcontainers/ollama/OllamaContainerTest.java) inside_block:commitToImage
+
+
+And use the new image along with [Image name Substitution](../features/image_name_substitution.md#manual-substitution)
+
+
+[Use new Image](../../modules/ollama/src/test/java/org/testcontainers/ollama/OllamaContainerTest.java) inside_block:substitute
+
+
+## Adding this module to your project dependencies
+
+Add the following dependency to your `pom.xml`/`build.gradle` file:
+
+=== "Gradle"
+ ```groovy
+ testImplementation "org.testcontainers:testcontainers-ollama:{{latest_version}}"
+ ```
+
+=== "Maven"
+ ```xml
+
+ org.testcontainers
+ testcontainers-ollama
+ {{latest_version}}
+ test
+
+ ```
diff --git a/docs/modules/openfga.md b/docs/modules/openfga.md
new file mode 100644
index 00000000000..4d916ce6aa6
--- /dev/null
+++ b/docs/modules/openfga.md
@@ -0,0 +1,30 @@
+# OpenFGA
+
+Testcontainers module for [OpenFGA](https://hub.docker.com/r/openfga/openfga).
+
+## OpenFGAContainer's usage examples
+
+You can start an OpenFGA container instance from any Java application by using:
+
+
+[OpenFGA container](../../modules/openfga/src/test/java/org/testcontainers/openfga/OpenFGAContainerTest.java) inside_block:container
+
+
+## Adding this module to your project dependencies
+
+Add the following dependency to your `pom.xml`/`build.gradle` file:
+
+=== "Gradle"
+ ```groovy
+ testImplementation "org.testcontainers:testcontainers-openfga:{{latest_version}}"
+ ```
+
+=== "Maven"
+ ```xml
+
+ org.testcontainers
+ testcontainers-openfga
+ {{latest_version}}
+ test
+
+ ```
diff --git a/docs/modules/pinecone.md b/docs/modules/pinecone.md
new file mode 100644
index 00000000000..6bcea81ab39
--- /dev/null
+++ b/docs/modules/pinecone.md
@@ -0,0 +1,30 @@
+# Pinecone
+
+Testcontainers module for [Pinecone Local](https://github.com/orgs/pinecone-io/packages/container/package/pinecone-local).
+
+## PineconeLocalContainer's usage examples
+
+You can start a Pinecone container instance from any Java application by using:
+
+
+[Pinecone container](../../modules/pinecone/src/test/java/org/testcontainers/pinecone/PineconeLocalContainerTest.java) inside_block:container
+
+
+## Adding this module to your project dependencies
+
+Add the following dependency to your `pom.xml`/`build.gradle` file:
+
+=== "Gradle"
+```groovy
+testImplementation "org.testcontainers:testcontainers-pinecone:{{latest_version}}"
+```
+
+=== "Maven"
+```xml
+
+ org.testcontainers
+ testcontainers-pinecone
+ {{latest_version}}
+ test
+
+```
diff --git a/docs/modules/pulsar.md b/docs/modules/pulsar.md
index f74c315cbdc..5bd33b0bc4c 100644
--- a/docs/modules/pulsar.md
+++ b/docs/modules/pulsar.md
@@ -9,13 +9,13 @@ It's based on the official Apache Pulsar docker image, it is recommended to read
Create a `PulsarContainer` to use it in your tests:
-[Create a Pulsar container](../../modules/pulsar/src/test/java/org/testcontainers/containers/PulsarContainerTest.java) inside_block:constructorWithVersion
+[Create a Pulsar container](../../modules/pulsar/src/test/java/org/testcontainers/pulsar/PulsarContainerTest.java) inside_block:constructorWithVersion
Then you can retrieve the broker and the admin url:
-[Get broker and admin urls](../../modules/pulsar/src/test/java/org/testcontainers/containers/PulsarContainerTest.java) inside_block:coordinates
+[Get broker and admin urls](../../modules/pulsar/src/test/java/org/testcontainers/pulsar/PulsarContainerTest.java) inside_block:coordinates
## Options
@@ -26,7 +26,7 @@ If you need to set Pulsar configuration variables you can use the native APIs an
For example, if you want to enable `brokerDeduplicationEnabled`:
-[Set configuration variables](../../modules/pulsar/src/test/java/org/testcontainers/containers/PulsarContainerTest.java) inside_block:constructorWithEnv
+[Set configuration variables](../../modules/pulsar/src/test/java/org/testcontainers/pulsar/PulsarContainerTest.java) inside_block:constructorWithEnv
### Pulsar IO
@@ -34,7 +34,7 @@ For example, if you want to enable `brokerDeduplicationEnabled`:
If you need to test Pulsar IO framework you can enable the Pulsar Functions Worker:
-[Create a Pulsar container with functions worker](../../modules/pulsar/src/test/java/org/testcontainers/containers/PulsarContainerTest.java) inside_block:constructorWithFunctionsWorker
+[Create a Pulsar container with functions worker](../../modules/pulsar/src/test/java/org/testcontainers/pulsar/PulsarContainerTest.java) inside_block:constructorWithFunctionsWorker
### Pulsar Transactions
@@ -42,7 +42,7 @@ If you need to test Pulsar IO framework you can enable the Pulsar Functions Work
If you need to test Pulsar Transactions you can enable the transactions feature:
-[Create a Pulsar container with transactions](../../modules/pulsar/src/test/java/org/testcontainers/containers/PulsarContainerTest.java) inside_block:constructorWithTransactions
+[Create a Pulsar container with transactions](../../modules/pulsar/src/test/java/org/testcontainers/pulsar/PulsarContainerTest.java) inside_block:constructorWithTransactions
@@ -52,13 +52,13 @@ Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:pulsar:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-pulsar:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- pulsar
+ testcontainers-pulsar{{latest_version}}test
diff --git a/docs/modules/qdrant.md b/docs/modules/qdrant.md
new file mode 100644
index 00000000000..9431a340a9c
--- /dev/null
+++ b/docs/modules/qdrant.md
@@ -0,0 +1,30 @@
+# Qdrant
+
+Testcontainers module for [Qdrant](https://registry.hub.docker.com/r/qdrant/qdrant)
+
+## Qdrant's usage examples
+
+You can start a Qdrant container instance from any Java application by using:
+
+
+[Default QDrant container](../../modules/qdrant/src/test/java/org/testcontainers/qdrant/QdrantContainerTest.java) inside_block:qdrantContainer
+
+
+## Adding this module to your project dependencies
+
+Add the following dependency to your `pom.xml`/`build.gradle` file:
+
+=== "Gradle"
+ ```groovy
+ testImplementation "org.testcontainers:testcontainers-qdrant:{{latest_version}}"
+ ```
+
+=== "Maven"
+ ```xml
+
+ org.testcontainers
+ testcontainers-qdrant
+ {{latest_version}}
+ test
+
+ ```
diff --git a/docs/modules/rabbitmq.md b/docs/modules/rabbitmq.md
index 8a9ae9d9b97..5381e3cd910 100644
--- a/docs/modules/rabbitmq.md
+++ b/docs/modules/rabbitmq.md
@@ -1,21 +1,18 @@
# RabbitMQ Module
-!!! note
- This module is INCUBATING. While it is ready for use and operational in the current version of Testcontainers, it is possible that it may receive breaking changes in the future. See [our contributing guidelines](/contributing/#incubating-modules) for more information on our incubating modules policy.
-
## Adding this module to your project dependencies
Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:rabbitmq:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-rabbitmq:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- rabbitmq
+ testcontainers-rabbitmq{{latest_version}}test
diff --git a/docs/modules/redpanda.md b/docs/modules/redpanda.md
index 22545ffb026..429ae5a9768 100644
--- a/docs/modules/redpanda.md
+++ b/docs/modules/redpanda.md
@@ -45,7 +45,7 @@ Below is an example of how to create the `AdminClient`:
There are scenarios where additional listeners are needed because the consumer/producer can be another
container in the same network or a different process where the port to connect differs from the default
-exposed port `9092`. E.g [Toxiproxy](../../docs/modules/toxiproxy.md).
+exposed port `9092`. E.g [Toxiproxy](../modules/toxiproxy.md).
[Register additional listener](../../modules/redpanda/src/test/java/org/testcontainers/redpanda/RedpandaContainerTest.java) inside_block:registerListener
@@ -63,19 +63,39 @@ Client using the new registered listener:
[Produce/Consume via new listener](../../modules/redpanda/src/test/java/org/testcontainers/redpanda/RedpandaContainerTest.java) inside_block:produceConsumeMessage
+The following examples shows how to register a proxy as a new listener in `RedpandaContainer`:
+
+Use `SocatContainer` to create the proxy
+
+
+[Create Proxy](../../modules/redpanda/src/test/java/org/testcontainers/redpanda/RedpandaContainerTest.java) inside_block:createProxy
+
+
+Register the listener and advertised listener
+
+
+[Register Listener](../../modules/redpanda/src/test/java/org/testcontainers/redpanda/RedpandaContainerTest.java) inside_block:registerListenerAndAdvertisedListener
+
+
+Client using the new registered listener:
+
+
+[Produce/Consume via new listener](../../modules/redpanda/src/test/java/org/testcontainers/redpanda/RedpandaContainerTest.java) inside_block:produceConsumeMessageFromProxy
+
+
## Adding this module to your project dependencies
Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
-testImplementation "org.testcontainers:redpanda:{{latest_version}}"
+testImplementation "org.testcontainers:testcontainers-redpanda:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- redpanda
+ testcontainers-redpanda{{latest_version}}test
diff --git a/docs/modules/solace.md b/docs/modules/solace.md
index 93fc0e9875f..91956533906 100644
--- a/docs/modules/solace.md
+++ b/docs/modules/solace.md
@@ -26,13 +26,13 @@ Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:solace:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-solace:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- solace
+ testcontainers-solace{{latest_version}}test
diff --git a/docs/modules/solr.md b/docs/modules/solr.md
index 44be46c1a1a..957615fcbf1 100644
--- a/docs/modules/solr.md
+++ b/docs/modules/solr.md
@@ -1,10 +1,6 @@
# Solr Container
-!!! note
- This module is INCUBATING. While it is ready for use and operational in the current version of Testcontainers, it is possible that it may receive breaking changes in the future. See [our contributing guidelines](/contributing/#incubating-modules) for more information on our incubating modules policy.
-
-
-This module helps running [solr](https://lucene.apache.org/solr/) using Testcontainers.
+This module helps running [solr](https://solr.apache.org/) using Testcontainers.
Note that it's based on the [official Docker image](https://hub.docker.com/_/solr/).
@@ -13,7 +9,7 @@ Note that it's based on the [official Docker image](https://hub.docker.com/_/sol
You can start a solr container instance from any Java application by using:
-[Using a Solr container](../../modules/solr/src/test/java/org/testcontainers/containers/SolrContainerTest.java) inside_block:solrContainerUsage
+[Using a Solr container](../../modules/solr/src/test/java/org/testcontainers/solr/SolrContainerTest.java) inside_block:solrContainerUsage
## Adding this module to your project dependencies
@@ -22,13 +18,13 @@ Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:solr:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-solr:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- solr
+ testcontainers-solr{{latest_version}}test
diff --git a/docs/modules/toxiproxy.md b/docs/modules/toxiproxy.md
index 1b8229982e6..40f792911bb 100644
--- a/docs/modules/toxiproxy.md
+++ b/docs/modules/toxiproxy.md
@@ -17,7 +17,7 @@ A Toxiproxy container can be placed in between test code and a container, or in
In either scenario, it is necessary to create a `ToxiproxyContainer` instance on the same Docker network, as follows:
-[Creating a Toxiproxy container](../../modules/toxiproxy/src/test/java/org/testcontainers/containers/ToxiproxyTest.java) inside_block:creatingProxy
+[Creating a Toxiproxy container](../../modules/toxiproxy/src/test/java/org/testcontainers/toxiproxy/ToxiproxyContainerTest.java) inside_block:creatingProxy
Next, it is necessary to instruct Toxiproxy to start proxying connections.
@@ -26,13 +26,13 @@ Each `ToxiproxyContainer` can proxy to many target containers if necessary.
We do this as follows:
-[Starting proxying connections to a target container](../../modules/toxiproxy/src/test/java/org/testcontainers/containers/ToxiproxyTest.java) inside_block:obtainProxyObject
+[Starting proxying connections to a target container](../../modules/toxiproxy/src/test/java/org/testcontainers/toxiproxy/ToxiproxyContainerTest.java) inside_block:obtainProxyObject
To establish a connection from the test code (on the host machine) to the target container via Toxiproxy, we obtain **Toxiproxy's** proxy host IP and port:
-[Obtaining proxied host and port](../../modules/toxiproxy/src/test/java/org/testcontainers/containers/ToxiproxyTest.java) inside_block:obtainProxiedHostAndPortForHostMachine
+[Obtaining proxied host and port](../../modules/toxiproxy/src/test/java/org/testcontainers/toxiproxy/ToxiproxyContainerTest.java) inside_block:obtainProxiedHostAndPortForHostMachine
Code under test should connect to this proxied host IP and port.
@@ -56,13 +56,13 @@ Please see the [Toxiproxy documentation](https://github.com/Shopify/toxiproxy#to
As one example, we can introduce latency and random jitter to proxied connections as follows:
-[Adding latency to a connection](../../modules/toxiproxy/src/test/java/org/testcontainers/containers/ToxiproxyTest.java) inside_block:addingLatency
+[Adding latency to a connection](../../modules/toxiproxy/src/test/java/org/testcontainers/toxiproxy/ToxiproxyContainerTest.java) inside_block:addingLatency
Additionally we can disable the proxy to simulate a complete interruption to the network connection:
-[Cutting a connection](../../modules/toxiproxy/src/test/java/org/testcontainers/containers/ToxiproxyTest.java) inside_block:disableProxy
+[Cutting a connection](../../modules/toxiproxy/src/test/java/org/testcontainers/toxiproxy/ToxiproxyContainerTest.java) inside_block:disableProxy
## Adding this module to your project dependencies
@@ -71,13 +71,13 @@ Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:toxiproxy:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-toxiproxy:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- toxiproxy
+ testcontainers-toxiproxy{{latest_version}}test
@@ -86,5 +86,3 @@ Add the following dependency to your `pom.xml`/`build.gradle` file:
## Acknowledgements
This module was inspired by a [hotels.com blog post](https://medium.com/hotels-com-technology/i-dont-know-about-resilience-testing-and-so-can-you-b3c59d80012d).
-
-[toxiproxy-java](https://github.com/trekawek/toxiproxy-java) is used to help control failure conditions.
diff --git a/docs/modules/typesense.md b/docs/modules/typesense.md
new file mode 100644
index 00000000000..c73a640d881
--- /dev/null
+++ b/docs/modules/typesense.md
@@ -0,0 +1,30 @@
+# Typesense
+
+Testcontainers module for [Typesense](https://hub.docker.com/r/typesense/typesense).
+
+## TypesenseContainer's usage examples
+
+You can start a Typesense container instance from any Java application by using:
+
+
+[Typesense container](../../modules/typesense/src/test/java/org/testcontainers/typesense/TypesenseContainerTest.java) inside_block:container
+
+
+## Adding this module to your project dependencies
+
+Add the following dependency to your `pom.xml`/`build.gradle` file:
+
+=== "Gradle"
+ ```groovy
+ testImplementation "org.testcontainers:testcontainers-typesense:{{latest_version}}"
+ ```
+
+=== "Maven"
+ ```xml
+
+ org.testcontainers
+ testcontainers-typesense
+ {{latest_version}}
+ test
+
+ ```
diff --git a/docs/modules/vault.md b/docs/modules/vault.md
index e32abfd1c60..161efa8ccb0 100644
--- a/docs/modules/vault.md
+++ b/docs/modules/vault.md
@@ -4,7 +4,7 @@ Testcontainers module for [Vault](https://github.com/hashicorp/vault). Vault is
## Usage example
-Start Vault container as a `@ClassRule`:
+You can start a Vault container instance from any Java application by using:
[Starting a Vault container](../../modules/vault/src/test/java/org/testcontainers/vault/VaultContainerTest.java) inside_block:vaultContainer
@@ -22,34 +22,19 @@ Use Http API to read data from Vault container:
[Use Http API to read data](../../modules/vault/src/test/java/org/testcontainers/vault/VaultContainerTest.java) inside_block:readFirstSecretPathOverHttpApi
-Use client library to read data from Vault container:
-
-
-[Use library to read data](../../modules/vault/src/test/java/org/testcontainers/vault/VaultContainerTest.java) inside_block:readWithLibrary
-
-
-[See full example.](https://github.com/testcontainers/testcontainers-java/blob/master/modules/vault/src/test/java/org/testcontainers/vault/VaultContainerTest.java)
-
-## Why Vault in Junit tests?
-
-With the increasing popularity of Vault and secret management, applications are now needing to source secrets from Vault.
-This can prove challenging in the development phase without a running Vault instance readily on hand. This library
-aims to solve your apps integration testing with Vault. You can also use it to
-test how your application behaves with Vault by writing different test scenarios in Junit.
-
## Adding this module to your project dependencies
Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:vault:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-vault:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- vault
+ testcontainers-vault{{latest_version}}test
diff --git a/docs/modules/weaviate.md b/docs/modules/weaviate.md
new file mode 100644
index 00000000000..76146ab5ee9
--- /dev/null
+++ b/docs/modules/weaviate.md
@@ -0,0 +1,30 @@
+# Weaviate
+
+Testcontainers module for [Weaviate](https://hub.docker.com/r/semitechnologies/weaviate)
+
+## WeaviateContainer's usage examples
+
+You can start a Weaviate container instance from any Java application by using:
+
+
+[Default Weaviate container](../../modules/weaviate/src/test/java/org/testcontainers/weaviate/WeaviateContainerTest.java) inside_block:container
+
+
+## Adding this module to your project dependencies
+
+Add the following dependency to your `pom.xml`/`build.gradle` file:
+
+=== "Gradle"
+```groovy
+testImplementation "org.testcontainers:testcontainers-weaviate:{{latest_version}}"
+```
+
+=== "Maven"
+```xml
+
+org.testcontainers
+testcontainers-weaviate
+{{latest_version}}
+test
+
+```
diff --git a/docs/modules/webdriver_containers.md b/docs/modules/webdriver_containers.md
index 65b39bc5a8f..8101f489e3a 100644
--- a/docs/modules/webdriver_containers.md
+++ b/docs/modules/webdriver_containers.md
@@ -23,14 +23,14 @@ every test.
The following field in your JUnit UI test class will prepare a container running Chrome:
-[Chrome](../../modules/selenium/src/test/java/org/testcontainers/junit/ChromeWebDriverContainerTest.java) inside_block:junitRule
+[Chrome](../../modules/selenium/src/test/java/org/testcontainers/selenium/ChromeWebDriverContainerTest.java) inside_block:junitRule
Now, instead of instantiating an instance of WebDriver directly, use the following to obtain an instance inside your
test methods:
-[RemoteWebDriver](../../modules/selenium/src/test/java/org/testcontainers/junit/LocalServerWebDriverContainerTest.java) inside_block:getWebDriver
+[RemoteWebDriver](../../modules/selenium/src/test/java/org/testcontainers/selenium/LocalServerWebDriverContainerTest.java) inside_block:getWebDriver
You can then use this driver instance like a regular WebDriver.
@@ -38,7 +38,7 @@ You can then use this driver instance like a regular WebDriver.
Note that, if you want to test a **web application running on the host machine** (the machine the JUnit tests are
running on - which is quite likely), you'll need to use [the host exposing](../features/networking.md#exposing-host-ports-to-the-container) feature of Testcontainers, e.g.:
-[Open Web Page](../../modules/selenium/src/test/java/org/testcontainers/junit/LocalServerWebDriverContainerTest.java) inside_block:getPage
+[Open Web Page](../../modules/selenium/src/test/java/org/testcontainers/selenium/LocalServerWebDriverContainerTest.java) inside_block:getPage
@@ -48,9 +48,9 @@ running on - which is quite likely), you'll need to use [the host exposing](../f
At the moment, Chrome, Firefox and Edge are supported. To switch, simply change the first parameter to the rule constructor:
-[Chrome](../../modules/selenium/src/test/java/org/testcontainers/junit/ChromeWebDriverContainerTest.java) inside_block:junitRule
-[Firefox](../../modules/selenium/src/test/java/org/testcontainers/junit/FirefoxWebDriverContainerTest.java) inside_block:junitRule
-[Edge](../../modules/selenium/src/test/java/org/testcontainers/junit/EdgeWebDriverContainerTest.java) inside_block:junitRule
+[Chrome](../../modules/selenium/src/test/java/org/testcontainers/selenium/ChromeWebDriverContainerTest.java) inside_block:junitRule
+[Firefox](../../modules/selenium/src/test/java/org/testcontainers/selenium/FirefoxWebDriverContainerTest.java) inside_block:junitRule
+[Edge](../../modules/selenium/src/test/java/org/testcontainers/selenium/EdgeWebDriverContainerTest.java) inside_block:junitRule
### Recording videos
@@ -59,8 +59,8 @@ By default, no videos will be recorded. However, you can instruct Testcontainers
just for failing tests.
-[Record all Tests](../../modules/selenium/src/test/java/org/testcontainers/junit/ChromeRecordingWebDriverContainerTest.java) inside_block:recordAll
-[Record failing Tests](../../modules/selenium/src/test/java/org/testcontainers/junit/ChromeRecordingWebDriverContainerTest.java) inside_block:recordFailing
+[Record all Tests](../../modules/selenium/src/test/java/org/testcontainers/selenium/ChromeRecordingWebDriverContainerTest.java) inside_block:recordAll
+[Record failing Tests](../../modules/selenium/src/test/java/org/testcontainers/selenium/ChromeRecordingWebDriverContainerTest.java) inside_block:recordFailing
Note that the second parameter of `withRecordingMode` should be a directory where recordings can be saved.
@@ -68,13 +68,13 @@ Note that the second parameter of `withRecordingMode` should be a directory wher
By default, the video will be recorded in [FLV](https://en.wikipedia.org/wiki/Flash_Video) format, but you can specify it explicitly or change it to [MP4](https://en.wikipedia.org/wiki/MPEG-4_Part_14) using `withRecordingMode` method with `VncRecordingFormat` option:
-[Video Format in MP4](../../modules/selenium/src/test/java/org/testcontainers/junit/ChromeRecordingWebDriverContainerTest.java) inside_block:recordMp4
-[Video Format in FLV](../../modules/selenium/src/test/java/org/testcontainers/junit/ChromeRecordingWebDriverContainerTest.java) inside_block:recordFlv
+[Video Format in MP4](../../modules/selenium/src/test/java/org/testcontainers/selenium/ChromeRecordingWebDriverContainerTest.java) inside_block:recordMp4
+[Video Format in FLV](../../modules/selenium/src/test/java/org/testcontainers/selenium/ChromeRecordingWebDriverContainerTest.java) inside_block:recordFlv
If you would like to customise the file name of the recording, or provide a different directory at runtime based on the description of the test and/or its success or failure, you may provide a custom recording file factory as follows:
-[CustomRecordingFileFactory](../../modules/selenium/src/test/java/org/testcontainers/junit/ChromeRecordingWebDriverContainerTest.java) inside_block:withRecordingFileFactory
+[CustomRecordingFileFactory](../../modules/selenium/src/test/java/org/testcontainers/selenium/ChromeRecordingWebDriverContainerTest.java) inside_block:withRecordingFileFactory
@@ -82,7 +82,7 @@ Note the factory must implement `org.testcontainers.containers.RecordingFileFact
## More examples
-A few different examples are shown in [ChromeWebDriverContainerTest.java](https://github.com/testcontainers/testcontainers-java/blob/main/modules/selenium/src/test/java/org/testcontainers/junit/ChromeWebDriverContainerTest.java).
+A few different examples are shown in [ChromeWebDriverContainerTest.java](https://github.com/testcontainers/testcontainers-java/blob/main/modules/selenium/src/test/java/org/testcontainers/selenium/ChromeWebDriverContainerTest.java).
## Adding this module to your project dependencies
@@ -90,13 +90,13 @@ Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:selenium:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-selenium:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- selenium
+ testcontainers-selenium{{latest_version}}test
diff --git a/docs/quickstart/junit_5_quickstart.md b/docs/quickstart/junit_5_quickstart.md
index 3c126196845..effd17dd2d9 100644
--- a/docs/quickstart/junit_5_quickstart.md
+++ b/docs/quickstart/junit_5_quickstart.md
@@ -25,7 +25,7 @@ First, add Testcontainers as a dependency as follows:
```groovy
testImplementation "org.junit.jupiter:junit-jupiter:5.8.1"
testImplementation "org.testcontainers:testcontainers:{{latest_version}}"
- testImplementation "org.testcontainers:junit-jupiter:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-junit-jupiter:{{latest_version}}"
```
=== "Maven"
```xml
@@ -43,7 +43,7 @@ First, add Testcontainers as a dependency as follows:
org.testcontainers
- junit-jupiter
+ testcontainers-junit-jupiter{{latest_version}}test
diff --git a/docs/quickstart/spock_quickstart.md b/docs/quickstart/spock_quickstart.md
index 267954e99ee..c9c78bea5ea 100644
--- a/docs/quickstart/spock_quickstart.md
+++ b/docs/quickstart/spock_quickstart.md
@@ -23,13 +23,13 @@ First, add Testcontainers as a dependency as follows:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:spock:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-spock:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- spock
+ testcontainers-spock{{latest_version}}test
diff --git a/docs/supported_docker_environment/continuous_integration/circle_ci.md b/docs/supported_docker_environment/continuous_integration/circle_ci.md
index d6e85a62a79..936192cc799 100644
--- a/docs/supported_docker_environment/continuous_integration/circle_ci.md
+++ b/docs/supported_docker_environment/continuous_integration/circle_ci.md
@@ -1,7 +1,7 @@
# CircleCI (Cloud, Server v2.x, and Server v3.x)
Your CircleCI configuration should use a dedicated VM for Testcontainers to work. You can achieve this by specifying the
-executor type in your `.circleci/config.yml` to be `machine` instead of the default `docker` executor (see [Choosing an Executor Type](https://circleci.com/docs/2.0/executor-types/) for more info).
+executor type in your `.circleci/config.yml` to be `machine` instead of the default `docker` executor (see [Choosing an Executor Type](https://circleci.com/docs/executor-intro) for more info).
Here is a sample CircleCI configuration that does a checkout of a project and runs Maven:
diff --git a/docs/supported_docker_environment/continuous_integration/gitlab_ci.md b/docs/supported_docker_environment/continuous_integration/gitlab_ci.md
index 5242e095b56..ccc73f58078 100644
--- a/docs/supported_docker_environment/continuous_integration/gitlab_ci.md
+++ b/docs/supported_docker_environment/continuous_integration/gitlab_ci.md
@@ -24,10 +24,10 @@ See below for an example runner configuration:
Please also include the following in your GitlabCI pipeline definitions (`.gitlab-ci.yml`) that use Testcontainers:
```yml
variables:
- TESTCONTAINERS_HOST_OVERRIDE: "host.docker.internal"
+ TESTCONTAINERS_HOST_OVERRIDE: ""
```
-The environment variable `TESTCONTAINERS_HOST_OVERRIDE` needs to be configured, otherwise, a wrong IP address would be used to resolve the Docker host, which will likely lead to failing tests.
+The environment variable `TESTCONTAINERS_HOST_OVERRIDE` needs to be configured, otherwise, a wrong IP address would be used to resolve the Docker host, which will likely lead to failing tests. For Windows and MacOS, use `host.docker.internal`.
## Example using DinD (Docker-in-Docker)
diff --git a/docs/test_framework_integration/external.md b/docs/test_framework_integration/external.md
index b3f55783123..3396ff15d52 100644
--- a/docs/test_framework_integration/external.md
+++ b/docs/test_framework_integration/external.md
@@ -5,5 +5,6 @@ The following Open Source frameworks add direct integration to Testcontainers
| Framework | Source Code | Documentation |
| --- | --- | --- |
| jqwik | [jqwik-testcontainers](https://github.com/jqwik-team/jqwik-testcontainers) | [README](https://github.com/jqwik-team/jqwik-testcontainers) |
-| Kotest | [Kotest Extensions Testcontainers](https://github.com/kotest/kotest-extensions-testcontainers) | [kotest.io](https://kotest.io/docs/extensions/test_containers.html) |
+| Kotest | [Kotest Extensions Testcontainers](https://github.com/kotest/kotest/tree/master/kotest-extensions/kotest-extensions-testcontainers) | [kotest.io](https://kotest.io/docs/extensions/test_containers.html) |
| Synthesized | [Synthesized TDK-Testcontainers integration](https://github.com/synthesized-io/tdk-tc) | [synthesized.io](https://docs.synthesized.io/tdk/latest/user_guide/integrations/testcontainers) |
+| TCI | [Testcontainers Infrastructure (TCI) Framework](https://github.com/xdev-software/tci-base) | [README](https://github.com/xdev-software/tci-base) |
diff --git a/docs/test_framework_integration/junit_5.md b/docs/test_framework_integration/junit_5.md
index 15597f90cdb..aed2d515af9 100644
--- a/docs/test_framework_integration/junit_5.md
+++ b/docs/test_framework_integration/junit_5.md
@@ -1,7 +1,6 @@
# Jupiter / JUnit 5
-While Testcontainers is tightly coupled with the JUnit 4.x rule API, this module provides
-an API that is based on the [JUnit Jupiter](https://junit.org/junit5/) extension model.
+This module provides an API that is based on the [JUnit Jupiter](https://junit.org/junit5/) extension model.
The extension supports two modes:
@@ -58,11 +57,7 @@ using JUnit 5.
## Limitations
-Since this module has a dependency onto JUnit Jupiter and on Testcontainers core, which
-has a dependency onto JUnit 4.x, projects using this module will end up with both, JUnit Jupiter
-and JUnit 4.x in the test classpath.
-
-This extension has only be tested with sequential test execution. Using it with parallel test execution is unsupported and may have unintended side effects.
+This extension has only been tested with sequential test execution. Using it with parallel test execution is unsupported and may have unintended side effects.
## Adding Testcontainers JUnit 5 support to your project dependencies
@@ -70,13 +65,13 @@ Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:junit-jupiter:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-junit-jupiter:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- junit-jupiter
+ testcontainers-junit-jupiter{{latest_version}}test
diff --git a/docs/test_framework_integration/manual_lifecycle_control.md b/docs/test_framework_integration/manual_lifecycle_control.md
index 6de3cb47196..e1005397c00 100644
--- a/docs/test_framework_integration/manual_lifecycle_control.md
+++ b/docs/test_framework_integration/manual_lifecycle_control.md
@@ -1,7 +1,6 @@
# Manual container lifecycle control
-While Testcontainers was originally built with JUnit 4 integration in mind, it is fully usable with other test
-frameworks, or with no framework at all.
+Testcontainers is fully usable with any test framework, or with no framework at all.
## Manually starting/stopping containers
diff --git a/docs/test_framework_integration/spock.md b/docs/test_framework_integration/spock.md
index b8c1d5b7eae..3d50e0399d2 100644
--- a/docs/test_framework_integration/spock.md
+++ b/docs/test_framework_integration/spock.md
@@ -19,13 +19,13 @@ Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:spock:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-spock:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- spock
+ testcontainers-spock{{latest_version}}test
diff --git a/examples/build.gradle b/examples/build.gradle
index a83df2bedce..e80815cdae6 100644
--- a/examples/build.gradle
+++ b/examples/build.gradle
@@ -1,6 +1,6 @@
// empty build.gradle for dependabot
plugins {
- id 'com.diffplug.spotless' version '6.13.0' apply false
+ id 'com.diffplug.spotless' version '6.22.0' apply false
}
apply from: "$rootDir/../gradle/ci-support.gradle"
@@ -14,8 +14,18 @@ subprojects {
mavenCentral()
}
+ test {
+ defaultCharacterEncoding = "UTF-8"
+ testLogging {
+ displayGranularity 1
+ showStackTraces = true
+ exceptionFormat = 'full'
+ events "STARTED", "PASSED", "FAILED", "SKIPPED"
+ }
+ }
+
checkstyle {
- toolVersion = "9.3"
+ toolVersion = "10.23.0"
configFile = rootProject.file('../config/checkstyle/checkstyle.xml')
}
}
diff --git a/examples/cucumber/build.gradle b/examples/cucumber/build.gradle
index 9164a44c9be..84dbc39a85e 100644
--- a/examples/cucumber/build.gradle
+++ b/examples/cucumber/build.gradle
@@ -7,27 +7,21 @@ repositories {
}
dependencies {
- implementation platform('org.seleniumhq.selenium:selenium-bom:4.17.0')
+ implementation platform('org.seleniumhq.selenium:selenium-bom:4.35.0')
implementation 'org.seleniumhq.selenium:selenium-remote-driver'
implementation 'org.seleniumhq.selenium:selenium-firefox-driver'
implementation 'org.seleniumhq.selenium:selenium-chrome-driver'
- testImplementation platform('io.cucumber:cucumber-bom:7.15.0')
+ testImplementation platform('org.junit:junit-bom:5.13.4')
+ testImplementation 'org.junit.platform:junit-platform-suite'
+ testImplementation platform('io.cucumber:cucumber-bom:7.30.0')
testImplementation 'io.cucumber:cucumber-java'
- testImplementation 'io.cucumber:cucumber-junit'
- testImplementation 'org.testcontainers:selenium'
- testImplementation 'org.assertj:assertj-core:3.25.2'
+ testImplementation 'io.cucumber:cucumber-junit-platform-engine'
+ testImplementation 'org.testcontainers:testcontainers-selenium'
+ testImplementation 'org.assertj:assertj-core:3.27.4'
+ testRuntimeOnly 'org.junit.platform:junit-platform-launcher:1.10.3'
}
test {
- javaLauncher = javaToolchains.launcherFor {
- languageVersion = JavaLanguageVersion.of(11)
- }
-}
-
-compileTestJava {
- javaCompiler = javaToolchains.compilerFor {
- languageVersion = JavaLanguageVersion.of(11)
- }
- options.release.set(11)
+ useJUnitPlatform()
}
diff --git a/examples/cucumber/src/test/java/org/testcontainers/examples/CucumberTest.java b/examples/cucumber/src/test/java/org/testcontainers/examples/CucumberTest.java
index 717c42351a8..5d6fe8c3f9c 100644
--- a/examples/cucumber/src/test/java/org/testcontainers/examples/CucumberTest.java
+++ b/examples/cucumber/src/test/java/org/testcontainers/examples/CucumberTest.java
@@ -1,9 +1,11 @@
package org.testcontainers.examples;
-import io.cucumber.junit.Cucumber;
-import io.cucumber.junit.CucumberOptions;
-import org.junit.runner.RunWith;
+import io.cucumber.junit.platform.engine.Constants;
+import org.junit.platform.suite.api.ConfigurationParameter;
+import org.junit.platform.suite.api.SelectPackages;
+import org.junit.platform.suite.api.Suite;
-@RunWith(Cucumber.class)
-@CucumberOptions(plugin = { "pretty" })
+@Suite
+@SelectPackages("org.testcontainers.examples")
+@ConfigurationParameter(key = Constants.PLUGIN_PROPERTY_NAME, value = "pretty")
public class CucumberTest {}
diff --git a/examples/gradle/wrapper/gradle-wrapper.jar b/examples/gradle/wrapper/gradle-wrapper.jar
index d64cd491770..1b33c55baab 100644
Binary files a/examples/gradle/wrapper/gradle-wrapper.jar and b/examples/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/examples/gradle/wrapper/gradle-wrapper.properties b/examples/gradle/wrapper/gradle-wrapper.properties
index db8c3baafe3..78cb6e16a49 100644
--- a/examples/gradle/wrapper/gradle-wrapper.properties
+++ b/examples/gradle/wrapper/gradle-wrapper.properties
@@ -1,7 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionSha256Sum=9d926787066a081739e8200858338b4a69e837c3a821a33aca9db09dd4a41026
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
+distributionSha256Sum=bd71102213493060956ec229d946beee57158dbd89d0e62b91bca0fa2c5f3531
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
diff --git a/examples/gradlew b/examples/gradlew
index 1aa94a42690..23d15a93670 100755
--- a/examples/gradlew
+++ b/examples/gradlew
@@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
+# SPDX-License-Identifier: Apache-2.0
+#
##############################################################################
#
@@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
-# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
+# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -84,7 +86,7 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
-APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
+APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
@@ -112,7 +114,7 @@ case "$( uname )" in #(
NONSTOP* ) nonstop=true ;;
esac
-CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+CLASSPATH="\\\"\\\""
# Determine the Java command to use to start the JVM.
@@ -203,7 +205,7 @@ fi
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command:
-# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
+# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
@@ -211,7 +213,7 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
- org.gradle.wrapper.GradleWrapperMain \
+ -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
"$@"
# Stop when "xargs" is not available.
diff --git a/examples/gradlew.bat b/examples/gradlew.bat
index 6689b85beec..5eed7ee8452 100644
--- a/examples/gradlew.bat
+++ b/examples/gradlew.bat
@@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
+@rem SPDX-License-Identifier: Apache-2.0
+@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@@ -43,11 +45,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute
-echo.
-echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
+echo. 1>&2
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
+echo. 1>&2
+echo Please set the JAVA_HOME variable in your environment to match the 1>&2
+echo location of your Java installation. 1>&2
goto fail
@@ -57,22 +59,22 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
-echo.
-echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
+echo. 1>&2
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
+echo. 1>&2
+echo Please set the JAVA_HOME variable in your environment to match the 1>&2
+echo location of your Java installation. 1>&2
goto fail
:execute
@rem Setup the command line
-set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+set CLASSPATH=
@rem Execute Gradle
-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
:end
@rem End local scope for the variables with windows NT shell
diff --git a/examples/hazelcast/build.gradle b/examples/hazelcast/build.gradle
index 74771e0e02b..c5086cc4d20 100644
--- a/examples/hazelcast/build.gradle
+++ b/examples/hazelcast/build.gradle
@@ -8,10 +8,11 @@ repositories {
dependencies {
testImplementation 'org.testcontainers:testcontainers'
- testImplementation 'com.hazelcast:hazelcast:5.3.6'
- testImplementation 'ch.qos.logback:logback-classic:1.3.14'
- testImplementation 'org.assertj:assertj-core:3.25.2'
- testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1'
+ testImplementation 'com.hazelcast:hazelcast:5.3.8'
+ testImplementation 'ch.qos.logback:logback-classic:1.3.15'
+ testImplementation 'org.assertj:assertj-core:3.27.4'
+ testImplementation 'org.junit.jupiter:junit-jupiter:5.13.4'
+ testRuntimeOnly 'org.junit.platform:junit-platform-launcher:1.11.0'
}
test {
diff --git a/examples/immudb/build.gradle b/examples/immudb/build.gradle
index 27d0bcea9e2..a4d656dd762 100644
--- a/examples/immudb/build.gradle
+++ b/examples/immudb/build.gradle
@@ -9,11 +9,12 @@ repositories {
dependencies {
implementation 'io.codenotary:immudb4j:1.0.1'
testImplementation 'org.testcontainers:testcontainers'
- testImplementation 'org.testcontainers:junit-jupiter'
- testImplementation 'org.assertj:assertj-core:3.25.2'
+ testImplementation 'org.testcontainers:testcontainers-junit-jupiter'
+ testImplementation 'org.assertj:assertj-core:3.27.4'
testImplementation 'com.google.guava:guava:23.0'
- testImplementation 'ch.qos.logback:logback-classic:1.3.14'
- testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1'
+ testImplementation 'ch.qos.logback:logback-classic:1.3.15'
+ testImplementation 'org.junit.jupiter:junit-jupiter:5.13.4'
+ testRuntimeOnly 'org.junit.platform:junit-platform-launcher:1.11.0'
}
test {
diff --git a/examples/kafka-cluster/build.gradle b/examples/kafka-cluster/build.gradle
index 2653c2da0b4..67ca7e4e37c 100644
--- a/examples/kafka-cluster/build.gradle
+++ b/examples/kafka-cluster/build.gradle
@@ -7,14 +7,16 @@ repositories {
}
dependencies {
- testCompileOnly "org.projectlombok:lombok:1.18.30"
- testAnnotationProcessor "org.projectlombok:lombok:1.18.30"
- testImplementation 'org.testcontainers:kafka'
- testImplementation 'org.apache.kafka:kafka-clients:3.6.1'
- testImplementation 'org.assertj:assertj-core:3.25.2'
+ testCompileOnly "org.projectlombok:lombok:1.18.38"
+ testAnnotationProcessor "org.projectlombok:lombok:1.18.38"
+ testImplementation 'org.testcontainers:testcontainers-kafka'
+ testImplementation 'org.apache.kafka:kafka-clients:4.1.0'
+ testImplementation 'org.assertj:assertj-core:3.27.4'
testImplementation 'com.google.guava:guava:23.0'
- testImplementation 'ch.qos.logback:logback-classic:1.3.14'
- testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1'
+ testImplementation 'ch.qos.logback:logback-classic:1.3.15'
+ testImplementation 'org.junit.jupiter:junit-jupiter:5.13.4'
+ testImplementation 'org.awaitility:awaitility:4.3.0'
+ testRuntimeOnly 'org.junit.platform:junit-platform-launcher:1.11.0'
}
test {
diff --git a/examples/kafka-cluster/src/test/java/com/example/kafkacluster/ApacheKafkaContainerCluster.java b/examples/kafka-cluster/src/test/java/com/example/kafkacluster/ApacheKafkaContainerCluster.java
new file mode 100644
index 00000000000..0e56bd9d758
--- /dev/null
+++ b/examples/kafka-cluster/src/test/java/com/example/kafkacluster/ApacheKafkaContainerCluster.java
@@ -0,0 +1,106 @@
+package com.example.kafkacluster;
+
+import org.apache.kafka.common.Uuid;
+import org.awaitility.Awaitility;
+import org.testcontainers.containers.Container;
+import org.testcontainers.containers.GenericContainer;
+import org.testcontainers.containers.Network;
+import org.testcontainers.kafka.KafkaContainer;
+import org.testcontainers.lifecycle.Startable;
+import org.testcontainers.utility.DockerImageName;
+
+import java.time.Duration;
+import java.util.Collection;
+import java.util.stream.Collectors;
+import java.util.stream.IntStream;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+public class ApacheKafkaContainerCluster implements Startable {
+
+ private final int brokersNum;
+
+ private final Network network;
+
+ private final Collection brokers;
+
+ public ApacheKafkaContainerCluster(String version, int brokersNum, int internalTopicsRf) {
+ if (brokersNum <= 0) {
+ throw new IllegalArgumentException("brokersNum '" + brokersNum + "' must be greater than 0");
+ }
+ if (internalTopicsRf <= 0 || internalTopicsRf > brokersNum) {
+ throw new IllegalArgumentException(
+ "internalTopicsRf '" +
+ internalTopicsRf +
+ "' must be less than or equal to brokersNum and greater than 0"
+ );
+ }
+
+ this.brokersNum = brokersNum;
+ this.network = Network.newNetwork();
+
+ String controllerQuorumVoters = IntStream
+ .range(0, brokersNum)
+ .mapToObj(brokerNum -> String.format("%d@broker-%d:9094", brokerNum, brokerNum))
+ .collect(Collectors.joining(","));
+
+ String clusterId = Uuid.randomUuid().toString();
+
+ this.brokers =
+ IntStream
+ .range(0, brokersNum)
+ .mapToObj(brokerNum -> {
+ return new KafkaContainer(DockerImageName.parse("apache/kafka").withTag(version))
+ .withNetwork(this.network)
+ .withNetworkAliases("broker-" + brokerNum)
+ .withEnv("CLUSTER_ID", clusterId)
+ .withEnv("KAFKA_BROKER_ID", brokerNum + "")
+ .withEnv("KAFKA_NODE_ID", brokerNum + "")
+ .withEnv("KAFKA_CONTROLLER_QUORUM_VOTERS", controllerQuorumVoters)
+ .withEnv("KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR", internalTopicsRf + "")
+ .withEnv("KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS", "0")
+ .withEnv("KAFKA_OFFSETS_TOPIC_NUM_PARTITIONS", internalTopicsRf + "")
+ .withEnv("KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR", internalTopicsRf + "")
+ .withEnv("KAFKA_TRANSACTION_STATE_LOG_MIN_ISR", internalTopicsRf + "")
+ .withStartupTimeout(Duration.ofMinutes(1));
+ })
+ .collect(Collectors.toList());
+ }
+
+ public Collection getBrokers() {
+ return this.brokers;
+ }
+
+ public String getBootstrapServers() {
+ return brokers.stream().map(KafkaContainer::getBootstrapServers).collect(Collectors.joining(","));
+ }
+
+ @Override
+ public void start() {
+ // Needs to start all the brokers at once
+ brokers.parallelStream().forEach(GenericContainer::start);
+
+ Awaitility
+ .await()
+ .atMost(Duration.ofSeconds(30))
+ .untilAsserted(() -> {
+ Container.ExecResult result =
+ this.brokers.stream()
+ .findFirst()
+ .get()
+ .execInContainer(
+ "sh",
+ "-c",
+ "/opt/kafka/bin/kafka-log-dirs.sh --bootstrap-server localhost:9093 --describe | grep -o '\"broker\"' | wc -l"
+ );
+ String brokers = result.getStdout().replace("\n", "");
+
+ assertThat(brokers).asInt().isEqualTo(this.brokersNum);
+ });
+ }
+
+ @Override
+ public void stop() {
+ this.brokers.parallelStream().forEach(GenericContainer::stop);
+ }
+}
diff --git a/examples/kafka-cluster/src/test/java/com/example/kafkacluster/ApacheKafkaContainerClusterTest.java b/examples/kafka-cluster/src/test/java/com/example/kafkacluster/ApacheKafkaContainerClusterTest.java
new file mode 100644
index 00000000000..38ac274706b
--- /dev/null
+++ b/examples/kafka-cluster/src/test/java/com/example/kafkacluster/ApacheKafkaContainerClusterTest.java
@@ -0,0 +1,94 @@
+package com.example.kafkacluster;
+
+import com.google.common.collect.ImmutableMap;
+import org.apache.kafka.clients.admin.AdminClient;
+import org.apache.kafka.clients.admin.AdminClientConfig;
+import org.apache.kafka.clients.admin.NewTopic;
+import org.apache.kafka.clients.consumer.ConsumerConfig;
+import org.apache.kafka.clients.consumer.ConsumerRecord;
+import org.apache.kafka.clients.consumer.ConsumerRecords;
+import org.apache.kafka.clients.consumer.KafkaConsumer;
+import org.apache.kafka.clients.producer.KafkaProducer;
+import org.apache.kafka.clients.producer.ProducerConfig;
+import org.apache.kafka.clients.producer.ProducerRecord;
+import org.apache.kafka.common.serialization.StringDeserializer;
+import org.apache.kafka.common.serialization.StringSerializer;
+import org.awaitility.Awaitility;
+import org.junit.jupiter.api.Test;
+
+import java.time.Duration;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.UUID;
+import java.util.concurrent.TimeUnit;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.tuple;
+
+class ApacheKafkaContainerClusterTest {
+
+ @Test
+ void testKafkaContainerCluster() throws Exception {
+ try (ApacheKafkaContainerCluster cluster = new ApacheKafkaContainerCluster("3.8.0", 3, 2)) {
+ cluster.start();
+ String bootstrapServers = cluster.getBootstrapServers();
+
+ assertThat(cluster.getBrokers()).hasSize(3);
+
+ testKafkaFunctionality(bootstrapServers, 3, 2);
+ }
+ }
+
+ protected void testKafkaFunctionality(String bootstrapServers, int partitions, int rf) throws Exception {
+ try (
+ AdminClient adminClient = AdminClient.create(
+ ImmutableMap.of(AdminClientConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapServers)
+ );
+ KafkaProducer producer = new KafkaProducer<>(
+ ImmutableMap.of(
+ ProducerConfig.BOOTSTRAP_SERVERS_CONFIG,
+ bootstrapServers,
+ ProducerConfig.CLIENT_ID_CONFIG,
+ UUID.randomUUID().toString()
+ ),
+ new StringSerializer(),
+ new StringSerializer()
+ );
+ KafkaConsumer consumer = new KafkaConsumer<>(
+ ImmutableMap.of(
+ ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG,
+ bootstrapServers,
+ ConsumerConfig.GROUP_ID_CONFIG,
+ "tc-" + UUID.randomUUID(),
+ ConsumerConfig.AUTO_OFFSET_RESET_CONFIG,
+ "earliest"
+ ),
+ new StringDeserializer(),
+ new StringDeserializer()
+ );
+ ) {
+ String topicName = "messages";
+
+ Collection topics = Collections.singletonList(new NewTopic(topicName, partitions, (short) rf));
+ adminClient.createTopics(topics).all().get(30, TimeUnit.SECONDS);
+
+ consumer.subscribe(Collections.singletonList(topicName));
+
+ producer.send(new ProducerRecord<>(topicName, "testcontainers", "rulezzz")).get();
+
+ Awaitility
+ .await()
+ .atMost(Duration.ofSeconds(10))
+ .untilAsserted(() -> {
+ ConsumerRecords records = consumer.poll(Duration.ofMillis(100));
+
+ assertThat(records)
+ .hasSize(1)
+ .extracting(ConsumerRecord::topic, ConsumerRecord::key, ConsumerRecord::value)
+ .containsExactly(tuple(topicName, "testcontainers", "rulezzz"));
+ });
+
+ consumer.unsubscribe();
+ }
+ }
+}
diff --git a/examples/kafka-cluster/src/test/java/com/example/kafkacluster/ConfluentKafkaContainerCluster.java b/examples/kafka-cluster/src/test/java/com/example/kafkacluster/ConfluentKafkaContainerCluster.java
new file mode 100644
index 00000000000..f09c3072ea3
--- /dev/null
+++ b/examples/kafka-cluster/src/test/java/com/example/kafkacluster/ConfluentKafkaContainerCluster.java
@@ -0,0 +1,107 @@
+package com.example.kafkacluster;
+
+import org.apache.kafka.common.Uuid;
+import org.awaitility.Awaitility;
+import org.testcontainers.containers.Container;
+import org.testcontainers.containers.GenericContainer;
+import org.testcontainers.containers.Network;
+import org.testcontainers.kafka.ConfluentKafkaContainer;
+import org.testcontainers.lifecycle.Startable;
+import org.testcontainers.utility.DockerImageName;
+
+import java.time.Duration;
+import java.util.Collection;
+import java.util.stream.Collectors;
+import java.util.stream.IntStream;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+public class ConfluentKafkaContainerCluster implements Startable {
+
+ private final int brokersNum;
+
+ private final Network network;
+
+ private final Collection brokers;
+
+ public ConfluentKafkaContainerCluster(String confluentPlatformVersion, int brokersNum, int internalTopicsRf) {
+ if (brokersNum <= 0) {
+ throw new IllegalArgumentException("brokersNum '" + brokersNum + "' must be greater than 0");
+ }
+ if (internalTopicsRf <= 0 || internalTopicsRf > brokersNum) {
+ throw new IllegalArgumentException(
+ "internalTopicsRf '" +
+ internalTopicsRf +
+ "' must be less than or equal to brokersNum and greater than 0"
+ );
+ }
+
+ this.brokersNum = brokersNum;
+ this.network = Network.newNetwork();
+
+ String controllerQuorumVoters = IntStream
+ .range(0, brokersNum)
+ .mapToObj(brokerNum -> String.format("%d@broker-%d:9094", brokerNum, brokerNum))
+ .collect(Collectors.joining(","));
+
+ String clusterId = Uuid.randomUuid().toString();
+
+ this.brokers =
+ IntStream
+ .range(0, brokersNum)
+ .mapToObj(brokerNum -> {
+ return new ConfluentKafkaContainer(
+ DockerImageName.parse("confluentinc/cp-kafka").withTag(confluentPlatformVersion)
+ )
+ .withNetwork(this.network)
+ .withNetworkAliases("broker-" + brokerNum)
+ .withEnv("CLUSTER_ID", clusterId)
+ .withEnv("KAFKA_BROKER_ID", brokerNum + "")
+ .withEnv("KAFKA_NODE_ID", brokerNum + "")
+ .withEnv("KAFKA_CONTROLLER_QUORUM_VOTERS", controllerQuorumVoters)
+ .withEnv("KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR", internalTopicsRf + "")
+ .withEnv("KAFKA_OFFSETS_TOPIC_NUM_PARTITIONS", internalTopicsRf + "")
+ .withEnv("KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR", internalTopicsRf + "")
+ .withEnv("KAFKA_TRANSACTION_STATE_LOG_MIN_ISR", internalTopicsRf + "")
+ .withStartupTimeout(Duration.ofMinutes(1));
+ })
+ .collect(Collectors.toList());
+ }
+
+ public Collection getBrokers() {
+ return this.brokers;
+ }
+
+ public String getBootstrapServers() {
+ return brokers.stream().map(ConfluentKafkaContainer::getBootstrapServers).collect(Collectors.joining(","));
+ }
+
+ @Override
+ public void start() {
+ // Needs to start all the brokers at once
+ brokers.parallelStream().forEach(GenericContainer::start);
+
+ Awaitility
+ .await()
+ .atMost(Duration.ofSeconds(30))
+ .untilAsserted(() -> {
+ Container.ExecResult result =
+ this.brokers.stream()
+ .findFirst()
+ .get()
+ .execInContainer(
+ "sh",
+ "-c",
+ "kafka-metadata-shell --snapshot /var/lib/kafka/data/__cluster_metadata-0/00000000000000000000.log ls /brokers | wc -l"
+ );
+ String brokers = result.getStdout().replace("\n", "");
+
+ assertThat(brokers).asInt().isEqualTo(this.brokersNum);
+ });
+ }
+
+ @Override
+ public void stop() {
+ this.brokers.parallelStream().forEach(GenericContainer::stop);
+ }
+}
diff --git a/examples/kafka-cluster/src/test/java/com/example/kafkacluster/ConfluentKafkaContainerClusterTest.java b/examples/kafka-cluster/src/test/java/com/example/kafkacluster/ConfluentKafkaContainerClusterTest.java
new file mode 100644
index 00000000000..3bb38cb7152
--- /dev/null
+++ b/examples/kafka-cluster/src/test/java/com/example/kafkacluster/ConfluentKafkaContainerClusterTest.java
@@ -0,0 +1,94 @@
+package com.example.kafkacluster;
+
+import com.google.common.collect.ImmutableMap;
+import org.apache.kafka.clients.admin.AdminClient;
+import org.apache.kafka.clients.admin.AdminClientConfig;
+import org.apache.kafka.clients.admin.NewTopic;
+import org.apache.kafka.clients.consumer.ConsumerConfig;
+import org.apache.kafka.clients.consumer.ConsumerRecord;
+import org.apache.kafka.clients.consumer.ConsumerRecords;
+import org.apache.kafka.clients.consumer.KafkaConsumer;
+import org.apache.kafka.clients.producer.KafkaProducer;
+import org.apache.kafka.clients.producer.ProducerConfig;
+import org.apache.kafka.clients.producer.ProducerRecord;
+import org.apache.kafka.common.serialization.StringDeserializer;
+import org.apache.kafka.common.serialization.StringSerializer;
+import org.awaitility.Awaitility;
+import org.junit.jupiter.api.Test;
+
+import java.time.Duration;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.UUID;
+import java.util.concurrent.TimeUnit;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.tuple;
+
+class ConfluentKafkaContainerClusterTest {
+
+ @Test
+ void testKafkaContainerCluster() throws Exception {
+ try (ConfluentKafkaContainerCluster cluster = new ConfluentKafkaContainerCluster("7.4.0", 3, 2)) {
+ cluster.start();
+ String bootstrapServers = cluster.getBootstrapServers();
+
+ assertThat(cluster.getBrokers()).hasSize(3);
+
+ testKafkaFunctionality(bootstrapServers, 3, 2);
+ }
+ }
+
+ protected void testKafkaFunctionality(String bootstrapServers, int partitions, int rf) throws Exception {
+ try (
+ AdminClient adminClient = AdminClient.create(
+ ImmutableMap.of(AdminClientConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapServers)
+ );
+ KafkaProducer producer = new KafkaProducer<>(
+ ImmutableMap.of(
+ ProducerConfig.BOOTSTRAP_SERVERS_CONFIG,
+ bootstrapServers,
+ ProducerConfig.CLIENT_ID_CONFIG,
+ UUID.randomUUID().toString()
+ ),
+ new StringSerializer(),
+ new StringSerializer()
+ );
+ KafkaConsumer consumer = new KafkaConsumer<>(
+ ImmutableMap.of(
+ ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG,
+ bootstrapServers,
+ ConsumerConfig.GROUP_ID_CONFIG,
+ "tc-" + UUID.randomUUID(),
+ ConsumerConfig.AUTO_OFFSET_RESET_CONFIG,
+ "earliest"
+ ),
+ new StringDeserializer(),
+ new StringDeserializer()
+ );
+ ) {
+ String topicName = "messages";
+
+ Collection topics = Collections.singletonList(new NewTopic(topicName, partitions, (short) rf));
+ adminClient.createTopics(topics).all().get(30, TimeUnit.SECONDS);
+
+ consumer.subscribe(Collections.singletonList(topicName));
+
+ producer.send(new ProducerRecord<>(topicName, "testcontainers", "rulezzz")).get();
+
+ Awaitility
+ .await()
+ .atMost(Duration.ofSeconds(10))
+ .untilAsserted(() -> {
+ ConsumerRecords records = consumer.poll(Duration.ofMillis(100));
+
+ assertThat(records)
+ .hasSize(1)
+ .extracting(ConsumerRecord::topic, ConsumerRecord::key, ConsumerRecord::value)
+ .containsExactly(tuple(topicName, "testcontainers", "rulezzz"));
+ });
+
+ consumer.unsubscribe();
+ }
+ }
+}
diff --git a/examples/kafka-cluster/src/test/java/com/example/kafkacluster/KafkaContainerCluster.java b/examples/kafka-cluster/src/test/java/com/example/kafkacluster/KafkaContainerCluster.java
index 9ab3f25e0ff..aa22cceadb0 100644
--- a/examples/kafka-cluster/src/test/java/com/example/kafkacluster/KafkaContainerCluster.java
+++ b/examples/kafka-cluster/src/test/java/com/example/kafkacluster/KafkaContainerCluster.java
@@ -1,7 +1,7 @@
package com.example.kafkacluster;
import lombok.SneakyThrows;
-import org.rnorth.ducttape.unreliables.Unreliables;
+import org.awaitility.Awaitility;
import org.testcontainers.containers.Container;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.KafkaContainer;
@@ -11,11 +11,12 @@
import java.time.Duration;
import java.util.Collection;
-import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import java.util.stream.Stream;
+import static org.assertj.core.api.Assertions.assertThat;
+
/**
* Provides an easy way to launch a Kafka cluster with multiple brokers.
*/
@@ -30,12 +31,14 @@ public class KafkaContainerCluster implements Startable {
private final Collection brokers;
public KafkaContainerCluster(String confluentPlatformVersion, int brokersNum, int internalTopicsRf) {
- if (brokersNum < 0) {
+ if (brokersNum <= 0) {
throw new IllegalArgumentException("brokersNum '" + brokersNum + "' must be greater than 0");
}
- if (internalTopicsRf < 0 || internalTopicsRf > brokersNum) {
+ if (internalTopicsRf <= 0 || internalTopicsRf > brokersNum) {
throw new IllegalArgumentException(
- "internalTopicsRf '" + internalTopicsRf + "' must be less than brokersNum and greater than 0"
+ "internalTopicsRf '" +
+ internalTopicsRf +
+ "' must be less than or equal to brokersNum and greater than 0"
);
}
@@ -87,10 +90,10 @@ public void start() {
// sequential start to avoid resource contention on CI systems with weaker hardware
brokers.forEach(GenericContainer::start);
- Unreliables.retryUntilTrue(
- 30,
- TimeUnit.SECONDS,
- () -> {
+ Awaitility
+ .await()
+ .atMost(Duration.ofSeconds(30))
+ .untilAsserted(() -> {
Container.ExecResult result =
this.zookeeper.execInContainer(
"sh",
@@ -101,9 +104,8 @@ public void start() {
);
String brokers = result.getStdout();
- return brokers != null && brokers.split(",").length == this.brokersNum;
- }
- );
+ assertThat(brokers.split(",")).hasSize(this.brokersNum);
+ });
}
@Override
diff --git a/examples/kafka-cluster/src/test/java/com/example/kafkacluster/KafkaContainerClusterTest.java b/examples/kafka-cluster/src/test/java/com/example/kafkacluster/KafkaContainerClusterTest.java
index 51221b5d56f..6a66cf0ca2e 100644
--- a/examples/kafka-cluster/src/test/java/com/example/kafkacluster/KafkaContainerClusterTest.java
+++ b/examples/kafka-cluster/src/test/java/com/example/kafkacluster/KafkaContainerClusterTest.java
@@ -13,8 +13,8 @@
import org.apache.kafka.clients.producer.ProducerRecord;
import org.apache.kafka.common.serialization.StringDeserializer;
import org.apache.kafka.common.serialization.StringSerializer;
+import org.awaitility.Awaitility;
import org.junit.jupiter.api.Test;
-import org.rnorth.ducttape.unreliables.Unreliables;
import java.time.Duration;
import java.util.Collection;
@@ -100,24 +100,17 @@ protected void testKafkaFunctionality(String bootstrapServers, int partitions, i
producer.send(new ProducerRecord<>(topicName, "testcontainers", "rulezzz")).get();
- Unreliables.retryUntilTrue(
- 10,
- TimeUnit.SECONDS,
- () -> {
+ Awaitility
+ .await()
+ .atMost(Duration.ofSeconds(10))
+ .untilAsserted(() -> {
ConsumerRecords records = consumer.poll(Duration.ofMillis(100));
- if (records.isEmpty()) {
- return false;
- }
-
assertThat(records)
.hasSize(1)
.extracting(ConsumerRecord::topic, ConsumerRecord::key, ConsumerRecord::value)
.containsExactly(tuple(topicName, "testcontainers", "rulezzz"));
-
- return true;
- }
- );
+ });
consumer.unsubscribe();
}
diff --git a/examples/kafka-cluster/src/test/java/com/example/kafkacluster/KafkaContainerKraftCluster.java b/examples/kafka-cluster/src/test/java/com/example/kafkacluster/KafkaContainerKraftCluster.java
index 4411cb14540..264f751ecc6 100644
--- a/examples/kafka-cluster/src/test/java/com/example/kafkacluster/KafkaContainerKraftCluster.java
+++ b/examples/kafka-cluster/src/test/java/com/example/kafkacluster/KafkaContainerKraftCluster.java
@@ -1,7 +1,7 @@
package com.example.kafkacluster;
import org.apache.kafka.common.Uuid;
-import org.rnorth.ducttape.unreliables.Unreliables;
+import org.awaitility.Awaitility;
import org.testcontainers.containers.Container;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.KafkaContainer;
@@ -11,10 +11,11 @@
import java.time.Duration;
import java.util.Collection;
-import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
+import static org.assertj.core.api.Assertions.assertThat;
+
public class KafkaContainerKraftCluster implements Startable {
private final int brokersNum;
@@ -24,12 +25,14 @@ public class KafkaContainerKraftCluster implements Startable {
private final Collection brokers;
public KafkaContainerKraftCluster(String confluentPlatformVersion, int brokersNum, int internalTopicsRf) {
- if (brokersNum < 0) {
+ if (brokersNum <= 0) {
throw new IllegalArgumentException("brokersNum '" + brokersNum + "' must be greater than 0");
}
- if (internalTopicsRf < 0 || internalTopicsRf > brokersNum) {
+ if (internalTopicsRf <= 0 || internalTopicsRf > brokersNum) {
throw new IllegalArgumentException(
- "internalTopicsRf '" + internalTopicsRf + "' must be less than brokersNum and greater than 0"
+ "internalTopicsRf '" +
+ internalTopicsRf +
+ "' must be less than or equal to brokersNum and greater than 0"
);
}
@@ -79,10 +82,10 @@ public void start() {
// Needs to start all the brokers at once
brokers.parallelStream().forEach(GenericContainer::start);
- Unreliables.retryUntilTrue(
- 30,
- TimeUnit.SECONDS,
- () -> {
+ Awaitility
+ .await()
+ .atMost(Duration.ofSeconds(30))
+ .untilAsserted(() -> {
Container.ExecResult result =
this.brokers.stream()
.findFirst()
@@ -94,13 +97,12 @@ public void start() {
);
String brokers = result.getStdout().replace("\n", "");
- return brokers != null && Integer.valueOf(brokers) == this.brokersNum;
- }
- );
+ assertThat(brokers).asInt().isEqualTo(this.brokersNum);
+ });
}
@Override
public void stop() {
- this.brokers.stream().parallel().forEach(GenericContainer::stop);
+ this.brokers.parallelStream().forEach(GenericContainer::stop);
}
}
diff --git a/examples/linked-container/build.gradle b/examples/linked-container/build.gradle
deleted file mode 100644
index 7a3aa7156d9..00000000000
--- a/examples/linked-container/build.gradle
+++ /dev/null
@@ -1,17 +0,0 @@
-plugins {
- id 'java'
-}
-
-repositories {
- mavenCentral()
-}
-dependencies {
- compileOnly 'org.slf4j:slf4j-api:1.7.36'
- implementation 'com.squareup.okhttp3:okhttp:4.12.0'
- implementation 'org.json:json:20231013'
- testRuntimeOnly 'org.postgresql:postgresql:42.7.1'
- testImplementation 'ch.qos.logback:logback-classic:1.3.14'
- testImplementation 'org.testcontainers:postgresql'
- testImplementation 'org.assertj:assertj-core:3.25.2'
-}
-
diff --git a/examples/linked-container/src/main/java/com/example/linkedcontainer/RedmineClient.java b/examples/linked-container/src/main/java/com/example/linkedcontainer/RedmineClient.java
deleted file mode 100644
index c95ec133e2f..00000000000
--- a/examples/linked-container/src/main/java/com/example/linkedcontainer/RedmineClient.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package com.example.linkedcontainer;
-
-import okhttp3.OkHttpClient;
-import okhttp3.Request;
-import okhttp3.Response;
-import org.json.JSONObject;
-
-import java.io.IOException;
-
-/**
- * A crude, partially implemented Redmine client.
- */
-public class RedmineClient {
-
- private String url;
-
- private OkHttpClient client;
-
- public RedmineClient(String url) {
- this.url = url;
- client = new OkHttpClient();
- }
-
- public int getIssueCount() throws IOException {
- Request request = new Request.Builder().url(url + "/issues.json").build();
-
- Response response = client.newCall(request).execute();
- JSONObject jsonObject = new JSONObject(response.body().string());
- return jsonObject.getInt("total_count");
- }
-}
diff --git a/examples/linked-container/src/test/java/com/example/linkedcontainer/LinkedContainerTestImages.java b/examples/linked-container/src/test/java/com/example/linkedcontainer/LinkedContainerTestImages.java
deleted file mode 100644
index 8bbbafd189f..00000000000
--- a/examples/linked-container/src/test/java/com/example/linkedcontainer/LinkedContainerTestImages.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package com.example.linkedcontainer;
-
-import org.testcontainers.utility.DockerImageName;
-
-public interface LinkedContainerTestImages {
- DockerImageName POSTGRES_TEST_IMAGE = DockerImageName.parse("postgres:9.6.12");
- DockerImageName REDMINE_TEST_IMAGE = DockerImageName.parse("redmine:3.3.2");
-}
diff --git a/examples/linked-container/src/test/java/com/example/linkedcontainer/RedmineClientTest.java b/examples/linked-container/src/test/java/com/example/linkedcontainer/RedmineClientTest.java
deleted file mode 100644
index 721c00835c9..00000000000
--- a/examples/linked-container/src/test/java/com/example/linkedcontainer/RedmineClientTest.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package com.example.linkedcontainer;
-
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.RuleChain;
-import org.testcontainers.containers.PostgreSQLContainer;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-/**
- * Tests for RedmineClient.
- */
-public class RedmineClientTest {
-
- private static final String POSTGRES_USERNAME = "redmine";
-
- private static final String POSTGRES_PASSWORD = "secret";
-
- private PostgreSQLContainer> postgreSQLContainer = new PostgreSQLContainer<>(
- LinkedContainerTestImages.POSTGRES_TEST_IMAGE
- )
- .withUsername(POSTGRES_USERNAME)
- .withPassword(POSTGRES_PASSWORD);
-
- private RedmineContainer redmineContainer = new RedmineContainer(LinkedContainerTestImages.REDMINE_TEST_IMAGE)
- .withLinkToContainer(postgreSQLContainer, "postgres")
- .withEnv("POSTGRES_ENV_POSTGRES_USER", POSTGRES_USERNAME)
- .withEnv("POSTGRES_ENV_POSTGRES_PASSWORD", POSTGRES_PASSWORD);
-
- @Rule
- public RuleChain chain = RuleChain.outerRule(postgreSQLContainer).around(redmineContainer);
-
- @Test
- public void canGetIssueCount() throws Exception {
- RedmineClient redmineClient = new RedmineClient(redmineContainer.getRedmineUrl());
-
- assertThat(redmineClient.getIssueCount()).as("The issue count can be retrieved.").isZero();
- }
-}
diff --git a/examples/linked-container/src/test/java/com/example/linkedcontainer/RedmineContainer.java b/examples/linked-container/src/test/java/com/example/linkedcontainer/RedmineContainer.java
deleted file mode 100644
index 0f0bea36c1a..00000000000
--- a/examples/linked-container/src/test/java/com/example/linkedcontainer/RedmineContainer.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package com.example.linkedcontainer;
-
-import org.testcontainers.containers.GenericContainer;
-import org.testcontainers.containers.traits.LinkableContainer;
-import org.testcontainers.containers.wait.strategy.Wait;
-import org.testcontainers.utility.DockerImageName;
-
-/**
- * A Redmine container.
- */
-public class RedmineContainer extends GenericContainer {
-
- private static final int REDMINE_PORT = 3000;
-
- public RedmineContainer(DockerImageName dockerImageName) {
- super(dockerImageName);
- }
-
- @Override
- protected void configure() {
- addExposedPort(REDMINE_PORT);
- waitingFor(Wait.forHttp("/"));
- }
-
- public RedmineContainer withLinkToContainer(LinkableContainer otherContainer, String alias) {
- addLink(otherContainer, alias);
- return this;
- }
-
- public String getRedmineUrl() {
- return String.format("http://%s:%d", this.getHost(), this.getMappedPort(REDMINE_PORT));
- }
-}
diff --git a/examples/nats/build.gradle b/examples/nats/build.gradle
index e4b73de63c4..5e63a2d33a0 100644
--- a/examples/nats/build.gradle
+++ b/examples/nats/build.gradle
@@ -7,12 +7,13 @@ repositories {
}
dependencies {
- testImplementation 'org.assertj:assertj-core:3.25.2'
+ testImplementation 'org.assertj:assertj-core:3.27.4'
testImplementation 'org.testcontainers:testcontainers'
- testImplementation 'io.nats:jnats:2.17.2'
- testImplementation 'ch.qos.logback:logback-classic:1.3.14'
+ testImplementation 'io.nats:jnats:2.23.0'
+ testImplementation 'ch.qos.logback:logback-classic:1.3.15'
testImplementation 'org.apache.httpcomponents:httpclient:4.5.14'
- testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1'
+ testImplementation 'org.junit.jupiter:junit-jupiter:5.13.4'
+ testRuntimeOnly 'org.junit.platform:junit-platform-launcher:1.11.0'
}
test {
diff --git a/examples/neo4j-container/build.gradle b/examples/neo4j-container/build.gradle
index ab4fcec66c1..7a6eed0016d 100644
--- a/examples/neo4j-container/build.gradle
+++ b/examples/neo4j-container/build.gradle
@@ -7,9 +7,14 @@ repositories {
}
dependencies {
- testImplementation 'org.assertj:assertj-core:3.25.2'
- testImplementation 'org.neo4j.driver:neo4j-java-driver:4.4.13'
- testImplementation 'org.testcontainers:neo4j'
- testImplementation 'org.testcontainers:junit-jupiter'
- testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1'
+ testImplementation 'org.assertj:assertj-core:3.27.4'
+ testImplementation 'org.neo4j.driver:neo4j-java-driver:4.4.20'
+ testImplementation 'org.testcontainers:testcontainers-neo4j'
+ testImplementation 'org.testcontainers:testcontainers-junit-jupiter'
+ testImplementation 'org.junit.jupiter:junit-jupiter:5.13.4'
+ testRuntimeOnly 'org.junit.platform:junit-platform-launcher:1.11.0'
+}
+
+test {
+ useJUnitPlatform()
}
diff --git a/examples/neo4j-container/src/test/java/org/testcontainers/containers/Neo4jExampleTest.java b/examples/neo4j-container/src/test/java/org/testcontainers/containers/Neo4jExampleTest.java
index 38c22a0ff45..bc8770aaef0 100644
--- a/examples/neo4j-container/src/test/java/org/testcontainers/containers/Neo4jExampleTest.java
+++ b/examples/neo4j-container/src/test/java/org/testcontainers/containers/Neo4jExampleTest.java
@@ -22,7 +22,6 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.fail;
-// junitExample {
@Testcontainers
class Neo4jExampleTest {
@@ -68,4 +67,3 @@ void testSomethingUsingHttp() throws IOException {
}
}
}
-// }
diff --git a/examples/ollama-hugging-face/build.gradle b/examples/ollama-hugging-face/build.gradle
new file mode 100644
index 00000000000..1d747834acc
--- /dev/null
+++ b/examples/ollama-hugging-face/build.gradle
@@ -0,0 +1,20 @@
+plugins {
+ id 'java'
+}
+
+repositories {
+ mavenCentral()
+}
+
+dependencies {
+ testImplementation 'org.testcontainers:testcontainers-ollama'
+ testImplementation 'org.assertj:assertj-core:3.27.4'
+ testImplementation 'ch.qos.logback:logback-classic:1.3.15'
+ testImplementation 'org.junit.jupiter:junit-jupiter:5.13.4'
+ testImplementation 'io.rest-assured:rest-assured:5.5.6'
+ testRuntimeOnly 'org.junit.platform:junit-platform-launcher:1.11.0'
+}
+
+test {
+ useJUnitPlatform()
+}
diff --git a/examples/ollama-hugging-face/src/test/java/com/example/ollamahf/OllamaHuggingFaceContainer.java b/examples/ollama-hugging-face/src/test/java/com/example/ollamahf/OllamaHuggingFaceContainer.java
new file mode 100644
index 00000000000..58267134a5f
--- /dev/null
+++ b/examples/ollama-hugging-face/src/test/java/com/example/ollamahf/OllamaHuggingFaceContainer.java
@@ -0,0 +1,63 @@
+package com.example.ollamahf;
+
+import com.github.dockerjava.api.command.InspectContainerResponse;
+import org.testcontainers.containers.ContainerLaunchException;
+import org.testcontainers.ollama.OllamaContainer;
+import org.testcontainers.utility.DockerImageName;
+
+import java.io.IOException;
+
+public class OllamaHuggingFaceContainer extends OllamaContainer {
+
+ private final HuggingFaceModel huggingFaceModel;
+
+ public OllamaHuggingFaceContainer(HuggingFaceModel model) {
+ super(DockerImageName.parse("ollama/ollama:0.1.47"));
+ this.huggingFaceModel = model;
+ }
+
+ @Override
+ protected void containerIsStarted(InspectContainerResponse containerInfo, boolean reused) {
+ super.containerIsStarted(containerInfo, reused);
+ if (reused || huggingFaceModel == null) {
+ return;
+ }
+
+ try {
+ executeCommand("apt-get", "update");
+ executeCommand("apt-get", "upgrade", "-y");
+ executeCommand("apt-get", "install", "-y", "python3-pip");
+ executeCommand("pip", "install", "huggingface-hub");
+ executeCommand("hf", "download", huggingFaceModel.repository, huggingFaceModel.model, "--local-dir", ".");
+ executeCommand("sh", "-c", String.format("echo '%s' > Modelfile", huggingFaceModel.modelfileContent));
+ executeCommand("ollama", "create", huggingFaceModel.model, "-f", "Modelfile");
+ executeCommand("rm", huggingFaceModel.model);
+ } catch (IOException | InterruptedException e) {
+ throw new ContainerLaunchException(e.getMessage());
+ }
+ }
+
+ private void executeCommand(String... command) throws ContainerLaunchException, IOException, InterruptedException {
+ ExecResult execResult = execInContainer(command);
+ if (execResult.getExitCode() > 0) {
+ throw new ContainerLaunchException(
+ "Failed to execute " + String.join(" ", command) + ": " + execResult.getStdout()
+ );
+ }
+ }
+
+ public static class HuggingFaceModel {
+
+ public final String repository;
+
+ public final String model;
+
+ public String modelfileContent;
+
+ public HuggingFaceModel(String repository, String model) {
+ this.repository = repository;
+ this.model = model;
+ this.modelfileContent = "FROM " + model;
+ }
+ }
+}
diff --git a/examples/ollama-hugging-face/src/test/java/com/example/ollamahf/OllamaHuggingFaceTest.java b/examples/ollama-hugging-face/src/test/java/com/example/ollamahf/OllamaHuggingFaceTest.java
new file mode 100644
index 00000000000..fa9d5f7d7e4
--- /dev/null
+++ b/examples/ollama-hugging-face/src/test/java/com/example/ollamahf/OllamaHuggingFaceTest.java
@@ -0,0 +1,74 @@
+package com.example.ollamahf;
+
+import io.restassured.http.Header;
+import org.junit.jupiter.api.Test;
+import org.testcontainers.ollama.OllamaContainer;
+import org.testcontainers.utility.DockerImageName;
+
+import java.util.List;
+
+import static io.restassured.RestAssured.given;
+import static org.assertj.core.api.Assertions.assertThat;
+
+public class OllamaHuggingFaceTest {
+
+ @Test
+ public void embeddingModelWithHuggingFace() {
+ String repository = "CompendiumLabs/bge-small-en-v1.5-gguf";
+ String model = "bge-small-en-v1.5-q4_k_m.gguf";
+ String imageName = "embedding-model-from-hugging-face";
+ OllamaContainer ollama = new OllamaContainer(
+ DockerImageName.parse(imageName).asCompatibleSubstituteFor("ollama/ollama:0.1.47")
+ );
+ boolean imageExists = ollama
+ .getDockerClient()
+ .listImagesCmd()
+ .exec()
+ .stream()
+ .anyMatch(image -> image.getRepoTags()[0].equals(imageName + ":latest"));
+ if (!imageExists) {
+ createImage(imageName, repository, model);
+ }
+ ollama.start();
+
+ String modelName = given()
+ .baseUri(ollama.getEndpoint())
+ .get("/api/tags")
+ .jsonPath()
+ .getString("models[0].name");
+ assertThat(modelName).contains(model + ":latest");
+
+ List embedding = given()
+ .baseUri(ollama.getEndpoint())
+ .header(new Header("Content-Type", "application/json"))
+ .body(new EmbeddingRequest(model + ":latest", "Hello from Testcontainers!"))
+ .post("/api/embeddings")
+ .jsonPath()
+ .getList("embedding");
+
+ assertThat(embedding).isNotNull();
+ assertThat(embedding.isEmpty()).isFalse();
+ }
+
+ private static void createImage(String imageName, String repository, String model) {
+ OllamaHuggingFaceContainer.HuggingFaceModel hfModel = new OllamaHuggingFaceContainer.HuggingFaceModel(
+ repository,
+ model
+ );
+ OllamaHuggingFaceContainer huggingFaceContainer = new OllamaHuggingFaceContainer(hfModel);
+ huggingFaceContainer.start();
+ huggingFaceContainer.commitToImage(imageName);
+ }
+
+ public static class EmbeddingRequest {
+
+ public final String model;
+
+ public final String prompt;
+
+ public EmbeddingRequest(String model, String prompt) {
+ this.model = model;
+ this.prompt = prompt;
+ }
+ }
+}
diff --git a/examples/linked-container/src/test/resources/logback-test.xml b/examples/ollama-hugging-face/src/test/resources/logback-test.xml
similarity index 100%
rename from examples/linked-container/src/test/resources/logback-test.xml
rename to examples/ollama-hugging-face/src/test/resources/logback-test.xml
diff --git a/examples/redis-backed-cache-testng/build.gradle b/examples/redis-backed-cache-testng/build.gradle
index 1a3f717d506..f0d043ce978 100644
--- a/examples/redis-backed-cache-testng/build.gradle
+++ b/examples/redis-backed-cache-testng/build.gradle
@@ -8,13 +8,13 @@ repositories {
dependencies {
compileOnly 'org.slf4j:slf4j-api:1.7.36'
- implementation 'redis.clients:jedis:5.1.0'
- implementation 'com.google.code.gson:gson:2.10.1'
+ implementation 'redis.clients:jedis:6.2.0'
+ implementation 'com.google.code.gson:gson:2.13.2'
implementation 'com.google.guava:guava:23.0'
testImplementation 'org.testcontainers:testcontainers'
- testImplementation 'ch.qos.logback:logback-classic:1.3.14'
+ testImplementation 'ch.qos.logback:logback-classic:1.3.15'
testImplementation 'org.testng:testng:7.5.1'
- testImplementation 'org.assertj:assertj-core:3.25.2'
+ testImplementation 'org.assertj:assertj-core:3.27.4'
}
test {
diff --git a/examples/redis-backed-cache-testng/src/test/java/RedisBackedCacheTest.java b/examples/redis-backed-cache-testng/src/test/java/RedisBackedCacheTest.java
index 45c482c098e..0f97be3c336 100644
--- a/examples/redis-backed-cache-testng/src/test/java/RedisBackedCacheTest.java
+++ b/examples/redis-backed-cache-testng/src/test/java/RedisBackedCacheTest.java
@@ -17,7 +17,7 @@
*/
public class RedisBackedCacheTest {
- private static GenericContainer> redis = new GenericContainer<>(DockerImageName.parse("redis:3.0.6"))
+ private static GenericContainer> redis = new GenericContainer<>(DockerImageName.parse("redis:6-alpine"))
.withExposedPorts(6379);
private Cache cache;
diff --git a/examples/redis-backed-cache/build.gradle b/examples/redis-backed-cache/build.gradle
index 8ab9cac5ed9..5d20b6175dc 100644
--- a/examples/redis-backed-cache/build.gradle
+++ b/examples/redis-backed-cache/build.gradle
@@ -8,14 +8,15 @@ repositories {
dependencies {
compileOnly 'org.slf4j:slf4j-api:1.7.36'
- implementation 'redis.clients:jedis:5.1.0'
- implementation 'com.google.code.gson:gson:2.10.1'
+ implementation 'redis.clients:jedis:6.2.0'
+ implementation 'com.google.code.gson:gson:2.13.2'
implementation 'com.google.guava:guava:23.0'
testImplementation 'org.testcontainers:testcontainers'
- testImplementation 'org.testcontainers:junit-jupiter'
- testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1'
- testImplementation 'ch.qos.logback:logback-classic:1.3.14'
- testImplementation 'org.assertj:assertj-core:3.25.2'
+ testImplementation 'org.testcontainers:testcontainers-junit-jupiter'
+ testImplementation 'org.junit.jupiter:junit-jupiter:5.13.4'
+ testImplementation 'ch.qos.logback:logback-classic:1.3.15'
+ testImplementation 'org.assertj:assertj-core:3.27.4'
+ testRuntimeOnly 'org.junit.platform:junit-platform-launcher:1.11.0'
}
test {
diff --git a/examples/redis-backed-cache/src/test/java/RedisBackedCacheTest.java b/examples/redis-backed-cache/src/test/java/RedisBackedCacheTest.java
index de33245eb01..970fc0a58e5 100644
--- a/examples/redis-backed-cache/src/test/java/RedisBackedCacheTest.java
+++ b/examples/redis-backed-cache/src/test/java/RedisBackedCacheTest.java
@@ -19,7 +19,7 @@
class RedisBackedCacheTest {
@Container
- public GenericContainer> redis = new GenericContainer<>(DockerImageName.parse("redis:3.0.6"))
+ public GenericContainer> redis = new GenericContainer<>(DockerImageName.parse("redis:6-alpine"))
.withExposedPorts(6379);
private Cache cache;
diff --git a/examples/selenium-container/build.gradle b/examples/selenium-container/build.gradle
index d7b8c85510e..f1a8058e304 100644
--- a/examples/selenium-container/build.gradle
+++ b/examples/selenium-container/build.gradle
@@ -1,6 +1,6 @@
plugins {
id 'java'
- id 'org.springframework.boot' version '2.7.18'
+ id 'org.springframework.boot' version '3.5.6'
}
apply plugin: 'io.spring.dependency-management'
@@ -14,10 +14,9 @@ dependencies {
implementation 'org.seleniumhq.selenium:selenium-chrome-driver'
implementation 'org.springframework.boot:spring-boot-starter-web'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
- testImplementation 'org.testcontainers:selenium'
- testImplementation 'org.testcontainers:junit-jupiter'
- testImplementation 'org.assertj:assertj-core:3.25.2'
- testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1'
+ testImplementation 'org.testcontainers:testcontainers-selenium'
+ testImplementation 'org.testcontainers:testcontainers-junit-jupiter'
+ testImplementation 'org.assertj:assertj-core:3.27.4'
}
test {
diff --git a/examples/settings.gradle b/examples/settings.gradle
index 041e9ac89c9..b9b58a917bf 100644
--- a/examples/settings.gradle
+++ b/examples/settings.gradle
@@ -5,13 +5,12 @@ buildscript {
}
}
dependencies {
- classpath "gradle.plugin.ch.myniva.gradle:s3-build-cache:0.10.0"
- classpath "com.gradle.enterprise:com.gradle.enterprise.gradle.plugin:3.16"
- classpath "com.gradle:common-custom-user-data-gradle-plugin:1.12.1"
+ classpath "com.gradle.enterprise:com.gradle.enterprise.gradle.plugin:3.17.4"
+ classpath "com.gradle:common-custom-user-data-gradle-plugin:2.0.1"
}
}
-apply plugin: 'com.gradle.enterprise'
+apply plugin: 'com.gradle.develocity'
apply plugin: "com.gradle.common-custom-user-data-gradle-plugin"
rootProject.name = 'testcontainers-examples'
@@ -20,7 +19,6 @@ includeBuild '..'
// explicit include to allow Dependabot to autodiscover subprojects
include 'kafka-cluster'
-include 'linked-container'
include 'neo4j-container'
include 'redis-backed-cache'
include 'redis-backed-cache-testng'
@@ -35,6 +33,7 @@ include 'zookeeper'
include 'hazelcast'
include 'nats'
include 'sftp'
+include 'ollama-hugging-face'
ext.isCI = System.getenv("CI") != null
@@ -42,24 +41,20 @@ buildCache {
local {
enabled = !isCI
}
- remote(HttpBuildCache) {
- push = isCI && !System.getenv("READ_ONLY_REMOTE_GRADLE_CACHE") && System.getenv("GRADLE_ENTERPRISE_CACHE_PASSWORD")
+ remote(develocity.buildCache) {
+ push = isCI && !System.getenv("READ_ONLY_REMOTE_GRADLE_CACHE") && System.getenv("DEVELOCITY_ACCESS_KEY")
enabled = true
- url = 'https://ge.testcontainers.org/cache/'
- credentials {
- username = 'ci'
- password = System.getenv("GRADLE_ENTERPRISE_CACHE_PASSWORD")
- }
}
}
-gradleEnterprise {
+develocity {
buildScan {
server = "https://ge.testcontainers.org/"
- publishAlways()
- publishIfAuthenticated()
+ publishing.onlyIf {
+ it.authenticated
+ }
uploadInBackground = !isCI
- captureTaskInputFiles = true
+ capture.fileFingerprints = true
}
}
diff --git a/examples/sftp/build.gradle b/examples/sftp/build.gradle
index c37b815e6cc..d7e2dee0f45 100644
--- a/examples/sftp/build.gradle
+++ b/examples/sftp/build.gradle
@@ -7,11 +7,12 @@ repositories {
}
dependencies {
- testImplementation 'com.jcraft:jsch:0.1.55'
+ testImplementation 'com.github.mwiede:jsch:2.27.2'
testImplementation 'org.testcontainers:testcontainers'
- testImplementation 'org.assertj:assertj-core:3.25.2'
- testImplementation 'ch.qos.logback:logback-classic:1.3.14'
- testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1'
+ testImplementation 'org.assertj:assertj-core:3.27.4'
+ testImplementation 'ch.qos.logback:logback-classic:1.3.15'
+ testImplementation 'org.junit.jupiter:junit-jupiter:5.13.4'
+ testRuntimeOnly 'org.junit.platform:junit-platform-launcher:1.11.0'
}
test {
diff --git a/examples/sftp/src/test/java/org/example/SftpContainerTest.java b/examples/sftp/src/test/java/org/example/SftpContainerTest.java
index e54b5b72036..3a6593ea736 100644
--- a/examples/sftp/src/test/java/org/example/SftpContainerTest.java
+++ b/examples/sftp/src/test/java/org/example/SftpContainerTest.java
@@ -1,6 +1,7 @@
package org.example;
import com.jcraft.jsch.ChannelSftp;
+import com.jcraft.jsch.HostKey;
import com.jcraft.jsch.JSch;
import com.jcraft.jsch.Session;
import org.junit.jupiter.api.Test;
@@ -10,6 +11,7 @@
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
+import java.util.Base64;
import java.util.stream.Collectors;
import static org.assertj.core.api.Assertions.assertThat;
@@ -49,4 +51,55 @@ void test() throws Exception {
.noneMatch(item -> item.toString().contains("testcontainers/file.txt"));
}
}
+
+ @Test
+ void testHostKeyCheck() throws Exception {
+ try (
+ GenericContainer> sftp = new GenericContainer<>("atmoz/sftp:alpine-3.7")
+ .withCopyFileToContainer(
+ MountableFile.forClasspathResource("testcontainers/", 0777),
+ "/home/foo/upload/testcontainers"
+ )
+ .withCopyFileToContainer(
+ MountableFile.forClasspathResource("./ssh_host_rsa_key", 0400),
+ "/etc/ssh/ssh_host_rsa_key"
+ )
+ .withExposedPorts(22)
+ .withCommand("foo:pass:::upload")
+ ) {
+ sftp.start();
+ JSch jsch = new JSch();
+ Session jschSession = jsch.getSession("foo", sftp.getHost(), sftp.getMappedPort(22));
+ jschSession.setPassword("pass");
+ // hostKeyString is string starting with AAAA from file known_hosts or ssh_host_*_key.pub
+ // generate the files with:
+ // ssh-keygen -t rsa -b 3072 -f ssh_host_rsa_key < /dev/null
+ String hostKeyString =
+ "AAAAB3NzaC1yc2EAAAADAQABAAABgQCXMxVRzmFWxfrRB9XiZ/3HNM+xkYYE+IMGuOZD" +
+ "04M2ezU25XjT6cPajzpFmzTxR2qEpRCKHeVnSG5nT6UXQp7760brTN7m5sDasbMnHgYh" +
+ "fC/3of2k6qTR9X/JHRpgwzq5+6FtEe41w1H1dXoNIr4YTKnLijSp8MKqBtPPNUpzEVb9" +
+ "5YKZGdCDoCbbYOyS/Dc8azUDo0mqM542J3nA2Sq9HCP0BAv43hrTAtCZodkB5wo18exb" +
+ "fPKsjGtA3de2npybFoSRbavZmT8L/b2iHZX6FRaqLsbYGKtszCWu5OU7WBX5g5QVlLfO" +
+ "nGQ+LsF6d6pX5LlMwEU14uu4gNPvZFOaZXtHNHZqnBcjd/sMaw5N/atFsPgtQ0vYnrEA" +
+ "D6oDjj0uXMsnmgUWTZBi3q2GBWWPqhE+0ASb2xBQGa+tWWTVYbuuYlA7hUX0URK8FcLw" +
+ "4UOYJjscDjnjlvQkghd2esP5NxV1NXkG2XYNHnf1E/tH4+AHJzy+qOQom7ehda96FZ8=";
+ HostKey hostKey = new HostKey(sftp.getHost(), Base64.getDecoder().decode(hostKeyString));
+ jschSession.getHostKeyRepository().add(hostKey, null);
+ jschSession.connect();
+ ChannelSftp channel = (ChannelSftp) jschSession.openChannel("sftp");
+ channel.connect();
+ assertThat(channel.ls("/upload/testcontainers")).anyMatch(item -> item.toString().contains("file.txt"));
+ assertThat(
+ new BufferedReader(
+ new InputStreamReader(channel.get("/upload/testcontainers/file.txt"), StandardCharsets.UTF_8)
+ )
+ .lines()
+ .collect(Collectors.joining("\n"))
+ )
+ .contains("Testcontainers");
+ channel.rm("/upload/testcontainers/file.txt");
+ assertThat(channel.ls("/upload/testcontainers/"))
+ .noneMatch(item -> item.toString().contains("testcontainers/file.txt"));
+ }
+ }
}
diff --git a/examples/sftp/src/test/resources/ssh_host_rsa_key b/examples/sftp/src/test/resources/ssh_host_rsa_key
new file mode 100644
index 00000000000..9987990b63d
--- /dev/null
+++ b/examples/sftp/src/test/resources/ssh_host_rsa_key
@@ -0,0 +1,38 @@
+-----BEGIN OPENSSH PRIVATE KEY-----
+b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAABlwAAAAdzc2gtcn
+NhAAAAAwEAAQAAAYEAlzMVUc5hVsX60QfV4mf9xzTPsZGGBPiDBrjmQ9ODNns1NuV40+nD
+2o86RZs08UdqhKUQih3lZ0huZ0+lF0Ke++tG60ze5ubA2rGzJx4GIXwv96H9pOqk0fV/yR
+0aYMM6ufuhbRHuNcNR9XV6DSK+GEypy4o0qfDCqgbTzzVKcxFW/eWCmRnQg6Am22Dskvw3
+PGs1A6NJqjOeNid5wNkqvRwj9AQL+N4a0wLQmaHZAecKNfHsW3zyrIxrQN3Xtp6cmxaEkW
+2r2Zk/C/29oh2V+hUWqi7G2BirbMwlruTlO1gV+YOUFZS3zpxkPi7BeneqV+S5TMBFNeLr
+uIDT72RTmmV7RzR2apwXI3f7DGsOTf2rRbD4LUNL2J6xAA+qA449LlzLJ5oFFk2QYt6thg
+Vlj6oRPtAEm9sQUBmvrVlk1WG7rmJQO4VF9FESvBXC8OFDmCY7HA4545b0JIIXdnrD+TcV
+dTV5Btl2DR539RP7R+PgByc8vqjkKJu3oXWvehWfAAAFiPUCzjT1As40AAAAB3NzaC1yc2
+EAAAGBAJczFVHOYVbF+tEH1eJn/cc0z7GRhgT4gwa45kPTgzZ7NTbleNPpw9qPOkWbNPFH
+aoSlEIod5WdIbmdPpRdCnvvrRutM3ubmwNqxsyceBiF8L/eh/aTqpNH1f8kdGmDDOrn7oW
+0R7jXDUfV1eg0ivhhMqcuKNKnwwqoG0881SnMRVv3lgpkZ0IOgJttg7JL8NzxrNQOjSaoz
+njYnecDZKr0cI/QEC/jeGtMC0Jmh2QHnCjXx7Ft88qyMa0Dd17aenJsWhJFtq9mZPwv9va
+IdlfoVFqouxtgYq2zMJa7k5TtYFfmDlBWUt86cZD4uwXp3qlfkuUzARTXi67iA0+9kU5pl
+e0c0dmqcFyN3+wxrDk39q0Ww+C1DS9iesQAPqgOOPS5cyyeaBRZNkGLerYYFZY+qET7QBJ
+vbEFAZr61ZZNVhu65iUDuFRfRRErwVwvDhQ5gmOxwOOeOW9CSCF3Z6w/k3FXU1eQbZdg0e
+d/UT+0fj4AcnPL6o5Cibt6F1r3oVnwAAAAMBAAEAAAGALcv8wKcUx6423tqTN70M2qpN4H
+h2Egpd0YruwAuQWk+uWh7eXr2XI5uvaEbvHcfmZSAEJvmQMxz2x9cRZ763nhFxDTNe7qxl
+LLiXTZlj/P97HfQUej/SRYApQPbONxHbN1sW1Y0RTHqJWCJJojHsRzrtUSfe9Lxmkg54WH
+JJRxow8b1zNcFibYP0UQ2GCq1XY7cLOztZxDJXUQra74U300jzQOV65NoNYO2g1m/15YQg
+DR/mWf26GXZ8xAyN2pQm3wiI86kY1UP+2kVr38tGcJ+Xrm08Pav06IiEUdFAdDRLL0AWXY
+ZG25BBJn2VaPZoE5+MH7xRQ2BrqNUZ6ec8jTPZXWN6VyZCmn06KRblIRnv/NcMV5GH/lE9
+JbP/MnQQzsQAO0REfhcrdb66I6l0jMTwQcvSJyPXLVl1UvobzcF+CpcExsoaQj5U9cwhkG
+XRLqPhI76+L0L2kNefQ4yN5MhxWiajKUOknRITkvmNR+jJYsUN/ziODRevbakBzyqtAAAA
+wCpC6P+iJg19HdhNf6I2IUQErPoltUhA5bsUGmuseCn19Y3V5RmNa8+HHfbnMkUSoFzTvS
+j0l7rkxl0vvPmz0zr/2ehWiMbReFRy3hGl55AGPLE7pjIy08JIUcQm2jH8C3oeSKNwCrYV
++HWsOsQu4+/uOTgp6I46+iSLLG+xjH+5zLtvxa6+o+zLjAOSW4aweAw1WAXy8J4ylAv2nA
+n3g3Rfa7C0qZG1bZ63phcgv2BNzN+QgmORoh5v5ICvT+qJ5wAAAMEAwvdI3XsLV0uzNkAq
+C9aWyK4cAdphvCb8n0oz5Vrm6j/qFRXzcDZLtkMboCRE2qVqNLQjMiTJo/QjX9jxe7LD6c
+Vxtlcl2Ts8qrixFhKXJNwC/lq/TTe2dpMSYm61OINK3TiofZi6eff/ubcpq7zr3iVyWk5b
+wAVSun8q+Su7ziYYb+MuBQsKn5VWyoYK+E/LFItY26ulOxbrntB805JsXpjbYrL0KoXJCx
+6ZWdBVsvbD733WipNbPQZ+4JYDbun7AAAAwQDGiFOALlS5nidWFqMeMm/dGsHpwri0b10Z
+Bf/DPPxK6EuFKLUppt6KMl2zJjwVa2NqSTppz7TpUP6jC5pSglxtcvatEIRVF8KBxuIJ/G
+8Wav3Xuxu9nrRyKAzXjrjU+4TjAH1jBfTj3/tDdRagxt7JESirE+sYW5nie9XpzW4ehsf6
+fJacmwoiGdSCc4dldD8ZkEXcmCChFTH+PY3uYtiJr+znzbUZ1RLL3Uk2xHWOWSHz/1tUBy
+BFP58e3rYvNa0AAAAPYWFAMjMtMDcxNTMtMDA5AQIDBA==
+-----END OPENSSH PRIVATE KEY-----
diff --git a/examples/sftp/src/test/resources/ssh_host_rsa_key.pub b/examples/sftp/src/test/resources/ssh_host_rsa_key.pub
new file mode 100644
index 00000000000..57b3aebb050
--- /dev/null
+++ b/examples/sftp/src/test/resources/ssh_host_rsa_key.pub
@@ -0,0 +1 @@
+ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCXMxVRzmFWxfrRB9XiZ/3HNM+xkYYE+IMGuOZD04M2ezU25XjT6cPajzpFmzTxR2qEpRCKHeVnSG5nT6UXQp7760brTN7m5sDasbMnHgYhfC/3of2k6qTR9X/JHRpgwzq5+6FtEe41w1H1dXoNIr4YTKnLijSp8MKqBtPPNUpzEVb95YKZGdCDoCbbYOyS/Dc8azUDo0mqM542J3nA2Sq9HCP0BAv43hrTAtCZodkB5wo18exbfPKsjGtA3de2npybFoSRbavZmT8L/b2iHZX6FRaqLsbYGKtszCWu5OU7WBX5g5QVlLfOnGQ+LsF6d6pX5LlMwEU14uu4gNPvZFOaZXtHNHZqnBcjd/sMaw5N/atFsPgtQ0vYnrEAD6oDjj0uXMsnmgUWTZBi3q2GBWWPqhE+0ASb2xBQGa+tWWTVYbuuYlA7hUX0URK8FcLw4UOYJjscDjnjlvQkghd2esP5NxV1NXkG2XYNHnf1E/tH4+AHJzy+qOQom7ehda96FZ8= someone@localhost
diff --git a/examples/singleton-container/build.gradle b/examples/singleton-container/build.gradle
index 11cb89351e9..5db92c84a49 100644
--- a/examples/singleton-container/build.gradle
+++ b/examples/singleton-container/build.gradle
@@ -8,15 +8,16 @@ repositories {
dependencies {
- implementation 'redis.clients:jedis:5.1.0'
- implementation 'com.google.code.gson:gson:2.10.1'
+ implementation 'redis.clients:jedis:6.2.0'
+ implementation 'com.google.code.gson:gson:2.13.2'
implementation 'com.google.guava:guava:23.0'
compileOnly 'org.slf4j:slf4j-api:1.7.36'
- testImplementation 'ch.qos.logback:logback-classic:1.3.14'
+ testImplementation 'ch.qos.logback:logback-classic:1.3.15'
testImplementation 'org.testcontainers:testcontainers'
- testImplementation 'org.assertj:assertj-core:3.25.2'
- testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1'
+ testImplementation 'org.assertj:assertj-core:3.27.4'
+ testImplementation 'org.junit.jupiter:junit-jupiter:5.13.4'
+ testRuntimeOnly 'org.junit.platform:junit-platform-launcher:1.11.0'
}
test {
diff --git a/examples/singleton-container/src/test/java/com/example/AbstractIntegrationTest.java b/examples/singleton-container/src/test/java/com/example/AbstractIntegrationTest.java
index 729e9fb124d..654977d7a22 100644
--- a/examples/singleton-container/src/test/java/com/example/AbstractIntegrationTest.java
+++ b/examples/singleton-container/src/test/java/com/example/AbstractIntegrationTest.java
@@ -5,7 +5,7 @@
public abstract class AbstractIntegrationTest {
- public static final GenericContainer> redis = new GenericContainer<>(DockerImageName.parse("redis:3.0.6"))
+ public static final GenericContainer> redis = new GenericContainer<>(DockerImageName.parse("redis:6-alpine"))
.withExposedPorts(6379);
static {
diff --git a/examples/solr-container/build.gradle b/examples/solr-container/build.gradle
index 739a418c995..d0d3944cc0a 100644
--- a/examples/solr-container/build.gradle
+++ b/examples/solr-container/build.gradle
@@ -7,15 +7,16 @@ repositories {
}
dependencies {
- compileOnly "org.projectlombok:lombok:1.18.30"
- annotationProcessor "org.projectlombok:lombok:1.18.30"
+ compileOnly "org.projectlombok:lombok:1.18.38"
+ annotationProcessor "org.projectlombok:lombok:1.18.38"
- implementation 'org.apache.solr:solr-solrj:8.11.2'
+ implementation 'org.apache.solr:solr-solrj:8.11.4'
testImplementation 'org.testcontainers:testcontainers'
- testImplementation 'org.testcontainers:solr'
- testImplementation 'org.assertj:assertj-core:3.25.2'
- testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1'
+ testImplementation 'org.testcontainers:testcontainers-solr'
+ testImplementation 'org.assertj:assertj-core:3.27.4'
+ testImplementation 'org.junit.jupiter:junit-jupiter:5.13.4'
+ testRuntimeOnly 'org.junit.platform:junit-platform-launcher:1.11.0'
}
test {
diff --git a/examples/spring-boot-kotlin-redis/build.gradle.kts b/examples/spring-boot-kotlin-redis/build.gradle.kts
index a132efe1bba..2d5d6bf9640 100644
--- a/examples/spring-boot-kotlin-redis/build.gradle.kts
+++ b/examples/spring-boot-kotlin-redis/build.gradle.kts
@@ -1,9 +1,9 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
- id("org.springframework.boot") version "2.7.10"
- kotlin("jvm") version "1.8.10"
- kotlin("plugin.spring") version "1.8.20"
+ id("org.springframework.boot") version "2.7.18"
+ kotlin("jvm") version "1.8.22"
+ kotlin("plugin.spring") version "1.8.22"
}
java.sourceCompatibility = JavaVersion.VERSION_1_8
@@ -21,9 +21,7 @@ dependencies {
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("org.testcontainers:testcontainers")
- testImplementation("org.junit.jupiter:junit-jupiter:5.10.0")
-
-
+ testRuntimeOnly("org.junit.platform:junit-platform-launcher:1.8.2")
}
tasks.withType {
diff --git a/examples/spring-boot-kotlin-redis/src/test/kotlin/com/example/redis/AbstractIntegrationTest.kt b/examples/spring-boot-kotlin-redis/src/test/kotlin/com/example/redis/AbstractIntegrationTest.kt
index 045899ad721..6df81f56262 100644
--- a/examples/spring-boot-kotlin-redis/src/test/kotlin/com/example/redis/AbstractIntegrationTest.kt
+++ b/examples/spring-boot-kotlin-redis/src/test/kotlin/com/example/redis/AbstractIntegrationTest.kt
@@ -16,7 +16,7 @@ import org.testcontainers.containers.GenericContainer
abstract class AbstractIntegrationTest {
companion object {
- val redisContainer = GenericContainer("redis:3-alpine")
+ val redisContainer = GenericContainer("redis:6-alpine")
.apply { withExposedPorts(6379) }
}
diff --git a/examples/spring-boot/build.gradle b/examples/spring-boot/build.gradle
index 08fb733e14d..e3a40d27f06 100644
--- a/examples/spring-boot/build.gradle
+++ b/examples/spring-boot/build.gradle
@@ -16,8 +16,8 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
runtimeOnly 'org.postgresql:postgresql'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
- testImplementation 'org.testcontainers:postgresql'
- testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1'
+ testImplementation 'org.testcontainers:testcontainers-postgresql'
+ testRuntimeOnly "org.junit.platform:junit-platform-launcher:1.8.2"
}
test {
diff --git a/examples/spring-boot/src/test/java/com/example/AbstractIntegrationTest.java b/examples/spring-boot/src/test/java/com/example/AbstractIntegrationTest.java
index d3d1621cda1..806e63ed930 100644
--- a/examples/spring-boot/src/test/java/com/example/AbstractIntegrationTest.java
+++ b/examples/spring-boot/src/test/java/com/example/AbstractIntegrationTest.java
@@ -16,7 +16,7 @@
@ActiveProfiles("test")
abstract class AbstractIntegrationTest {
- static GenericContainer> redis = new GenericContainer<>(DockerImageName.parse("redis:3-alpine"))
+ static GenericContainer> redis = new GenericContainer<>(DockerImageName.parse("redis:6-alpine"))
.withExposedPorts(6379);
@DynamicPropertySource
diff --git a/examples/zookeeper/build.gradle b/examples/zookeeper/build.gradle
index 6a5ba605b19..4208f4ac266 100644
--- a/examples/zookeeper/build.gradle
+++ b/examples/zookeeper/build.gradle
@@ -7,11 +7,12 @@ repositories {
}
dependencies {
- testImplementation 'org.apache.curator:curator-framework:5.6.0'
+ testImplementation 'org.apache.curator:curator-framework:5.9.0'
testImplementation 'org.testcontainers:testcontainers'
- testImplementation 'org.assertj:assertj-core:3.25.2'
- testImplementation 'ch.qos.logback:logback-classic:1.3.14'
- testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1'
+ testImplementation 'org.assertj:assertj-core:3.27.4'
+ testImplementation 'ch.qos.logback:logback-classic:1.3.15'
+ testImplementation 'org.junit.jupiter:junit-jupiter:5.13.4'
+ testRuntimeOnly 'org.junit.platform:junit-platform-launcher:1.11.0'
}
test {
diff --git a/gradle.properties b/gradle.properties
index 4fb587917e9..f9e383482f4 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -1,4 +1,6 @@
org.gradle.parallel=false
org.gradle.caching=true
org.gradle.configureondemand=true
-testcontainers.version=1.19.4
+org.gradle.jvmargs=-Xmx2g
+
+testcontainers.version=2.0.5
diff --git a/gradle/publishing.gradle b/gradle/publishing.gradle
index 618ada345cc..3e3faaf08ce 100644
--- a/gradle/publishing.gradle
+++ b/gradle/publishing.gradle
@@ -1,4 +1,5 @@
apply plugin: 'maven-publish'
+apply plugin: 'org.jreleaser'
task sourceJar(type: Jar) {
archiveClassifier.set( 'sources')
@@ -95,10 +96,27 @@ publishing {
}
repositories {
maven {
- url("https://oss.sonatype.org/service/local/staging/deploy/maven2")
- credentials {
- username = System.getenv("OSSRH_USERNAME")
- password = System.getenv("OSSRH_PASSWORD")
+ url = rootProject.layout.buildDirectory.dir('staging-deploy')
+ }
+ }
+}
+
+jreleaser {
+ signing {
+ active = 'ALWAYS'
+ armored = true
+ }
+ deploy {
+ maven {
+ mavenCentral {
+ central {
+ active = 'ALWAYS'
+ url = 'https://central.sonatype.com/api/v1/publisher'
+ stagingRepository(rootProject.layout.buildDirectory.dir("staging-deploy").get().toString())
+ stage = 'UPLOAD'
+ applyMavenCentralRules = true
+ namespace = 'org.testcontainers'
+ }
}
}
}
diff --git a/gradle/shading.gradle b/gradle/shading.gradle
index fc7f6587b3e..88f25cc3f22 100644
--- a/gradle/shading.gradle
+++ b/gradle/shading.gradle
@@ -1,10 +1,10 @@
import java.util.jar.JarFile
-apply plugin: 'com.github.johnrengelman.shadow'
+apply plugin: 'com.gradleup.shadow'
configurations {
shaded
- [apiElements, implementation, compileOnly, testCompile]*.extendsFrom shaded
+ [apiElements, implementation]*.extendsFrom shaded
}
configurations.api.canBeResolved = true
@@ -30,7 +30,7 @@ project.afterEvaluate {
return it.dependencyProject.tasks.findByName("shadowJar")?.relocators ?: []
}
- // See https://github.com/johnrengelman/shadow/blob/5.0.0/src/main/groovy/com/github/jengelman/gradle/plugins/shadow/tasks/ConfigureShadowRelocation.groovy
+ // See https://github.com/GradleUp/shadow/blob/5.0.0/src/main/groovy/com/github/jengelman/gradle/plugins/shadow/tasks/ConfigureShadowRelocation.groovy
Set packages = []
for (artifact in project.configurations.shaded.resolvedConfiguration.resolvedArtifacts) {
diff --git a/gradle/spotless.gradle b/gradle/spotless.gradle
index ce71829331e..59b834dbad7 100644
--- a/gradle/spotless.gradle
+++ b/gradle/spotless.gradle
@@ -18,6 +18,6 @@ spotless {
}
groovyGradle {
target '**/*.groovy'
- greclipse('4.19.0')
+ greclipse('4.19')
}
}
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
index d64cd491770..1b33c55baab 100644
Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index a7a990ab2a8..dbc089ed3d7 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,7 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionSha256Sum=c16d517b50dd28b3f5838f0e844b7520b8f1eb610f2f29de7e4e04a1b7c9c79b
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-all.zip
+distributionSha256Sum=ed1a8d686605fd7c23bdf62c7fc7add1c5b23b2bbc3721e661934ef4a4911d7c
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
diff --git a/gradlew b/gradlew
index 1aa94a42690..23d15a93670 100755
--- a/gradlew
+++ b/gradlew
@@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
+# SPDX-License-Identifier: Apache-2.0
+#
##############################################################################
#
@@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
-# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
+# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -84,7 +86,7 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
-APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
+APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
@@ -112,7 +114,7 @@ case "$( uname )" in #(
NONSTOP* ) nonstop=true ;;
esac
-CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+CLASSPATH="\\\"\\\""
# Determine the Java command to use to start the JVM.
@@ -203,7 +205,7 @@ fi
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command:
-# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
+# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
@@ -211,7 +213,7 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
- org.gradle.wrapper.GradleWrapperMain \
+ -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
"$@"
# Stop when "xargs" is not available.
diff --git a/gradlew.bat b/gradlew.bat
index 6689b85beec..5eed7ee8452 100644
--- a/gradlew.bat
+++ b/gradlew.bat
@@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
+@rem SPDX-License-Identifier: Apache-2.0
+@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@@ -43,11 +45,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute
-echo.
-echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
+echo. 1>&2
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
+echo. 1>&2
+echo Please set the JAVA_HOME variable in your environment to match the 1>&2
+echo location of your Java installation. 1>&2
goto fail
@@ -57,22 +59,22 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
-echo.
-echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
+echo. 1>&2
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
+echo. 1>&2
+echo Please set the JAVA_HOME variable in your environment to match the 1>&2
+echo location of your Java installation. 1>&2
goto fail
:execute
@rem Setup the command line
-set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+set CLASSPATH=
@rem Execute Gradle
-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
:end
@rem End local scope for the variables with windows NT shell
diff --git a/mkdocs.yml b/mkdocs.yml
index de6030812e6..ae447212912 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -56,43 +56,59 @@ nav:
- modules/databases/couchbase.md
- modules/databases/clickhouse.md
- modules/databases/cratedb.md
+ - modules/databases/databend.md
- modules/databases/db2.md
- - modules/databases/dynalite.md
- modules/databases/influxdb.md
- modules/databases/mariadb.md
- modules/databases/mongodb.md
- modules/databases/mssqlserver.md
- modules/databases/mysql.md
- modules/databases/neo4j.md
+ - modules/databases/oceanbase.md
- modules/databases/oraclefree.md
- modules/databases/oraclexe.md
- modules/databases/orientdb.md
- modules/databases/postgres.md
- modules/databases/presto.md
- modules/databases/questdb.md
+ - modules/databases/scylladb.md
- modules/databases/tidb.md
+ - modules/databases/timeplus.md
- modules/databases/trino.md
- modules/databases/yugabytedb.md
- modules/activemq.md
- modules/azure.md
+ - modules/chromadb.md
- modules/consul.md
- modules/docker_compose.md
+ - modules/docker_mcp_gateway.md
+ - modules/docker_model_runner.md
- modules/elasticsearch.md
- modules/gcloud.md
+ - modules/grafana.md
- modules/hivemq.md
- modules/k3s.md
+ - modules/k6.md
- modules/kafka.md
+ - modules/ldap.md
- modules/localstack.md
+ - modules/milvus.md
- modules/minio.md
- modules/mockserver.md
- modules/nginx.md
+ - modules/ollama.md
+ - modules/openfga.md
+ - modules/pinecone.md
- modules/pulsar.md
+ - modules/qdrant.md
- modules/rabbitmq.md
- modules/redpanda.md
- modules/solace.md
- modules/solr.md
- modules/toxiproxy.md
+ - modules/typesense.md
- modules/vault.md
+ - modules/weaviate.md
- modules/webdriver_containers.md
- Test framework integration:
- test_framework_integration/junit_4.md
@@ -121,7 +137,6 @@ nav:
- Contributing:
- contributing.md
- contributing_docs.md
- - bounty.md
edit_uri: edit/main/docs/
extra:
- latest_version: 1.19.4
+ latest_version: 2.0.5
diff --git a/modules/activemq/build.gradle b/modules/activemq/build.gradle
index 66bf306fd49..c77b386698f 100644
--- a/modules/activemq/build.gradle
+++ b/modules/activemq/build.gradle
@@ -3,20 +3,6 @@ description = "Testcontainers :: ActiveMQ"
dependencies {
api project(':testcontainers')
- testImplementation 'org.assertj:assertj-core:3.25.1'
- testImplementation "org.apache.activemq:activemq-client:6.0.1"
- testImplementation "org.apache.activemq:artemis-jakarta-client:2.31.2"
-}
-
-test {
- javaLauncher = javaToolchains.launcherFor {
- languageVersion = JavaLanguageVersion.of(17)
- }
-}
-
-compileTestJava {
- javaCompiler = javaToolchains.compilerFor {
- languageVersion = JavaLanguageVersion.of(17)
- }
- options.release.set(11)
+ testImplementation "org.apache.activemq:activemq-client:6.2.4"
+ testImplementation "org.apache.activemq:artemis-jakarta-client:2.55.0"
}
diff --git a/modules/activemq/src/main/java/org/testcontainers/activemq/ActiveMQContainer.java b/modules/activemq/src/main/java/org/testcontainers/activemq/ActiveMQContainer.java
index 14814d95da9..9313efc55d6 100644
--- a/modules/activemq/src/main/java/org/testcontainers/activemq/ActiveMQContainer.java
+++ b/modules/activemq/src/main/java/org/testcontainers/activemq/ActiveMQContainer.java
@@ -21,7 +21,11 @@
*/
public class ActiveMQContainer extends GenericContainer {
- private static final DockerImageName DEFAULT_IMAGE = DockerImageName.parse("apache/activemq-classic");
+ private static final DockerImageName APACHE_ACTIVEMQ_CLASSIC_IMAGE = DockerImageName.parse(
+ "apache/activemq-classic"
+ );
+
+ private static final DockerImageName DEFAULT_IMAGE = DockerImageName.parse("apache/activemq");
private static final int WEB_CONSOLE_PORT = 8161;
@@ -45,7 +49,7 @@ public ActiveMQContainer(String image) {
public ActiveMQContainer(DockerImageName dockerImageName) {
super(dockerImageName);
- dockerImageName.assertCompatibleWith(DEFAULT_IMAGE);
+ dockerImageName.assertCompatibleWith(DEFAULT_IMAGE, APACHE_ACTIVEMQ_CLASSIC_IMAGE);
withExposedPorts(WEB_CONSOLE_PORT, TCP_PORT, AMQP_PORT, STOMP_PORT, MQTT_PORT, WS_PORT);
waitingFor(Wait.forLogMessage(".*Apache ActiveMQ.*started.*", 1).withStartupTimeout(Duration.ofMinutes(1)));
diff --git a/modules/activemq/src/main/java/org/testcontainers/activemq/ArtemisContainer.java b/modules/activemq/src/main/java/org/testcontainers/activemq/ArtemisContainer.java
index 7d4918a9306..82072993b48 100644
--- a/modules/activemq/src/main/java/org/testcontainers/activemq/ArtemisContainer.java
+++ b/modules/activemq/src/main/java/org/testcontainers/activemq/ArtemisContainer.java
@@ -9,6 +9,8 @@
/**
* Testcontainers implementation for Apache ActiveMQ Artemis.
*
+ * Exposed ports: 9042
+ */
+public class CassandraContainer extends GenericContainer {
+
+ private static final DockerImageName DEFAULT_IMAGE_NAME = DockerImageName.parse("cassandra");
+
+ private static final Integer CQL_PORT = 9042;
+
+ private static final String DEFAULT_LOCAL_DATACENTER = "datacenter1";
+
+ private static final String DEFAULT_INIT_SCRIPT_FILENAME = "init.cql";
+
+ private static final String CONTAINER_CONFIG_LOCATION = "/etc/cassandra";
+
+ private static final String USERNAME = "cassandra";
+
+ private static final String PASSWORD = "cassandra";
+
+ private String configLocation;
+
+ private String initScriptPath;
+
+ private String clientCertFile;
+
+ private String clientKeyFile;
+
+ public CassandraContainer(String dockerImageName) {
+ this(DockerImageName.parse(dockerImageName));
+ }
+
+ public CassandraContainer(DockerImageName dockerImageName) {
+ super(dockerImageName);
+ dockerImageName.assertCompatibleWith(DEFAULT_IMAGE_NAME);
+
+ addExposedPort(CQL_PORT);
+
+ withEnv("CASSANDRA_SNITCH", "GossipingPropertyFileSnitch");
+ withEnv("JVM_OPTS", "-Dcassandra.skip_wait_for_gossip_to_settle=0 -Dcassandra.initial_token=0");
+ withEnv("HEAP_NEWSIZE", "128M");
+ withEnv("MAX_HEAP_SIZE", "1024M");
+ withEnv("CASSANDRA_ENDPOINT_SNITCH", "GossipingPropertyFileSnitch");
+ withEnv("CASSANDRA_DC", DEFAULT_LOCAL_DATACENTER);
+
+ // Use the CassandraQueryWaitStrategy by default to avoid potential issues when the authentication is enabled.
+ waitingFor(new CassandraQueryWaitStrategy());
+ }
+
+ @Override
+ protected void configure() {
+ // Map (effectively replace) directory in Docker with the content of resourceLocation if resource location is
+ // not null.
+ Optional
+ .ofNullable(configLocation)
+ .map(MountableFile::forClasspathResource)
+ .ifPresent(mountableFile -> withCopyFileToContainer(mountableFile, CONTAINER_CONFIG_LOCATION));
+
+ // If a secure connection is required by Cassandra configuration, copy the user certificate and key to a
+ // dedicated location and define a cqlshrc file with the appropriate SSL configuration.
+ // See: https://docs.datastax.com/en/cassandra-oss/3.x/cassandra/configuration/secureCqlshSSL.html
+ if (isSslRequired()) {
+ withCopyFileToContainer(MountableFile.forClasspathResource(clientCertFile), "ssl/user_cert.pem");
+ withCopyFileToContainer(MountableFile.forClasspathResource(clientKeyFile), "ssl/user_key.pem");
+ withCopyFileToContainer(MountableFile.forClasspathResource("cqlshrc"), "/root/.cassandra/cqlshrc");
+ }
+ }
+
+ @Override
+ protected void containerIsStarted(InspectContainerResponse containerInfo) {
+ runInitScriptIfRequired();
+ }
+
+ /**
+ * Load init script content and apply it to the database if initScriptPath is set
+ */
+ private void runInitScriptIfRequired() {
+ if (this.initScriptPath != null) {
+ try {
+ final MountableFile originalInitScript = MountableFile.forClasspathResource(this.initScriptPath);
+ // The init script is executed as is by the cqlsh command, so copy it into the container. The name
+ // of the script is generic since it's not important to keep the original name.
+ copyFileToContainer(originalInitScript, DEFAULT_INIT_SCRIPT_FILENAME);
+ new CassandraDatabaseDelegate(this).execute(null, DEFAULT_INIT_SCRIPT_FILENAME, -1, false, false);
+ } catch (IllegalArgumentException e) {
+ // MountableFile.forClasspathResource will throw an IllegalArgumentException if the resource cannot
+ // be found.
+ logger().warn("Could not load classpath init script: {}", this.initScriptPath);
+ throw new ScriptLoadException(
+ "Could not load classpath init script: " + this.initScriptPath + ". Resource not found.",
+ e
+ );
+ } catch (ScriptUtils.ScriptStatementFailedException e) {
+ logger().error("Error while executing init script: {}", this.initScriptPath, e);
+ throw new ScriptUtils.UncategorizedScriptException(
+ "Error while executing init script: " + this.initScriptPath,
+ e
+ );
+ }
+ }
+ }
+
+ /**
+ * Initialize Cassandra with the custom overridden Cassandra configuration
+ *
+ * Be aware, that Docker effectively replaces all /etc/cassandra content with the content of config location, so if
+ * Cassandra.yaml in configLocation is absent or corrupted, then Cassandra just won't launch.
+ *
+ * @param configLocation relative classpath with the directory that contains cassandra.yaml and other configuration
+ * files
+ * @return The updated {@link CassandraContainer}.
+ */
+ public CassandraContainer withConfigurationOverride(String configLocation) {
+ this.configLocation = configLocation;
+ return self();
+ }
+
+ /**
+ * Initialize Cassandra with init CQL script
+ *
+ * CQL script will be applied after container is started (see using WaitStrategy).
+ *
+ *
+ * @param initScriptPath relative classpath resource
+ * @return The updated {@link CassandraContainer}.
+ */
+ public CassandraContainer withInitScript(String initScriptPath) {
+ this.initScriptPath = initScriptPath;
+ return self();
+ }
+
+ /**
+ * Configure secured connection (TLS) when required by the Cassandra configuration
+ * (i.e. cassandra.yaml file contains the property {@code client_encryption_options.optional} with value
+ * {@code false}).
+ *
+ * @param clientCertFile The client certificate required to execute CQL scripts.
+ * @param clientKeyFile The client key required to execute CQL scripts.
+ * @return The updated {@link CassandraContainer}.
+ */
+ public CassandraContainer withSsl(String clientCertFile, String clientKeyFile) {
+ this.clientCertFile = clientCertFile;
+ this.clientKeyFile = clientKeyFile;
+ return self();
+ }
+
+ /**
+ * @return Whether a secure connection is required between the client and the Cassandra server.
+ */
+ boolean isSslRequired() {
+ return StringUtils.isNoneBlank(this.clientCertFile, this.clientKeyFile);
+ }
+
+ /**
+ * Get username
+ *
+ * By default, Cassandra has authenticator: AllowAllAuthenticator in cassandra.yaml
+ * If username and password need to be used, then authenticator should be set as PasswordAuthenticator
+ * (through custom Cassandra configuration) and through CQL with default cassandra-cassandra credentials
+ * user management should be modified
+ */
+ public String getUsername() {
+ return USERNAME;
+ }
+
+ /**
+ * Get password
+ *
+ * By default, Cassandra has authenticator: AllowAllAuthenticator in cassandra.yaml
+ * If username and password need to be used, then authenticator should be set as PasswordAuthenticator
+ * (through custom Cassandra configuration) and through CQL with default cassandra-cassandra credentials
+ * user management should be modified
+ */
+ public String getPassword() {
+ return PASSWORD;
+ }
+
+ /**
+ * Retrieve an {@link InetSocketAddress} for connecting to the Cassandra container via the driver.
+ *
+ * @return A InetSocketAddress representation of this Cassandra container's host and port.
+ */
+ public InetSocketAddress getContactPoint() {
+ return new InetSocketAddress(getHost(), getMappedPort(CQL_PORT));
+ }
+
+ /**
+ * Retrieve the Local Datacenter for connecting to the Cassandra container via the driver.
+ *
+ * @return The configured local Datacenter name.
+ */
+ public String getLocalDatacenter() {
+ return getEnvMap().getOrDefault("CASSANDRA_DC", DEFAULT_LOCAL_DATACENTER);
+ }
+}
diff --git a/modules/cassandra/src/main/java/org/testcontainers/cassandra/CassandraDatabaseDelegate.java b/modules/cassandra/src/main/java/org/testcontainers/cassandra/CassandraDatabaseDelegate.java
new file mode 100644
index 00000000000..4867b8423e9
--- /dev/null
+++ b/modules/cassandra/src/main/java/org/testcontainers/cassandra/CassandraDatabaseDelegate.java
@@ -0,0 +1,98 @@
+package org.testcontainers.cassandra;
+
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.ArrayUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.testcontainers.containers.Container;
+import org.testcontainers.containers.ContainerState;
+import org.testcontainers.containers.ExecConfig;
+import org.testcontainers.delegate.AbstractDatabaseDelegate;
+import org.testcontainers.ext.ScriptUtils.ScriptStatementFailedException;
+
+import java.io.IOException;
+
+/**
+ * Cassandra database delegate
+ */
+@Slf4j
+@RequiredArgsConstructor
+public class CassandraDatabaseDelegate extends AbstractDatabaseDelegate {
+
+ private final ContainerState container;
+
+ @Override
+ protected Void createNewConnection() {
+ // Return null here, because we run scripts using cqlsh command directly in the container.
+ // So, we don't use connection object in the execute() method.
+ return null;
+ }
+
+ public void execute(
+ String statement,
+ String scriptPath,
+ int lineNumber,
+ boolean continueOnError,
+ boolean ignoreFailedDrops,
+ boolean silentErrorLogs
+ ) {
+ try {
+ // Use cqlsh command directly inside the container to execute statements
+ // See documentation here: https://cassandra.apache.org/doc/stable/cassandra/tools/cqlsh.html
+ String[] cqlshCommand = new String[] { "cqlsh" };
+
+ if (this.container instanceof CassandraContainer) {
+ CassandraContainer cassandraContainer = (CassandraContainer) this.container;
+ String username = cassandraContainer.getUsername();
+ String password = cassandraContainer.getPassword();
+ if (cassandraContainer.isSslRequired()) {
+ cqlshCommand = ArrayUtils.add(cqlshCommand, "--ssl");
+ }
+ cqlshCommand = ArrayUtils.addAll(cqlshCommand, "-u", username, "-p", password);
+ }
+
+ // If no statement specified, directly execute the script specified into scriptPath (using -f argument),
+ // otherwise execute the given statement (using -e argument).
+ String executeArg = "-e";
+ String executeArgValue = statement;
+ if (StringUtils.isBlank(statement)) {
+ executeArg = "-f";
+ executeArgValue = scriptPath;
+ }
+ cqlshCommand = ArrayUtils.addAll(cqlshCommand, executeArg, executeArgValue);
+
+ Container.ExecResult result =
+ this.container.execInContainer(ExecConfig.builder().command(cqlshCommand).build());
+ if (result.getExitCode() == 0) {
+ if (StringUtils.isBlank(statement)) {
+ log.info("CQL script {} successfully executed", scriptPath);
+ } else {
+ log.info("CQL statement {} was applied", statement);
+ }
+ } else {
+ if (!silentErrorLogs) {
+ log.error("CQL script execution failed with error: \n{}", result.getStderr());
+ }
+ throw new ScriptStatementFailedException(statement, lineNumber, scriptPath);
+ }
+ } catch (IOException | InterruptedException e) {
+ throw new ScriptStatementFailedException(statement, lineNumber, scriptPath, e);
+ }
+ }
+
+ @Override
+ public void execute(
+ String statement,
+ String scriptPath,
+ int lineNumber,
+ boolean continueOnError,
+ boolean ignoreFailedDrops
+ ) {
+ this.execute(statement, scriptPath, lineNumber, continueOnError, ignoreFailedDrops, false);
+ }
+
+ @Override
+ protected void closeConnectionQuietly(Void session) {
+ // Nothing to do here, because we run scripts using cqlsh command directly in the container.
+ }
+}
diff --git a/modules/cassandra/src/main/java/org/testcontainers/cassandra/CassandraQueryWaitStrategy.java b/modules/cassandra/src/main/java/org/testcontainers/cassandra/CassandraQueryWaitStrategy.java
new file mode 100644
index 00000000000..19fdcd7f9e1
--- /dev/null
+++ b/modules/cassandra/src/main/java/org/testcontainers/cassandra/CassandraQueryWaitStrategy.java
@@ -0,0 +1,57 @@
+package org.testcontainers.cassandra;
+
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.rnorth.ducttape.TimeoutException;
+import org.testcontainers.containers.ContainerLaunchException;
+import org.testcontainers.containers.wait.strategy.AbstractWaitStrategy;
+import org.testcontainers.delegate.DatabaseDelegate;
+
+import java.util.concurrent.TimeUnit;
+
+import static org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess;
+
+/**
+ * Waits until Cassandra returns its version
+ */
+@Slf4j
+public class CassandraQueryWaitStrategy extends AbstractWaitStrategy {
+
+ private static final String SELECT_VERSION_QUERY = "SELECT release_version FROM system.local";
+
+ private static final String TIMEOUT_ERROR = "Timed out waiting for Cassandra to be accessible for query execution";
+
+ @Override
+ protected void waitUntilReady() {
+ // execute select version query until success or timeout
+ try {
+ retryUntilSuccess(
+ (int) startupTimeout.getSeconds(),
+ TimeUnit.SECONDS,
+ () -> {
+ getRateLimiter()
+ .doWhenReady(() -> {
+ try (DatabaseDelegate databaseDelegate = getDatabaseDelegate()) {
+ log.info("Checking connection is ready...");
+ ((CassandraDatabaseDelegate) databaseDelegate).execute(
+ SELECT_VERSION_QUERY,
+ StringUtils.EMPTY,
+ 1,
+ false,
+ false,
+ true
+ );
+ }
+ });
+ return true;
+ }
+ );
+ } catch (TimeoutException e) {
+ throw new ContainerLaunchException(TIMEOUT_ERROR);
+ }
+ }
+
+ private DatabaseDelegate getDatabaseDelegate() {
+ return new CassandraDatabaseDelegate(waitStrategyTarget);
+ }
+}
diff --git a/modules/cassandra/src/main/java/org/testcontainers/containers/CassandraContainer.java b/modules/cassandra/src/main/java/org/testcontainers/containers/CassandraContainer.java
index bb291cd1f80..fcaada177ce 100644
--- a/modules/cassandra/src/main/java/org/testcontainers/containers/CassandraContainer.java
+++ b/modules/cassandra/src/main/java/org/testcontainers/containers/CassandraContainer.java
@@ -24,7 +24,10 @@
* Supported image: {@code cassandra}
*
* Exposed ports: 9042
+ *
+ * @deprecated use {@link org.testcontainers.cassandra.CassandraContainer} instead.
*/
+@Deprecated
public class CassandraContainer> extends GenericContainer {
private static final DockerImageName DEFAULT_IMAGE_NAME = DockerImageName.parse("cassandra");
@@ -225,7 +228,7 @@ public static Cluster getCluster(ContainerState containerState) {
/**
* Retrieve an {@link InetSocketAddress} for connecting to the Cassandra container via the driver.
*
- * @return A InetSocketAddrss representation of this Cassandra container's host and port.
+ * @return A InetSocketAddress representation of this Cassandra container's host and port.
*/
public InetSocketAddress getContactPoint() {
return new InetSocketAddress(getHost(), getMappedPort(CQL_PORT));
diff --git a/modules/cassandra/src/main/java/org/testcontainers/containers/delegate/CassandraDatabaseDelegate.java b/modules/cassandra/src/main/java/org/testcontainers/containers/delegate/CassandraDatabaseDelegate.java
index 8d604822083..7b7739490ea 100644
--- a/modules/cassandra/src/main/java/org/testcontainers/containers/delegate/CassandraDatabaseDelegate.java
+++ b/modules/cassandra/src/main/java/org/testcontainers/containers/delegate/CassandraDatabaseDelegate.java
@@ -13,9 +13,12 @@
/**
* Cassandra database delegate
+ *
+ * @deprecated use {@link org.testcontainers.cassandra.CassandraDatabaseDelegate} instead.
*/
@Slf4j
@RequiredArgsConstructor
+@Deprecated
public class CassandraDatabaseDelegate extends AbstractDatabaseDelegate {
private final ContainerState container;
diff --git a/modules/cassandra/src/main/java/org/testcontainers/containers/wait/CassandraQueryWaitStrategy.java b/modules/cassandra/src/main/java/org/testcontainers/containers/wait/CassandraQueryWaitStrategy.java
index cffb1ba757e..9694711de6e 100644
--- a/modules/cassandra/src/main/java/org/testcontainers/containers/wait/CassandraQueryWaitStrategy.java
+++ b/modules/cassandra/src/main/java/org/testcontainers/containers/wait/CassandraQueryWaitStrategy.java
@@ -12,7 +12,10 @@
/**
* Waits until Cassandra returns its version
+ *
+ * @deprecated use {@link org.testcontainers.cassandra.CassandraQueryWaitStrategy} instead.
*/
+@Deprecated
public class CassandraQueryWaitStrategy extends AbstractWaitStrategy {
private static final String SELECT_VERSION_QUERY = "SELECT release_version FROM system.local";
diff --git a/modules/cassandra/src/main/resources/cqlshrc b/modules/cassandra/src/main/resources/cqlshrc
new file mode 100644
index 00000000000..02e001098af
--- /dev/null
+++ b/modules/cassandra/src/main/resources/cqlshrc
@@ -0,0 +1,7 @@
+[ssl]
+certfile = ssl/user_cert.pem
+usercert = ssl/user_cert.pem
+userkey = ssl/user_key.pem
+
+[connection]
+factory = cqlshlib.ssl.ssl_transport_factory
\ No newline at end of file
diff --git a/modules/cassandra/src/test/java/org/testcontainers/cassandra/CassandraContainerTest.java b/modules/cassandra/src/test/java/org/testcontainers/cassandra/CassandraContainerTest.java
new file mode 100644
index 00000000000..49243317a40
--- /dev/null
+++ b/modules/cassandra/src/test/java/org/testcontainers/cassandra/CassandraContainerTest.java
@@ -0,0 +1,272 @@
+package org.testcontainers.cassandra;
+
+import com.datastax.oss.driver.api.core.CqlSession;
+import com.datastax.oss.driver.api.core.CqlSessionBuilder;
+import com.datastax.oss.driver.api.core.config.DefaultDriverOption;
+import com.datastax.oss.driver.api.core.config.DriverConfigLoader;
+import com.datastax.oss.driver.api.core.config.ProgrammaticDriverConfigLoaderBuilder;
+import com.datastax.oss.driver.api.core.context.DriverContext;
+import com.datastax.oss.driver.api.core.cql.ResultSet;
+import com.datastax.oss.driver.api.core.cql.Row;
+import com.datastax.oss.driver.api.core.session.ProgrammaticArguments;
+import com.datastax.oss.driver.internal.core.context.DefaultDriverContext;
+import com.datastax.oss.driver.internal.core.ssl.DefaultSslEngineFactory;
+import org.junit.jupiter.api.Test;
+import org.testcontainers.containers.Container;
+import org.testcontainers.containers.ContainerLaunchException;
+import org.testcontainers.utility.DockerImageName;
+
+import java.net.URL;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+import static org.assertj.core.api.Assertions.fail;
+
+class CassandraContainerTest {
+
+ private static final String CASSANDRA_IMAGE = "cassandra:3.11.15";
+
+ private static final String TEST_CLUSTER_NAME_IN_CONF = "Test Cluster Integration Test";
+
+ private static final String BASIC_QUERY = "SELECT release_version FROM system.local";
+
+ @Test
+ void testSimple() {
+ try ( // container-definition {
+ CassandraContainer cassandraContainer = new CassandraContainer(CASSANDRA_IMAGE)
+ // }
+ ) {
+ cassandraContainer.start();
+ ResultSet resultSet = performQuery(cassandraContainer, BASIC_QUERY);
+ assertThat(resultSet.wasApplied()).as("Query was applied").isTrue();
+ assertThat(resultSet.one().getString(0)).as("Result set has release_version").isNotNull();
+ }
+ }
+
+ @Test
+ void testSpecificVersion() {
+ String cassandraVersion = "3.0.15";
+ try (
+ CassandraContainer cassandraContainer = new CassandraContainer(
+ DockerImageName.parse("cassandra").withTag(cassandraVersion)
+ )
+ ) {
+ cassandraContainer.start();
+ ResultSet resultSet = performQuery(cassandraContainer, BASIC_QUERY);
+ assertThat(resultSet.wasApplied()).as("Query was applied").isTrue();
+ assertThat(resultSet.one().getString(0)).as("Cassandra has right version").isEqualTo(cassandraVersion);
+ }
+ }
+
+ @Test
+ void testConfigurationOverride() {
+ try (
+ CassandraContainer cassandraContainer = new CassandraContainer(CASSANDRA_IMAGE)
+ .withConfigurationOverride("cassandra-test-configuration-example")
+ ) {
+ cassandraContainer.start();
+ ResultSet resultSet = performQuery(cassandraContainer, "SELECT cluster_name FROM system.local");
+ assertThat(resultSet.wasApplied()).as("Query was applied").isTrue();
+ assertThat(resultSet.one().getString(0))
+ .as("Cassandra configuration is overridden")
+ .isEqualTo(TEST_CLUSTER_NAME_IN_CONF);
+ }
+ }
+
+ @Test
+ public void testWithSslClientConfig() {
+ /*
+ Commands executed to generate certificates in 'cassandra-ssl-configuration' directory:
+ keytool -genkey -keyalg RSA -validity 36500 -alias localhost -keystore keystore.p12 -storepass cassandra \
+ -keypass cassandra -dname "CN=localhost, OU=Testcontainers, O=Testcontainers, L=None, C=None"
+ keytool -export -alias localhost -file cassandra.cer -keystore keystore.p12
+ keytool -import -v -trustcacerts -alias localhost -file cassandra.cer -keystore truststore.p12
+
+ Commands executed to generate the client certificate and key in 'client-ssl' directory:
+ keytool -importkeystore -srckeystore keystore.p12 -destkeystore test_node.p12 -deststoretype PKCS12 \
+ -srcstorepass cassandra -deststorepass cassandra
+ openssl pkcs12 -in test_node.p12 -nokeys -out cassandra.cer.pem -passin pass:cassandra
+ openssl pkcs12 -in test_node.p12 -nodes -nocerts -out cassandra.key.pem -passin pass:cassandra
+
+ Reference:
+ https://docs.datastax.com/en/cassandra-oss/3.x/cassandra/configuration/secureSSLCertificates.html
+ https://docs.datastax.com/en/cassandra-oss/3.x/cassandra/configuration/secureCqlshSSL.html
+ */
+ try (
+ // with-ssl-config {
+ CassandraContainer cassandraContainer = new CassandraContainer(CASSANDRA_IMAGE)
+ .withConfigurationOverride("cassandra-ssl-configuration")
+ .withSsl("client-ssl/cassandra.cer.pem", "client-ssl/cassandra.key.pem")
+ // }
+ ) {
+ cassandraContainer.start();
+ try {
+ ResultSet resultSet = performQueryWithSslClientConfig(
+ cassandraContainer,
+ "SELECT cluster_name FROM system.local"
+ );
+ assertThat(resultSet.wasApplied()).as("Query was applied").isTrue();
+ assertThat(resultSet.one().getString(0))
+ .as("Cassandra configuration is configured with secured connection")
+ .isEqualTo(TEST_CLUSTER_NAME_IN_CONF);
+ } catch (Exception e) {
+ fail(e);
+ }
+ }
+ }
+
+ @Test
+ public void testSimpleSslCqlsh() {
+ try (
+ CassandraContainer cassandraContainer = new CassandraContainer(CASSANDRA_IMAGE)
+ .withConfigurationOverride("cassandra-ssl-configuration")
+ .withSsl("client-ssl/cassandra.cer.pem", "client-ssl/cassandra.key.pem")
+ ) {
+ cassandraContainer.start();
+
+ Container.ExecResult execResult = cassandraContainer.execInContainer(
+ "cqlsh",
+ "--ssl",
+ "-e",
+ "SELECT * FROM system_schema.keyspaces;"
+ );
+ assertThat(execResult.getStdout()).contains("keyspace_name");
+ } catch (Exception e) {
+ fail(e);
+ }
+ }
+
+ @Test
+ void testEmptyConfigurationOverride() {
+ try (
+ CassandraContainer cassandraContainer = new CassandraContainer(CASSANDRA_IMAGE)
+ .withConfigurationOverride("cassandra-empty-configuration")
+ ) {
+ assertThatThrownBy(cassandraContainer::start).isInstanceOf(ContainerLaunchException.class);
+ }
+ }
+
+ @Test
+ void testInitScript() {
+ try (
+ CassandraContainer cassandraContainer = new CassandraContainer(CASSANDRA_IMAGE)
+ .withInitScript("initial.cql")
+ ) {
+ cassandraContainer.start();
+ testInitScript(cassandraContainer, false);
+ }
+ }
+
+ @Test
+ void testNonexistentInitScript() {
+ try (
+ CassandraContainer cassandraContainer = new CassandraContainer(CASSANDRA_IMAGE)
+ .withInitScript("unknown_script.cql")
+ ) {
+ assertThatThrownBy(cassandraContainer::start).isInstanceOf(ContainerLaunchException.class);
+ }
+ }
+
+ @Test
+ void testInitScriptWithRequiredAuthentication() {
+ try (
+ // init-with-auth {
+ CassandraContainer cassandraContainer = new CassandraContainer(CASSANDRA_IMAGE)
+ .withConfigurationOverride("cassandra-auth-required-configuration")
+ .withInitScript("initial.cql")
+ // }
+ ) {
+ cassandraContainer.start();
+ testInitScript(cassandraContainer, true);
+ }
+ }
+
+ @Test
+ void testInitScriptWithError() {
+ try (
+ CassandraContainer cassandraContainer = new CassandraContainer(CASSANDRA_IMAGE)
+ .withInitScript("initial-with-error.cql")
+ ) {
+ assertThatThrownBy(cassandraContainer::start).isInstanceOf(ContainerLaunchException.class);
+ }
+ }
+
+ @Test
+ void testInitScriptWithLegacyCassandra() {
+ try (
+ CassandraContainer cassandraContainer = new CassandraContainer("cassandra:2.2.11")
+ .withInitScript("initial.cql")
+ ) {
+ cassandraContainer.start();
+ testInitScript(cassandraContainer, false);
+ }
+ }
+
+ private void testInitScript(CassandraContainer cassandraContainer, boolean withCredentials) {
+ String query = "SELECT * FROM keySpaceTest.catalog_category";
+ ResultSet resultSet;
+
+ if (withCredentials) {
+ resultSet = performQueryWithAuth(cassandraContainer, query);
+ } else {
+ resultSet = performQuery(cassandraContainer, query);
+ }
+
+ assertThat(resultSet.wasApplied()).as("Query was applied").isTrue();
+ Row row = resultSet.one();
+ assertThat(row.getLong(0)).as("Inserted row is in expected state").isEqualTo(1);
+ assertThat(row.getString(1)).as("Inserted row is in expected state").isEqualTo("test_category");
+ }
+
+ private ResultSet performQuery(CassandraContainer cassandraContainer, String cql) {
+ // cql-session {
+ final CqlSession cqlSession = CqlSession
+ .builder()
+ .addContactPoint(cassandraContainer.getContactPoint())
+ .withLocalDatacenter(cassandraContainer.getLocalDatacenter())
+ .build();
+ // }
+ return performQuery(cqlSession, cql);
+ }
+
+ private ResultSet performQueryWithAuth(CassandraContainer cassandraContainer, String cql) {
+ final CqlSession cqlSession = CqlSession
+ .builder()
+ .addContactPoint(cassandraContainer.getContactPoint())
+ .withLocalDatacenter(cassandraContainer.getLocalDatacenter())
+ .withAuthCredentials(cassandraContainer.getUsername(), cassandraContainer.getPassword())
+ .build();
+ return performQuery(cqlSession, cql);
+ }
+
+ private ResultSet performQueryWithSslClientConfig(CassandraContainer cassandraContainer, String cql) {
+ final ProgrammaticDriverConfigLoaderBuilder driverConfigLoaderBuilder = DriverConfigLoader.programmaticBuilder();
+ driverConfigLoaderBuilder.withBoolean(DefaultDriverOption.SSL_HOSTNAME_VALIDATION, false);
+ final URL trustStoreUrl =
+ this.getClass().getClassLoader().getResource("cassandra-ssl-configuration/truststore.p12");
+ driverConfigLoaderBuilder.withString(DefaultDriverOption.SSL_TRUSTSTORE_PATH, trustStoreUrl.getFile());
+ driverConfigLoaderBuilder.withString(DefaultDriverOption.SSL_TRUSTSTORE_PASSWORD, "cassandra");
+ final URL keyStoreUrl =
+ this.getClass().getClassLoader().getResource("cassandra-ssl-configuration/keystore.p12");
+ driverConfigLoaderBuilder.withString(DefaultDriverOption.SSL_KEYSTORE_PATH, keyStoreUrl.getFile());
+ driverConfigLoaderBuilder.withString(DefaultDriverOption.SSL_KEYSTORE_PASSWORD, "cassandra");
+ final DriverContext driverContext = new DefaultDriverContext(
+ driverConfigLoaderBuilder.build(),
+ ProgrammaticArguments.builder().build()
+ );
+
+ final CqlSessionBuilder sessionBuilder = CqlSession.builder();
+ final CqlSession cqlSession = sessionBuilder
+ .addContactPoint(cassandraContainer.getContactPoint())
+ .withLocalDatacenter(cassandraContainer.getLocalDatacenter())
+ .withSslEngineFactory(new DefaultSslEngineFactory(driverContext))
+ .build();
+ return performQuery(cqlSession, cql);
+ }
+
+ private ResultSet performQuery(CqlSession session, String cql) {
+ final ResultSet rs = session.execute(cql);
+ session.close();
+ return rs;
+ }
+}
diff --git a/modules/cassandra/src/test/java/org/testcontainers/cassandra/CompatibleCassandraImageTest.java b/modules/cassandra/src/test/java/org/testcontainers/cassandra/CompatibleCassandraImageTest.java
new file mode 100644
index 00000000000..15d8e209911
--- /dev/null
+++ b/modules/cassandra/src/test/java/org/testcontainers/cassandra/CompatibleCassandraImageTest.java
@@ -0,0 +1,44 @@
+package org.testcontainers.cassandra;
+
+import com.datastax.oss.driver.api.core.CqlIdentifier;
+import com.datastax.oss.driver.api.core.CqlSession;
+import com.datastax.oss.driver.api.core.metadata.schema.KeyspaceMetadata;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+class CompatibleCassandraImageTest {
+
+ public static String[] params() {
+ return new String[] { "cassandra:3.11.2", "cassandra:4.1.1", "cassandra:5" };
+ }
+
+ @ParameterizedTest
+ @MethodSource("params")
+ void testCassandraGetContactPoint(String imageName) {
+ try (CassandraContainer cassandra = new CassandraContainer(imageName)) {
+ cassandra.start();
+ assertCassandraFunctionality(cassandra);
+ }
+ }
+
+ private void assertCassandraFunctionality(CassandraContainer cassandra) {
+ try (
+ CqlSession session = CqlSession
+ .builder()
+ .addContactPoint(cassandra.getContactPoint())
+ .withLocalDatacenter(cassandra.getLocalDatacenter())
+ .build()
+ ) {
+ session.execute(
+ "CREATE KEYSPACE IF NOT EXISTS test WITH replication = \n" +
+ "{'class':'SimpleStrategy','replication_factor':'1'};"
+ );
+
+ KeyspaceMetadata keyspace = session.getMetadata().getKeyspaces().get(CqlIdentifier.fromCql("test"));
+
+ assertThat(keyspace).as("test keyspace created").isNotNull();
+ }
+ }
+}
diff --git a/modules/cassandra/src/test/java/org/testcontainers/containers/CassandraContainerTest.java b/modules/cassandra/src/test/java/org/testcontainers/containers/CassandraContainerTest.java
index eb3a8b068ea..2d534bccc81 100644
--- a/modules/cassandra/src/test/java/org/testcontainers/containers/CassandraContainerTest.java
+++ b/modules/cassandra/src/test/java/org/testcontainers/containers/CassandraContainerTest.java
@@ -5,14 +5,15 @@
import com.datastax.driver.core.Row;
import com.datastax.driver.core.Session;
import lombok.extern.slf4j.Slf4j;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.testcontainers.containers.wait.CassandraQueryWaitStrategy;
import org.testcontainers.utility.DockerImageName;
import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
@Slf4j
-public class CassandraContainerTest {
+class CassandraContainerTest {
private static final DockerImageName CASSANDRA_IMAGE = DockerImageName.parse("cassandra:3.11.2");
@@ -21,7 +22,7 @@ public class CassandraContainerTest {
private static final String BASIC_QUERY = "SELECT release_version FROM system.local";
@Test
- public void testSimple() {
+ void testSimple() {
try (CassandraContainer> cassandraContainer = new CassandraContainer<>(CASSANDRA_IMAGE)) {
cassandraContainer.start();
ResultSet resultSet = performQuery(cassandraContainer, BASIC_QUERY);
@@ -31,7 +32,7 @@ public void testSimple() {
}
@Test
- public void testSpecificVersion() {
+ void testSpecificVersion() {
String cassandraVersion = "3.0.15";
try (
CassandraContainer> cassandraContainer = new CassandraContainer<>(
@@ -46,7 +47,7 @@ public void testSpecificVersion() {
}
@Test
- public void testConfigurationOverride() {
+ void testConfigurationOverride() {
try (
CassandraContainer> cassandraContainer = new CassandraContainer<>(CASSANDRA_IMAGE)
.withConfigurationOverride("cassandra-test-configuration-example")
@@ -60,18 +61,18 @@ public void testConfigurationOverride() {
}
}
- @Test(expected = ContainerLaunchException.class)
- public void testEmptyConfigurationOverride() {
+ @Test
+ void testEmptyConfigurationOverride() {
try (
CassandraContainer> cassandraContainer = new CassandraContainer<>(CASSANDRA_IMAGE)
.withConfigurationOverride("cassandra-empty-configuration")
) {
- cassandraContainer.start();
+ assertThatThrownBy(cassandraContainer::start).isInstanceOf(ContainerLaunchException.class);
}
}
@Test
- public void testInitScript() {
+ void testInitScript() {
try (
CassandraContainer> cassandraContainer = new CassandraContainer<>(CASSANDRA_IMAGE)
.withInitScript("initial.cql")
@@ -82,7 +83,7 @@ public void testInitScript() {
}
@Test
- public void testInitScriptWithLegacyCassandra() {
+ void testInitScriptWithLegacyCassandra() {
try (
CassandraContainer> cassandraContainer = new CassandraContainer<>(
DockerImageName.parse("cassandra:2.2.11")
@@ -96,7 +97,7 @@ public void testInitScriptWithLegacyCassandra() {
@SuppressWarnings("deprecation") // Using deprecated constructor for verification of backwards compatibility
@Test
- public void testCassandraQueryWaitStrategy() {
+ void testCassandraQueryWaitStrategy() {
try (
CassandraContainer> cassandraContainer = new CassandraContainer<>()
.waitingFor(new CassandraQueryWaitStrategy())
@@ -109,7 +110,7 @@ public void testCassandraQueryWaitStrategy() {
@SuppressWarnings("deprecation") // Using deprecated constructor for verification of backwards compatibility
@Test
- public void testCassandraGetCluster() {
+ void testCassandraGetCluster() {
try (CassandraContainer> cassandraContainer = new CassandraContainer<>()) {
cassandraContainer.start();
ResultSet resultSet = performQuery(cassandraContainer.getCluster(), BASIC_QUERY);
diff --git a/modules/cassandra/src/test/java/org/testcontainers/containers/CassandraDriver3Test.java b/modules/cassandra/src/test/java/org/testcontainers/containers/CassandraDriver3Test.java
deleted file mode 100644
index 502f2ca8e67..00000000000
--- a/modules/cassandra/src/test/java/org/testcontainers/containers/CassandraDriver3Test.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package org.testcontainers.containers;
-
-import com.datastax.oss.driver.api.core.CqlIdentifier;
-import com.datastax.oss.driver.api.core.CqlSession;
-import com.datastax.oss.driver.api.core.metadata.schema.KeyspaceMetadata;
-import org.junit.Rule;
-import org.junit.Test;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class CassandraDriver3Test {
-
- @Rule
- public CassandraContainer> cassandra = new CassandraContainer<>("cassandra:3.11.2");
-
- @Test
- public void testCassandraGetContactPoint() {
- try (
- // cassandra {
- CqlSession session = CqlSession
- .builder()
- .addContactPoint(this.cassandra.getContactPoint())
- .withLocalDatacenter(this.cassandra.getLocalDatacenter())
- .build()
- // }
- ) {
- session.execute(
- "CREATE KEYSPACE IF NOT EXISTS test WITH replication = \n" +
- "{'class':'SimpleStrategy','replication_factor':'1'};"
- );
-
- KeyspaceMetadata keyspace = session.getMetadata().getKeyspaces().get(CqlIdentifier.fromCql("test"));
-
- assertThat(keyspace).as("keyspace created").isNotNull();
- }
- }
-}
diff --git a/modules/cassandra/src/test/java/org/testcontainers/containers/CassandraServer4Test.java b/modules/cassandra/src/test/java/org/testcontainers/containers/CassandraServer4Test.java
deleted file mode 100644
index 1a8447e7036..00000000000
--- a/modules/cassandra/src/test/java/org/testcontainers/containers/CassandraServer4Test.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package org.testcontainers.containers;
-
-import com.datastax.oss.driver.api.core.CqlIdentifier;
-import com.datastax.oss.driver.api.core.CqlSession;
-import com.datastax.oss.driver.api.core.metadata.schema.KeyspaceMetadata;
-import org.junit.Rule;
-import org.junit.Test;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class CassandraServer4Test {
-
- @Rule
- public CassandraContainer> cassandra = new CassandraContainer<>("cassandra:4.1.1");
-
- @Test
- public void testCassandraGetContactPoint() {
- try (
- CqlSession session = CqlSession
- .builder()
- .addContactPoint(this.cassandra.getContactPoint())
- .withLocalDatacenter(this.cassandra.getLocalDatacenter())
- .build()
- ) {
- session.execute(
- "CREATE KEYSPACE IF NOT EXISTS test WITH replication = \n" +
- "{'class':'SimpleStrategy','replication_factor':'1'};"
- );
-
- KeyspaceMetadata keyspace = session.getMetadata().getKeyspaces().get(CqlIdentifier.fromCql("test"));
-
- assertThat(keyspace).as("test keyspace created").isNotNull();
- }
- }
-}
diff --git a/modules/cassandra/src/test/java/org/testcontainers/containers/CassandraDriver4Test.java b/modules/cassandra/src/test/java/org/testcontainers/containers/CompatibleCassandraImageTest.java
similarity index 50%
rename from modules/cassandra/src/test/java/org/testcontainers/containers/CassandraDriver4Test.java
rename to modules/cassandra/src/test/java/org/testcontainers/containers/CompatibleCassandraImageTest.java
index a4fb8c87b8e..aec27566beb 100644
--- a/modules/cassandra/src/test/java/org/testcontainers/containers/CassandraDriver4Test.java
+++ b/modules/cassandra/src/test/java/org/testcontainers/containers/CompatibleCassandraImageTest.java
@@ -3,23 +3,32 @@
import com.datastax.oss.driver.api.core.CqlIdentifier;
import com.datastax.oss.driver.api.core.CqlSession;
import com.datastax.oss.driver.api.core.metadata.schema.KeyspaceMetadata;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
import static org.assertj.core.api.Assertions.assertThat;
-public class CassandraDriver4Test {
+public class CompatibleCassandraImageTest {
- @Rule
- public CassandraContainer> cassandra = new CassandraContainer<>("cassandra:3.11.2");
+ public static String[] params() {
+ return new String[] { "cassandra:3.11.2", "cassandra:4.1.1" };
+ }
+
+ @ParameterizedTest
+ @MethodSource("params")
+ void testCassandraGetContactPoint(String imageName) {
+ try (CassandraContainer> cassandra = new CassandraContainer<>(imageName)) {
+ cassandra.start();
+ assertCassandraFunctionality(cassandra);
+ }
+ }
- @Test
- public void testCassandraGetContactPoint() {
+ private void assertCassandraFunctionality(CassandraContainer> cassandra) {
try (
CqlSession session = CqlSession
.builder()
- .addContactPoint(this.cassandra.getContactPoint())
- .withLocalDatacenter(this.cassandra.getLocalDatacenter())
+ .addContactPoint(cassandra.getContactPoint())
+ .withLocalDatacenter(cassandra.getLocalDatacenter())
.build()
) {
session.execute(
diff --git a/modules/cassandra/src/test/resources/cassandra-auth-required-configuration/cassandra.yaml b/modules/cassandra/src/test/resources/cassandra-auth-required-configuration/cassandra.yaml
new file mode 100644
index 00000000000..7425881b8fe
--- /dev/null
+++ b/modules/cassandra/src/test/resources/cassandra-auth-required-configuration/cassandra.yaml
@@ -0,0 +1,1233 @@
+# Cassandra storage config YAML
+
+# NOTE:
+# See http://wiki.apache.org/cassandra/StorageConfiguration for
+# full explanations of configuration directives
+# /NOTE
+
+# The name of the cluster. This is mainly used to prevent machines in
+# one logical cluster from joining another.
+cluster_name: 'Test Cluster Integration Test'
+
+# This defines the number of tokens randomly assigned to this node on the ring
+# The more tokens, relative to other nodes, the larger the proportion of data
+# that this node will store. You probably want all nodes to have the same number
+# of tokens assuming they have equal hardware capability.
+#
+# If you leave this unspecified, Cassandra will use the default of 1 token for legacy compatibility,
+# and will use the initial_token as described below.
+#
+# Specifying initial_token will override this setting on the node's initial start,
+# on subsequent starts, this setting will apply even if initial token is set.
+#
+# If you already have a cluster with 1 token per node, and wish to migrate to
+# multiple tokens per node, see http://wiki.apache.org/cassandra/Operations
+num_tokens: 256
+
+# Triggers automatic allocation of num_tokens tokens for this node. The allocation
+# algorithm attempts to choose tokens in a way that optimizes replicated load over
+# the nodes in the datacenter for the replication strategy used by the specified
+# keyspace.
+#
+# The load assigned to each node will be close to proportional to its number of
+# vnodes.
+#
+# Only supported with the Murmur3Partitioner.
+# allocate_tokens_for_keyspace: KEYSPACE
+
+# initial_token allows you to specify tokens manually. While you can use it with
+# vnodes (num_tokens > 1, above) -- in which case you should provide a
+# comma-separated list -- it's primarily used when adding nodes to legacy clusters
+# that do not have vnodes enabled.
+# initial_token:
+
+# See http://wiki.apache.org/cassandra/HintedHandoff
+# May either be "true" or "false" to enable globally
+hinted_handoff_enabled: true
+
+# When hinted_handoff_enabled is true, a black list of data centers that will not
+# perform hinted handoff
+# hinted_handoff_disabled_datacenters:
+# - DC1
+# - DC2
+
+# this defines the maximum amount of time a dead host will have hints
+# generated. After it has been dead this long, new hints for it will not be
+# created until it has been seen alive and gone down again.
+max_hint_window_in_ms: 10800000 # 3 hours
+
+# Maximum throttle in KBs per second, per delivery thread. This will be
+# reduced proportionally to the number of nodes in the cluster. (If there
+# are two nodes in the cluster, each delivery thread will use the maximum
+# rate; if there are three, each will throttle to half of the maximum,
+# since we expect two nodes to be delivering hints simultaneously.)
+hinted_handoff_throttle_in_kb: 1024
+
+# Number of threads with which to deliver hints;
+# Consider increasing this number when you have multi-dc deployments, since
+# cross-dc handoff tends to be slower
+max_hints_delivery_threads: 2
+
+# Directory where Cassandra should store hints.
+# If not set, the default directory is $CASSANDRA_HOME/data/hints.
+# hints_directory: /var/lib/cassandra/hints
+
+# How often hints should be flushed from the internal buffers to disk.
+# Will *not* trigger fsync.
+hints_flush_period_in_ms: 10000
+
+# Maximum size for a single hints file, in megabytes.
+max_hints_file_size_in_mb: 128
+
+# Compression to apply to the hint files. If omitted, hints files
+# will be written uncompressed. LZ4, Snappy, and Deflate compressors
+# are supported.
+#hints_compression:
+# - class_name: LZ4Compressor
+# parameters:
+# -
+
+# Maximum throttle in KBs per second, total. This will be
+# reduced proportionally to the number of nodes in the cluster.
+batchlog_replay_throttle_in_kb: 1024
+
+# Authentication backend, implementing IAuthenticator; used to identify users
+# Out of the box, Cassandra provides org.apache.cassandra.auth.{AllowAllAuthenticator,
+# PasswordAuthenticator}.
+#
+# - AllowAllAuthenticator performs no checks - set it to disable authentication.
+# - PasswordAuthenticator relies on username/password pairs to authenticate
+# users. It keeps usernames and hashed passwords in system_auth.roles table.
+# Please increase system_auth keyspace replication factor if you use this authenticator.
+# If using PasswordAuthenticator, CassandraRoleManager must also be used (see below)
+authenticator: PasswordAuthenticator
+
+# Authorization backend, implementing IAuthorizer; used to limit access/provide permissions
+# Out of the box, Cassandra provides org.apache.cassandra.auth.{AllowAllAuthorizer,
+# CassandraAuthorizer}.
+#
+# - AllowAllAuthorizer allows any action to any user - set it to disable authorization.
+# - CassandraAuthorizer stores permissions in system_auth.role_permissions table. Please
+# increase system_auth keyspace replication factor if you use this authorizer.
+authorizer: AllowAllAuthorizer
+
+# Part of the Authentication & Authorization backend, implementing IRoleManager; used
+# to maintain grants and memberships between roles.
+# Out of the box, Cassandra provides org.apache.cassandra.auth.CassandraRoleManager,
+# which stores role information in the system_auth keyspace. Most functions of the
+# IRoleManager require an authenticated login, so unless the configured IAuthenticator
+# actually implements authentication, most of this functionality will be unavailable.
+#
+# - CassandraRoleManager stores role data in the system_auth keyspace. Please
+# increase system_auth keyspace replication factor if you use this role manager.
+role_manager: CassandraRoleManager
+
+# Validity period for roles cache (fetching granted roles can be an expensive
+# operation depending on the role manager, CassandraRoleManager is one example)
+# Granted roles are cached for authenticated sessions in AuthenticatedUser and
+# after the period specified here, become eligible for (async) reload.
+# Defaults to 2000, set to 0 to disable caching entirely.
+# Will be disabled automatically for AllowAllAuthenticator.
+roles_validity_in_ms: 2000
+
+# Refresh interval for roles cache (if enabled).
+# After this interval, cache entries become eligible for refresh. Upon next
+# access, an async reload is scheduled and the old value returned until it
+# completes. If roles_validity_in_ms is non-zero, then this must be
+# also.
+# Defaults to the same value as roles_validity_in_ms.
+# roles_update_interval_in_ms: 2000
+
+# Validity period for permissions cache (fetching permissions can be an
+# expensive operation depending on the authorizer, CassandraAuthorizer is
+# one example). Defaults to 2000, set to 0 to disable.
+# Will be disabled automatically for AllowAllAuthorizer.
+permissions_validity_in_ms: 2000
+
+# Refresh interval for permissions cache (if enabled).
+# After this interval, cache entries become eligible for refresh. Upon next
+# access, an async reload is scheduled and the old value returned until it
+# completes. If permissions_validity_in_ms is non-zero, then this must be
+# also.
+# Defaults to the same value as permissions_validity_in_ms.
+# permissions_update_interval_in_ms: 2000
+
+# Validity period for credentials cache. This cache is tightly coupled to
+# the provided PasswordAuthenticator implementation of IAuthenticator. If
+# another IAuthenticator implementation is configured, this cache will not
+# be automatically used and so the following settings will have no effect.
+# Please note, credentials are cached in their encrypted form, so while
+# activating this cache may reduce the number of queries made to the
+# underlying table, it may not bring a significant reduction in the
+# latency of individual authentication attempts.
+# Defaults to 2000, set to 0 to disable credentials caching.
+credentials_validity_in_ms: 2000
+
+# Refresh interval for credentials cache (if enabled).
+# After this interval, cache entries become eligible for refresh. Upon next
+# access, an async reload is scheduled and the old value returned until it
+# completes. If credentials_validity_in_ms is non-zero, then this must be
+# also.
+# Defaults to the same value as credentials_validity_in_ms.
+# credentials_update_interval_in_ms: 2000
+
+# The partitioner is responsible for distributing groups of rows (by
+# partition key) across nodes in the cluster. You should leave this
+# alone for new clusters. The partitioner can NOT be changed without
+# reloading all data, so when upgrading you should set this to the
+# same partitioner you were already using.
+#
+# Besides Murmur3Partitioner, partitioners included for backwards
+# compatibility include RandomPartitioner, ByteOrderedPartitioner, and
+# OrderPreservingPartitioner.
+#
+partitioner: org.apache.cassandra.dht.Murmur3Partitioner
+
+# Directories where Cassandra should store data on disk. Cassandra
+# will spread data evenly across them, subject to the granularity of
+# the configured compaction strategy.
+# If not set, the default directory is $CASSANDRA_HOME/data/data.
+data_file_directories:
+ - /var/lib/cassandra/data
+
+# commit log. when running on magnetic HDD, this should be a
+# separate spindle than the data directories.
+# If not set, the default directory is $CASSANDRA_HOME/data/commitlog.
+commitlog_directory: /var/lib/cassandra/commitlog
+
+# Enable / disable CDC functionality on a per-node basis. This modifies the logic used
+# for write path allocation rejection (standard: never reject. cdc: reject Mutation
+# containing a CDC-enabled table if at space limit in cdc_raw_directory).
+cdc_enabled: false
+
+# CommitLogSegments are moved to this directory on flush if cdc_enabled: true and the
+# segment contains mutations for a CDC-enabled table. This should be placed on a
+# separate spindle than the data directories. If not set, the default directory is
+# $CASSANDRA_HOME/data/cdc_raw.
+# cdc_raw_directory: /var/lib/cassandra/cdc_raw
+
+# Policy for data disk failures:
+#
+# die
+# shut down gossip and client transports and kill the JVM for any fs errors or
+# single-sstable errors, so the node can be replaced.
+#
+# stop_paranoid
+# shut down gossip and client transports even for single-sstable errors,
+# kill the JVM for errors during startup.
+#
+# stop
+# shut down gossip and client transports, leaving the node effectively dead, but
+# can still be inspected via JMX, kill the JVM for errors during startup.
+#
+# best_effort
+# stop using the failed disk and respond to requests based on
+# remaining available sstables. This means you WILL see obsolete
+# data at CL.ONE!
+#
+# ignore
+# ignore fatal errors and let requests fail, as in pre-1.2 Cassandra
+disk_failure_policy: stop
+
+# Policy for commit disk failures:
+#
+# die
+# shut down gossip and Thrift and kill the JVM, so the node can be replaced.
+#
+# stop
+# shut down gossip and Thrift, leaving the node effectively dead, but
+# can still be inspected via JMX.
+#
+# stop_commit
+# shutdown the commit log, letting writes collect but
+# continuing to service reads, as in pre-2.0.5 Cassandra
+#
+# ignore
+# ignore fatal errors and let the batches fail
+commit_failure_policy: stop
+
+# Maximum size of the native protocol prepared statement cache
+#
+# Valid values are either "auto" (omitting the value) or a value greater 0.
+#
+# Note that specifying a too large value will result in long running GCs and possibly
+# out-of-memory errors. Keep the value at a small fraction of the heap.
+#
+# If you constantly see "prepared statements discarded in the last minute because
+# cache limit reached" messages, the first step is to investigate the root cause
+# of these messages and check whether prepared statements are used correctly -
+# i.e. use bind markers for variable parts.
+#
+# Do only change the default value, if you really have more prepared statements than
+# fit in the cache. In most cases it is not necessary to change this value.
+# Constantly re-preparing statements is a performance penalty.
+#
+# Default value ("auto") is 1/256th of the heap or 10MB, whichever is greater
+prepared_statements_cache_size_mb:
+
+# Maximum size of the Thrift prepared statement cache
+#
+# If you do not use Thrift at all, it is safe to leave this value at "auto".
+#
+# See description of 'prepared_statements_cache_size_mb' above for more information.
+#
+# Default value ("auto") is 1/256th of the heap or 10MB, whichever is greater
+thrift_prepared_statements_cache_size_mb:
+
+# Maximum size of the key cache in memory.
+#
+# Each key cache hit saves 1 seek and each row cache hit saves 2 seeks at the
+# minimum, sometimes more. The key cache is fairly tiny for the amount of
+# time it saves, so it's worthwhile to use it at large numbers.
+# The row cache saves even more time, but must contain the entire row,
+# so it is extremely space-intensive. It's best to only use the
+# row cache if you have hot rows or static rows.
+#
+# NOTE: if you reduce the size, you may not get you hottest keys loaded on startup.
+#
+# Default value is empty to make it "auto" (min(5% of Heap (in MB), 100MB)). Set to 0 to disable key cache.
+key_cache_size_in_mb:
+
+# Duration in seconds after which Cassandra should
+# save the key cache. Caches are saved to saved_caches_directory as
+# specified in this configuration file.
+#
+# Saved caches greatly improve cold-start speeds, and is relatively cheap in
+# terms of I/O for the key cache. Row cache saving is much more expensive and
+# has limited use.
+#
+# Default is 14400 or 4 hours.
+key_cache_save_period: 14400
+
+# Number of keys from the key cache to save
+# Disabled by default, meaning all keys are going to be saved
+# key_cache_keys_to_save: 100
+
+# Row cache implementation class name. Available implementations:
+#
+# org.apache.cassandra.cache.OHCProvider
+# Fully off-heap row cache implementation (default).
+#
+# org.apache.cassandra.cache.SerializingCacheProvider
+# This is the row cache implementation available
+# in previous releases of Cassandra.
+# row_cache_class_name: org.apache.cassandra.cache.OHCProvider
+
+# Maximum size of the row cache in memory.
+# Please note that OHC cache implementation requires some additional off-heap memory to manage
+# the map structures and some in-flight memory during operations before/after cache entries can be
+# accounted against the cache capacity. This overhead is usually small compared to the whole capacity.
+# Do not specify more memory that the system can afford in the worst usual situation and leave some
+# headroom for OS block level cache. Do never allow your system to swap.
+#
+# Default value is 0, to disable row caching.
+row_cache_size_in_mb: 0
+
+# Duration in seconds after which Cassandra should save the row cache.
+# Caches are saved to saved_caches_directory as specified in this configuration file.
+#
+# Saved caches greatly improve cold-start speeds, and is relatively cheap in
+# terms of I/O for the key cache. Row cache saving is much more expensive and
+# has limited use.
+#
+# Default is 0 to disable saving the row cache.
+row_cache_save_period: 0
+
+# Number of keys from the row cache to save.
+# Specify 0 (which is the default), meaning all keys are going to be saved
+# row_cache_keys_to_save: 100
+
+# Maximum size of the counter cache in memory.
+#
+# Counter cache helps to reduce counter locks' contention for hot counter cells.
+# In case of RF = 1 a counter cache hit will cause Cassandra to skip the read before
+# write entirely. With RF > 1 a counter cache hit will still help to reduce the duration
+# of the lock hold, helping with hot counter cell updates, but will not allow skipping
+# the read entirely. Only the local (clock, count) tuple of a counter cell is kept
+# in memory, not the whole counter, so it's relatively cheap.
+#
+# NOTE: if you reduce the size, you may not get you hottest keys loaded on startup.
+#
+# Default value is empty to make it "auto" (min(2.5% of Heap (in MB), 50MB)). Set to 0 to disable counter cache.
+# NOTE: if you perform counter deletes and rely on low gcgs, you should disable the counter cache.
+counter_cache_size_in_mb:
+
+# Duration in seconds after which Cassandra should
+# save the counter cache (keys only). Caches are saved to saved_caches_directory as
+# specified in this configuration file.
+#
+# Default is 7200 or 2 hours.
+counter_cache_save_period: 7200
+
+# Number of keys from the counter cache to save
+# Disabled by default, meaning all keys are going to be saved
+# counter_cache_keys_to_save: 100
+
+# saved caches
+# If not set, the default directory is $CASSANDRA_HOME/data/saved_caches.
+saved_caches_directory: /var/lib/cassandra/saved_caches
+
+# commitlog_sync may be either "periodic" or "batch."
+#
+# When in batch mode, Cassandra won't ack writes until the commit log
+# has been fsynced to disk. It will wait
+# commitlog_sync_batch_window_in_ms milliseconds between fsyncs.
+# This window should be kept short because the writer threads will
+# be unable to do extra work while waiting. (You may need to increase
+# concurrent_writes for the same reason.)
+#
+# commitlog_sync: batch
+# commitlog_sync_batch_window_in_ms: 2
+#
+# the other option is "periodic" where writes may be acked immediately
+# and the CommitLog is simply synced every commitlog_sync_period_in_ms
+# milliseconds.
+commitlog_sync: periodic
+commitlog_sync_period_in_ms: 10000
+
+# The size of the individual commitlog file segments. A commitlog
+# segment may be archived, deleted, or recycled once all the data
+# in it (potentially from each columnfamily in the system) has been
+# flushed to sstables.
+#
+# The default size is 32, which is almost always fine, but if you are
+# archiving commitlog segments (see commitlog_archiving.properties),
+# then you probably want a finer granularity of archiving; 8 or 16 MB
+# is reasonable.
+# Max mutation size is also configurable via max_mutation_size_in_kb setting in
+# cassandra.yaml. The default is half the size commitlog_segment_size_in_mb * 1024.
+# This should be positive and less than 2048.
+#
+# NOTE: If max_mutation_size_in_kb is set explicitly then commitlog_segment_size_in_mb must
+# be set to at least twice the size of max_mutation_size_in_kb / 1024
+#
+commitlog_segment_size_in_mb: 32
+
+# Compression to apply to the commit log. If omitted, the commit log
+# will be written uncompressed. LZ4, Snappy, and Deflate compressors
+# are supported.
+# commitlog_compression:
+# - class_name: LZ4Compressor
+# parameters:
+# -
+
+# any class that implements the SeedProvider interface and has a
+# constructor that takes a Map of parameters will do.
+seed_provider:
+ # Addresses of hosts that are deemed contact points.
+ # Cassandra nodes use this list of hosts to find each other and learn
+ # the topology of the ring. You must change this if you are running
+ # multiple nodes!
+ - class_name: org.apache.cassandra.locator.SimpleSeedProvider
+ parameters:
+ # seeds is actually a comma-delimited list of addresses.
+ # Ex: ",,"
+ - seeds: "172.17.0.2"
+
+# For workloads with more data than can fit in memory, Cassandra's
+# bottleneck will be reads that need to fetch data from
+# disk. "concurrent_reads" should be set to (16 * number_of_drives) in
+# order to allow the operations to enqueue low enough in the stack
+# that the OS and drives can reorder them. Same applies to
+# "concurrent_counter_writes", since counter writes read the current
+# values before incrementing and writing them back.
+#
+# On the other hand, since writes are almost never IO bound, the ideal
+# number of "concurrent_writes" is dependent on the number of cores in
+# your system; (8 * number_of_cores) is a good rule of thumb.
+concurrent_reads: 32
+concurrent_writes: 32
+concurrent_counter_writes: 32
+
+# For materialized view writes, as there is a read involved, so this should
+# be limited by the less of concurrent reads or concurrent writes.
+concurrent_materialized_view_writes: 32
+
+# Maximum memory to use for sstable chunk cache and buffer pooling.
+# 32MB of this are reserved for pooling buffers, the rest is used as a
+# cache that holds uncompressed sstable chunks.
+# Defaults to the smaller of 1/4 of heap or 512MB. This pool is allocated off-heap,
+# so is in addition to the memory allocated for heap. The cache also has on-heap
+# overhead which is roughly 128 bytes per chunk (i.e. 0.2% of the reserved size
+# if the default 64k chunk size is used).
+# Memory is only allocated when needed.
+# file_cache_size_in_mb: 512
+
+# Flag indicating whether to allocate on or off heap when the sstable buffer
+# pool is exhausted, that is when it has exceeded the maximum memory
+# file_cache_size_in_mb, beyond which it will not cache buffers but allocate on request.
+
+# buffer_pool_use_heap_if_exhausted: true
+
+# The strategy for optimizing disk read
+# Possible values are:
+# ssd (for solid state disks, the default)
+# spinning (for spinning disks)
+# disk_optimization_strategy: ssd
+
+# Total permitted memory to use for memtables. Cassandra will stop
+# accepting writes when the limit is exceeded until a flush completes,
+# and will trigger a flush based on memtable_cleanup_threshold
+# If omitted, Cassandra will set both to 1/4 the size of the heap.
+# memtable_heap_space_in_mb: 2048
+# memtable_offheap_space_in_mb: 2048
+
+# memtable_cleanup_threshold is deprecated. The default calculation
+# is the only reasonable choice. See the comments on memtable_flush_writers
+# for more information.
+#
+# Ratio of occupied non-flushing memtable size to total permitted size
+# that will trigger a flush of the largest memtable. Larger mct will
+# mean larger flushes and hence less compaction, but also less concurrent
+# flush activity which can make it difficult to keep your disks fed
+# under heavy write load.
+#
+# memtable_cleanup_threshold defaults to 1 / (memtable_flush_writers + 1)
+# memtable_cleanup_threshold: 0.11
+
+# Specify the way Cassandra allocates and manages memtable memory.
+# Options are:
+#
+# heap_buffers
+# on heap nio buffers
+#
+# offheap_buffers
+# off heap (direct) nio buffers
+#
+# offheap_objects
+# off heap objects
+memtable_allocation_type: heap_buffers
+
+# Total space to use for commit logs on disk.
+#
+# If space gets above this value, Cassandra will flush every dirty CF
+# in the oldest segment and remove it. So a small total commitlog space
+# will tend to cause more flush activity on less-active columnfamilies.
+#
+# The default value is the smaller of 8192, and 1/4 of the total space
+# of the commitlog volume.
+#
+# commitlog_total_space_in_mb: 8192
+
+# This sets the number of memtable flush writer threads per disk
+# as well as the total number of memtables that can be flushed concurrently.
+# These are generally a combination of compute and IO bound.
+#
+# Memtable flushing is more CPU efficient than memtable ingest and a single thread
+# can keep up with the ingest rate of a whole server on a single fast disk
+# until it temporarily becomes IO bound under contention typically with compaction.
+# At that point you need multiple flush threads. At some point in the future
+# it may become CPU bound all the time.
+#
+# You can tell if flushing is falling behind using the MemtablePool.BlockedOnAllocation
+# metric which should be 0, but will be non-zero if threads are blocked waiting on flushing
+# to free memory.
+#
+# memtable_flush_writers defaults to two for a single data directory.
+# This means that two memtables can be flushed concurrently to the single data directory.
+# If you have multiple data directories the default is one memtable flushing at a time
+# but the flush will use a thread per data directory so you will get two or more writers.
+#
+# Two is generally enough to flush on a fast disk [array] mounted as a single data directory.
+# Adding more flush writers will result in smaller more frequent flushes that introduce more
+# compaction overhead.
+#
+# There is a direct tradeoff between number of memtables that can be flushed concurrently
+# and flush size and frequency. More is not better you just need enough flush writers
+# to never stall waiting for flushing to free memory.
+#
+#memtable_flush_writers: 2
+
+# Total space to use for change-data-capture logs on disk.
+#
+# If space gets above this value, Cassandra will throw WriteTimeoutException
+# on Mutations including tables with CDC enabled. A CDCCompactor is responsible
+# for parsing the raw CDC logs and deleting them when parsing is completed.
+#
+# The default value is the min of 4096 mb and 1/8th of the total space
+# of the drive where cdc_raw_directory resides.
+# cdc_total_space_in_mb: 4096
+
+# When we hit our cdc_raw limit and the CDCCompactor is either running behind
+# or experiencing backpressure, we check at the following interval to see if any
+# new space for cdc-tracked tables has been made available. Default to 250ms
+# cdc_free_space_check_interval_ms: 250
+
+# A fixed memory pool size in MB for SSTable index summaries. If left
+# empty, this will default to 5% of the heap size. If the memory usage of
+# all index summaries exceeds this limit, SSTables with low read rates will
+# shrink their index summaries in order to meet this limit. However, this
+# is a best-effort process. In extreme conditions Cassandra may need to use
+# more than this amount of memory.
+index_summary_capacity_in_mb:
+
+# How frequently index summaries should be resampled. This is done
+# periodically to redistribute memory from the fixed-size pool to sstables
+# proportional their recent read rates. Setting to -1 will disable this
+# process, leaving existing index summaries at their current sampling level.
+index_summary_resize_interval_in_minutes: 60
+
+# Whether to, when doing sequential writing, fsync() at intervals in
+# order to force the operating system to flush the dirty
+# buffers. Enable this to avoid sudden dirty buffer flushing from
+# impacting read latencies. Almost always a good idea on SSDs; not
+# necessarily on platters.
+trickle_fsync: false
+trickle_fsync_interval_in_kb: 10240
+
+# TCP port, for commands and data
+# For security reasons, you should not expose this port to the internet. Firewall it if needed.
+storage_port: 7000
+
+# SSL port, for encrypted communication. Unused unless enabled in
+# encryption_options
+# For security reasons, you should not expose this port to the internet. Firewall it if needed.
+ssl_storage_port: 7001
+
+# Address or interface to bind to and tell other Cassandra nodes to connect to.
+# You _must_ change this if you want multiple nodes to be able to communicate!
+#
+# Set listen_address OR listen_interface, not both.
+#
+# Leaving it blank leaves it up to InetAddress.getLocalHost(). This
+# will always do the Right Thing _if_ the node is properly configured
+# (hostname, name resolution, etc), and the Right Thing is to use the
+# address associated with the hostname (it might not be).
+#
+# Setting listen_address to 0.0.0.0 is always wrong.
+#
+listen_address: 172.17.0.2
+
+# Set listen_address OR listen_interface, not both. Interfaces must correspond
+# to a single address, IP aliasing is not supported.
+# listen_interface: eth0
+
+# If you choose to specify the interface by name and the interface has an ipv4 and an ipv6 address
+# you can specify which should be chosen using listen_interface_prefer_ipv6. If false the first ipv4
+# address will be used. If true the first ipv6 address will be used. Defaults to false preferring
+# ipv4. If there is only one address it will be selected regardless of ipv4/ipv6.
+# listen_interface_prefer_ipv6: false
+
+# Address to broadcast to other Cassandra nodes
+# Leaving this blank will set it to the same value as listen_address
+broadcast_address: 172.17.0.2
+
+# When using multiple physical network interfaces, set this
+# to true to listen on broadcast_address in addition to
+# the listen_address, allowing nodes to communicate in both
+# interfaces.
+# Ignore this property if the network configuration automatically
+# routes between the public and private networks such as EC2.
+# listen_on_broadcast_address: false
+
+# Internode authentication backend, implementing IInternodeAuthenticator;
+# used to allow/disallow connections from peer nodes.
+# internode_authenticator: org.apache.cassandra.auth.AllowAllInternodeAuthenticator
+
+# Whether to start the native transport server.
+# Please note that the address on which the native transport is bound is the
+# same as the rpc_address. The port however is different and specified below.
+start_native_transport: true
+# port for the CQL native transport to listen for clients on
+# For security reasons, you should not expose this port to the internet. Firewall it if needed.
+native_transport_port: 9042
+# Enabling native transport encryption in client_encryption_options allows you to either use
+# encryption for the standard port or to use a dedicated, additional port along with the unencrypted
+# standard native_transport_port.
+# Enabling client encryption and keeping native_transport_port_ssl disabled will use encryption
+# for native_transport_port. Setting native_transport_port_ssl to a different value
+# from native_transport_port will use encryption for native_transport_port_ssl while
+# keeping native_transport_port unencrypted.
+# native_transport_port_ssl: 9142
+# The maximum threads for handling requests when the native transport is used.
+# This is similar to rpc_max_threads though the default differs slightly (and
+# there is no native_transport_min_threads, idle threads will always be stopped
+# after 30 seconds).
+# native_transport_max_threads: 128
+#
+# The maximum size of allowed frame. Frame (requests) larger than this will
+# be rejected as invalid. The default is 256MB. If you're changing this parameter,
+# you may want to adjust max_value_size_in_mb accordingly. This should be positive and less than 2048.
+# native_transport_max_frame_size_in_mb: 256
+
+# The maximum number of concurrent client connections.
+# The default is -1, which means unlimited.
+# native_transport_max_concurrent_connections: -1
+
+# The maximum number of concurrent client connections per source ip.
+# The default is -1, which means unlimited.
+# native_transport_max_concurrent_connections_per_ip: -1
+
+# Whether to start the thrift rpc server.
+start_rpc: false
+
+# The address or interface to bind the Thrift RPC service and native transport
+# server to.
+#
+# Set rpc_address OR rpc_interface, not both.
+#
+# Leaving rpc_address blank has the same effect as on listen_address
+# (i.e. it will be based on the configured hostname of the node).
+#
+# Note that unlike listen_address, you can specify 0.0.0.0, but you must also
+# set broadcast_rpc_address to a value other than 0.0.0.0.
+#
+# For security reasons, you should not expose this port to the internet. Firewall it if needed.
+rpc_address: 0.0.0.0
+
+# Set rpc_address OR rpc_interface, not both. Interfaces must correspond
+# to a single address, IP aliasing is not supported.
+# rpc_interface: eth1
+
+# If you choose to specify the interface by name and the interface has an ipv4 and an ipv6 address
+# you can specify which should be chosen using rpc_interface_prefer_ipv6. If false the first ipv4
+# address will be used. If true the first ipv6 address will be used. Defaults to false preferring
+# ipv4. If there is only one address it will be selected regardless of ipv4/ipv6.
+# rpc_interface_prefer_ipv6: false
+
+# port for Thrift to listen for clients on
+rpc_port: 9160
+
+# RPC address to broadcast to drivers and other Cassandra nodes. This cannot
+# be set to 0.0.0.0. If left blank, this will be set to the value of
+# rpc_address. If rpc_address is set to 0.0.0.0, broadcast_rpc_address must
+# be set.
+broadcast_rpc_address: 172.17.0.2
+
+# enable or disable keepalive on rpc/native connections
+rpc_keepalive: true
+
+# Cassandra provides two out-of-the-box options for the RPC Server:
+#
+# sync
+# One thread per thrift connection. For a very large number of clients, memory
+# will be your limiting factor. On a 64 bit JVM, 180KB is the minimum stack size
+# per thread, and that will correspond to your use of virtual memory (but physical memory
+# may be limited depending on use of stack space).
+#
+# hsha
+# Stands for "half synchronous, half asynchronous." All thrift clients are handled
+# asynchronously using a small number of threads that does not vary with the amount
+# of thrift clients (and thus scales well to many clients). The rpc requests are still
+# synchronous (one thread per active request). If hsha is selected then it is essential
+# that rpc_max_threads is changed from the default value of unlimited.
+#
+# The default is sync because on Windows hsha is about 30% slower. On Linux,
+# sync/hsha performance is about the same, with hsha of course using less memory.
+#
+# Alternatively, can provide your own RPC server by providing the fully-qualified class name
+# of an o.a.c.t.TServerFactory that can create an instance of it.
+rpc_server_type: sync
+
+# Uncomment rpc_min|max_thread to set request pool size limits.
+#
+# Regardless of your choice of RPC server (see above), the number of maximum requests in the
+# RPC thread pool dictates how many concurrent requests are possible (but if you are using the sync
+# RPC server, it also dictates the number of clients that can be connected at all).
+#
+# The default is unlimited and thus provides no protection against clients overwhelming the server. You are
+# encouraged to set a maximum that makes sense for you in production, but do keep in mind that
+# rpc_max_threads represents the maximum number of client requests this server may execute concurrently.
+#
+# rpc_min_threads: 16
+# rpc_max_threads: 2048
+
+# uncomment to set socket buffer sizes on rpc connections
+# rpc_send_buff_size_in_bytes:
+# rpc_recv_buff_size_in_bytes:
+
+# Uncomment to set socket buffer size for internode communication
+# Note that when setting this, the buffer size is limited by net.core.wmem_max
+# and when not setting it it is defined by net.ipv4.tcp_wmem
+# See also:
+# /proc/sys/net/core/wmem_max
+# /proc/sys/net/core/rmem_max
+# /proc/sys/net/ipv4/tcp_wmem
+# /proc/sys/net/ipv4/tcp_wmem
+# and 'man tcp'
+# internode_send_buff_size_in_bytes:
+
+# Uncomment to set socket buffer size for internode communication
+# Note that when setting this, the buffer size is limited by net.core.wmem_max
+# and when not setting it it is defined by net.ipv4.tcp_wmem
+# internode_recv_buff_size_in_bytes:
+
+# Frame size for thrift (maximum message length).
+thrift_framed_transport_size_in_mb: 15
+
+# Set to true to have Cassandra create a hard link to each sstable
+# flushed or streamed locally in a backups/ subdirectory of the
+# keyspace data. Removing these links is the operator's
+# responsibility.
+incremental_backups: false
+
+# Whether or not to take a snapshot before each compaction. Be
+# careful using this option, since Cassandra won't clean up the
+# snapshots for you. Mostly useful if you're paranoid when there
+# is a data format change.
+snapshot_before_compaction: false
+
+# Whether or not a snapshot is taken of the data before keyspace truncation
+# or dropping of column families. The STRONGLY advised default of true
+# should be used to provide data safety. If you set this flag to false, you will
+# lose data on truncation or drop.
+auto_snapshot: true
+
+# Granularity of the collation index of rows within a partition.
+# Increase if your rows are large, or if you have a very large
+# number of rows per partition. The competing goals are these:
+#
+# - a smaller granularity means more index entries are generated
+# and looking up rows within the partition by collation column
+# is faster
+# - but, Cassandra will keep the collation index in memory for hot
+# rows (as part of the key cache), so a larger granularity means
+# you can cache more hot rows
+column_index_size_in_kb: 64
+
+# Per sstable indexed key cache entries (the collation index in memory
+# mentioned above) exceeding this size will not be held on heap.
+# This means that only partition information is held on heap and the
+# index entries are read from disk.
+#
+# Note that this size refers to the size of the
+# serialized index information and not the size of the partition.
+column_index_cache_size_in_kb: 2
+
+# Number of simultaneous compactions to allow, NOT including
+# validation "compactions" for anti-entropy repair. Simultaneous
+# compactions can help preserve read performance in a mixed read/write
+# workload, by mitigating the tendency of small sstables to accumulate
+# during a single long running compactions. The default is usually
+# fine and if you experience problems with compaction running too
+# slowly or too fast, you should look at
+# compaction_throughput_mb_per_sec first.
+#
+# concurrent_compactors defaults to the smaller of (number of disks,
+# number of cores), with a minimum of 2 and a maximum of 8.
+#
+# If your data directories are backed by SSD, you should increase this
+# to the number of cores.
+#concurrent_compactors: 1
+
+# Throttles compaction to the given total throughput across the entire
+# system. The faster you insert data, the faster you need to compact in
+# order to keep the sstable count down, but in general, setting this to
+# 16 to 32 times the rate you are inserting data is more than sufficient.
+# Setting this to 0 disables throttling. Note that this account for all types
+# of compaction, including validation compaction.
+compaction_throughput_mb_per_sec: 16
+
+# When compacting, the replacement sstable(s) can be opened before they
+# are completely written, and used in place of the prior sstables for
+# any range that has been written. This helps to smoothly transfer reads
+# between the sstables, reducing page cache churn and keeping hot rows hot
+sstable_preemptive_open_interval_in_mb: 50
+
+# Throttles all outbound streaming file transfers on this node to the
+# given total throughput in Mbps. This is necessary because Cassandra does
+# mostly sequential IO when streaming data during bootstrap or repair, which
+# can lead to saturating the network connection and degrading rpc performance.
+# When unset, the default is 200 Mbps or 25 MB/s.
+# stream_throughput_outbound_megabits_per_sec: 200
+
+# Throttles all streaming file transfer between the datacenters,
+# this setting allows users to throttle inter dc stream throughput in addition
+# to throttling all network stream traffic as configured with
+# stream_throughput_outbound_megabits_per_sec
+# When unset, the default is 200 Mbps or 25 MB/s
+# inter_dc_stream_throughput_outbound_megabits_per_sec: 200
+
+# How long the coordinator should wait for read operations to complete
+read_request_timeout_in_ms: 5000
+# How long the coordinator should wait for seq or index scans to complete
+range_request_timeout_in_ms: 10000
+# How long the coordinator should wait for writes to complete
+write_request_timeout_in_ms: 2000
+# How long the coordinator should wait for counter writes to complete
+counter_write_request_timeout_in_ms: 5000
+# How long a coordinator should continue to retry a CAS operation
+# that contends with other proposals for the same row
+cas_contention_timeout_in_ms: 1000
+# How long the coordinator should wait for truncates to complete
+# (This can be much longer, because unless auto_snapshot is disabled
+# we need to flush first so we can snapshot before removing the data.)
+truncate_request_timeout_in_ms: 60000
+# The default timeout for other, miscellaneous operations
+request_timeout_in_ms: 10000
+
+# How long before a node logs slow queries. Select queries that take longer than
+# this timeout to execute, will generate an aggregated log message, so that slow queries
+# can be identified. Set this value to zero to disable slow query logging.
+slow_query_log_timeout_in_ms: 500
+
+# Enable operation timeout information exchange between nodes to accurately
+# measure request timeouts. If disabled, replicas will assume that requests
+# were forwarded to them instantly by the coordinator, which means that
+# under overload conditions we will waste that much extra time processing
+# already-timed-out requests.
+#
+# Warning: before enabling this property make sure to ntp is installed
+# and the times are synchronized between the nodes.
+cross_node_timeout: false
+
+# Set keep-alive period for streaming
+# This node will send a keep-alive message periodically with this period.
+# If the node does not receive a keep-alive message from the peer for
+# 2 keep-alive cycles the stream session times out and fail
+# Default value is 300s (5 minutes), which means stalled stream
+# times out in 10 minutes by default
+# streaming_keep_alive_period_in_secs: 300
+
+# phi value that must be reached for a host to be marked down.
+# most users should never need to adjust this.
+# phi_convict_threshold: 8
+
+# endpoint_snitch -- Set this to a class that implements
+# IEndpointSnitch. The snitch has two functions:
+#
+# - it teaches Cassandra enough about your network topology to route
+# requests efficiently
+# - it allows Cassandra to spread replicas around your cluster to avoid
+# correlated failures. It does this by grouping machines into
+# "datacenters" and "racks." Cassandra will do its best not to have
+# more than one replica on the same "rack" (which may not actually
+# be a physical location)
+#
+# CASSANDRA WILL NOT ALLOW YOU TO SWITCH TO AN INCOMPATIBLE SNITCH
+# ONCE DATA IS INSERTED INTO THE CLUSTER. This would cause data loss.
+# This means that if you start with the default SimpleSnitch, which
+# locates every node on "rack1" in "datacenter1", your only options
+# if you need to add another datacenter are GossipingPropertyFileSnitch
+# (and the older PFS). From there, if you want to migrate to an
+# incompatible snitch like Ec2Snitch you can do it by adding new nodes
+# under Ec2Snitch (which will locate them in a new "datacenter") and
+# decommissioning the old ones.
+#
+# Out of the box, Cassandra provides:
+#
+# SimpleSnitch:
+# Treats Strategy order as proximity. This can improve cache
+# locality when disabling read repair. Only appropriate for
+# single-datacenter deployments.
+#
+# GossipingPropertyFileSnitch
+# This should be your go-to snitch for production use. The rack
+# and datacenter for the local node are defined in
+# cassandra-rackdc.properties and propagated to other nodes via
+# gossip. If cassandra-topology.properties exists, it is used as a
+# fallback, allowing migration from the PropertyFileSnitch.
+#
+# PropertyFileSnitch:
+# Proximity is determined by rack and data center, which are
+# explicitly configured in cassandra-topology.properties.
+#
+# Ec2Snitch:
+# Appropriate for EC2 deployments in a single Region. Loads Region
+# and Availability Zone information from the EC2 API. The Region is
+# treated as the datacenter, and the Availability Zone as the rack.
+# Only private IPs are used, so this will not work across multiple
+# Regions.
+#
+# Ec2MultiRegionSnitch:
+# Uses public IPs as broadcast_address to allow cross-region
+# connectivity. (Thus, you should set seed addresses to the public
+# IP as well.) You will need to open the storage_port or
+# ssl_storage_port on the public IP firewall. (For intra-Region
+# traffic, Cassandra will switch to the private IP after
+# establishing a connection.)
+#
+# RackInferringSnitch:
+# Proximity is determined by rack and data center, which are
+# assumed to correspond to the 3rd and 2nd octet of each node's IP
+# address, respectively. Unless this happens to match your
+# deployment conventions, this is best used as an example of
+# writing a custom Snitch class and is provided in that spirit.
+#
+# You can use a custom Snitch by setting this to the full class name
+# of the snitch, which will be assumed to be on your classpath.
+endpoint_snitch: SimpleSnitch
+
+# controls how often to perform the more expensive part of host score
+# calculation
+dynamic_snitch_update_interval_in_ms: 100
+# controls how often to reset all host scores, allowing a bad host to
+# possibly recover
+dynamic_snitch_reset_interval_in_ms: 600000
+# if set greater than zero and read_repair_chance is < 1.0, this will allow
+# 'pinning' of replicas to hosts in order to increase cache capacity.
+# The badness threshold will control how much worse the pinned host has to be
+# before the dynamic snitch will prefer other replicas over it. This is
+# expressed as a double which represents a percentage. Thus, a value of
+# 0.2 means Cassandra would continue to prefer the static snitch values
+# until the pinned host was 20% worse than the fastest.
+dynamic_snitch_badness_threshold: 0.1
+
+# request_scheduler -- Set this to a class that implements
+# RequestScheduler, which will schedule incoming client requests
+# according to the specific policy. This is useful for multi-tenancy
+# with a single Cassandra cluster.
+# NOTE: This is specifically for requests from the client and does
+# not affect inter node communication.
+# org.apache.cassandra.scheduler.NoScheduler - No scheduling takes place
+# org.apache.cassandra.scheduler.RoundRobinScheduler - Round robin of
+# client requests to a node with a separate queue for each
+# request_scheduler_id. The scheduler is further customized by
+# request_scheduler_options as described below.
+request_scheduler: org.apache.cassandra.scheduler.NoScheduler
+
+# Scheduler Options vary based on the type of scheduler
+#
+# NoScheduler
+# Has no options
+#
+# RoundRobin
+# throttle_limit
+# The throttle_limit is the number of in-flight
+# requests per client. Requests beyond
+# that limit are queued up until
+# running requests can complete.
+# The value of 80 here is twice the number of
+# concurrent_reads + concurrent_writes.
+# default_weight
+# default_weight is optional and allows for
+# overriding the default which is 1.
+# weights
+# Weights are optional and will default to 1 or the
+# overridden default_weight. The weight translates into how
+# many requests are handled during each turn of the
+# RoundRobin, based on the scheduler id.
+#
+# request_scheduler_options:
+# throttle_limit: 80
+# default_weight: 5
+# weights:
+# Keyspace1: 1
+# Keyspace2: 5
+
+# request_scheduler_id -- An identifier based on which to perform
+# the request scheduling. Currently the only valid option is keyspace.
+# request_scheduler_id: keyspace
+
+# Enable or disable inter-node encryption
+# JVM defaults for supported SSL socket protocols and cipher suites can
+# be replaced using custom encryption options. This is not recommended
+# unless you have policies in place that dictate certain settings, or
+# need to disable vulnerable ciphers or protocols in case the JVM cannot
+# be updated.
+# FIPS compliant settings can be configured at JVM level and should not
+# involve changing encryption settings here:
+# https://docs.oracle.com/javase/8/docs/technotes/guides/security/jsse/FIPS.html
+# *NOTE* No custom encryption options are enabled at the moment
+# The available internode options are : all, none, dc, rack
+#
+# If set to dc cassandra will encrypt the traffic between the DCs
+# If set to rack cassandra will encrypt the traffic between the racks
+#
+# The passwords used in these options must match the passwords used when generating
+# the keystore and truststore. For instructions on generating these files, see:
+# http://download.oracle.com/javase/6/docs/technotes/guides/security/jsse/JSSERefGuide.html#CreateKeystore
+#
+server_encryption_options:
+ internode_encryption: none
+ keystore: conf/.keystore
+ keystore_password: cassandra
+ truststore: conf/.truststore
+ truststore_password: cassandra
+ # More advanced defaults below:
+ # protocol: TLS
+ # algorithm: SunX509
+ # store_type: JKS
+ # cipher_suites: [TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA,TLS_DHE_RSA_WITH_AES_128_CBC_SHA,TLS_DHE_RSA_WITH_AES_256_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA]
+ # require_client_auth: false
+ # require_endpoint_verification: false
+
+# enable or disable client/server encryption.
+client_encryption_options:
+ enabled: false
+ # If enabled and optional is set to true encrypted and unencrypted connections are handled.
+ optional: false
+ keystore: conf/.keystore
+ keystore_password: cassandra
+ # require_client_auth: false
+ # Set trustore and truststore_password if require_client_auth is true
+ # truststore: conf/.truststore
+ # truststore_password: cassandra
+ # More advanced defaults below:
+ # protocol: TLS
+ # algorithm: SunX509
+ # store_type: JKS
+ # cipher_suites: [TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA,TLS_DHE_RSA_WITH_AES_128_CBC_SHA,TLS_DHE_RSA_WITH_AES_256_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA]
+
+# internode_compression controls whether traffic between nodes is
+# compressed.
+# Can be:
+#
+# all
+# all traffic is compressed
+#
+# dc
+# traffic between different datacenters is compressed
+#
+# none
+# nothing is compressed.
+internode_compression: dc
+
+# Enable or disable tcp_nodelay for inter-dc communication.
+# Disabling it will result in larger (but fewer) network packets being sent,
+# reducing overhead from the TCP protocol itself, at the cost of increasing
+# latency if you block for cross-datacenter responses.
+inter_dc_tcp_nodelay: false
+
+# TTL for different trace types used during logging of the repair process.
+tracetype_query_ttl: 86400
+tracetype_repair_ttl: 604800
+
+# By default, Cassandra logs GC Pauses greater than 200 ms at INFO level
+# This threshold can be adjusted to minimize logging if necessary
+# gc_log_threshold_in_ms: 200
+
+# If unset, all GC Pauses greater than gc_log_threshold_in_ms will log at
+# INFO level
+# UDFs (user defined functions) are disabled by default.
+# As of Cassandra 3.0 there is a sandbox in place that should prevent execution of evil code.
+enable_user_defined_functions: false
+
+# Enables scripted UDFs (JavaScript UDFs).
+# Java UDFs are always enabled, if enable_user_defined_functions is true.
+# Enable this option to be able to use UDFs with "language javascript" or any custom JSR-223 provider.
+# This option has no effect, if enable_user_defined_functions is false.
+enable_scripted_user_defined_functions: false
+
+# The default Windows kernel timer and scheduling resolution is 15.6ms for power conservation.
+# Lowering this value on Windows can provide much tighter latency and better throughput, however
+# some virtualized environments may see a negative performance impact from changing this setting
+# below their system default. The sysinternals 'clockres' tool can confirm your system's default
+# setting.
+windows_timer_interval: 1
+
+
+# Enables encrypting data at-rest (on disk). Different key providers can be plugged in, but the default reads from
+# a JCE-style keystore. A single keystore can hold multiple keys, but the one referenced by
+# the "key_alias" is the only key that will be used for encrypt operations; previously used keys
+# can still (and should!) be in the keystore and will be used on decrypt operations
+# (to handle the case of key rotation).
+#
+# It is strongly recommended to download and install Java Cryptography Extension (JCE)
+# Unlimited Strength Jurisdiction Policy Files for your version of the JDK.
+# (current link: http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html)
+#
+# Currently, only the following file types are supported for transparent data encryption, although
+# more are coming in future cassandra releases: commitlog, hints
+transparent_data_encryption_options:
+ enabled: false
+ chunk_length_kb: 64
+ cipher: AES/CBC/PKCS5Padding
+ key_alias: testing:1
+ # CBC IV length for AES needs to be 16 bytes (which is also the default size)
+ # iv_length: 16
+ key_provider:
+ - class_name: org.apache.cassandra.security.JKSKeyProvider
+ parameters:
+ - keystore: conf/.keystore
+ keystore_password: cassandra
+ store_type: JCEKS
+ key_password: cassandra
+
+
+#####################
+# SAFETY THRESHOLDS #
+#####################
+
+# When executing a scan, within or across a partition, we need to keep the
+# tombstones seen in memory so we can return them to the coordinator, which
+# will use them to make sure other replicas also know about the deleted rows.
+# With workloads that generate a lot of tombstones, this can cause performance
+# problems and even exhaust the server heap.
+# (http://www.datastax.com/dev/blog/cassandra-anti-patterns-queues-and-queue-like-datasets)
+# Adjust the thresholds here if you understand the dangers and want to
+# scan more tombstones anyway. These thresholds may also be adjusted at runtime
+# using the StorageService mbean.
+tombstone_warn_threshold: 1000
+tombstone_failure_threshold: 100000
+
+# Log WARN on any multiple-partition batch size exceeding this value. 5kb per batch by default.
+# Caution should be taken on increasing the size of this threshold as it can lead to node instability.
+batch_size_warn_threshold_in_kb: 5
+
+# Fail any multiple-partition batch exceeding this value. 50kb (10x warn threshold) by default.
+batch_size_fail_threshold_in_kb: 50
+
+# Log WARN on any batches not of type LOGGED than span across more partitions than this limit
+unlogged_batch_across_partitions_warn_threshold: 10
+
+# Log a warning when compacting partitions larger than this value
+compaction_large_partition_warning_threshold_mb: 100
+
+# GC Pauses greater than gc_warn_threshold_in_ms will be logged at WARN level
+# Adjust the threshold based on your application throughput requirement
+# By default, Cassandra logs GC Pauses greater than 200 ms at INFO level
+gc_warn_threshold_in_ms: 1000
+
+# Maximum size of any value in SSTables. Safety measure to detect SSTable corruption
+# early. Any value size larger than this threshold will result into marking an SSTable
+# as corrupted. This should be positive and less than 2048.
+# max_value_size_in_mb: 256
+
+# Back-pressure settings #
+# If enabled, the coordinator will apply the back-pressure strategy specified below to each mutation
+# sent to replicas, with the aim of reducing pressure on overloaded replicas.
+back_pressure_enabled: false
+# The back-pressure strategy applied.
+# The default implementation, RateBasedBackPressure, takes three arguments:
+# high ratio, factor, and flow type, and uses the ratio between incoming mutation responses and outgoing mutation requests.
+# If below high ratio, outgoing mutations are rate limited according to the incoming rate decreased by the given factor;
+# if above high ratio, the rate limiting is increased by the given factor;
+# such factor is usually best configured between 1 and 10, use larger values for a faster recovery
+# at the expense of potentially more dropped mutations;
+# the rate limiting is applied according to the flow type: if FAST, it's rate limited at the speed of the fastest replica,
+# if SLOW at the speed of the slowest one.
+# New strategies can be added. Implementors need to implement org.apache.cassandra.net.BackpressureStrategy and
+# provide a public constructor accepting a Map.
+back_pressure_strategy:
+ - class_name: org.apache.cassandra.net.RateBasedBackPressure
+ parameters:
+ - high_ratio: 0.90
+ factor: 5
+ flow: FAST
+
+# Coalescing Strategies #
+# Coalescing multiples messages turns out to significantly boost message processing throughput (think doubling or more).
+# On bare metal, the floor for packet processing throughput is high enough that many applications won't notice, but in
+# virtualized environments, the point at which an application can be bound by network packet processing can be
+# surprisingly low compared to the throughput of task processing that is possible inside a VM. It's not that bare metal
+# doesn't benefit from coalescing messages, it's that the number of packets a bare metal network interface can process
+# is sufficient for many applications such that no load starvation is experienced even without coalescing.
+# There are other benefits to coalescing network messages that are harder to isolate with a simple metric like messages
+# per second. By coalescing multiple tasks together, a network thread can process multiple messages for the cost of one
+# trip to read from a socket, and all the task submission work can be done at the same time reducing context switching
+# and increasing cache friendliness of network message processing.
+# See CASSANDRA-8692 for details.
+
+# Strategy to use for coalescing messages in OutboundTcpConnection.
+# Can be fixed, movingaverage, timehorizon, disabled (default).
+# You can also specify a subclass of CoalescingStrategies.CoalescingStrategy by name.
+# otc_coalescing_strategy: DISABLED
+
+# How many microseconds to wait for coalescing. For fixed strategy this is the amount of time after the first
+# message is received before it will be sent with any accompanying messages. For moving average this is the
+# maximum amount of time that will be waited as well as the interval at which messages must arrive on average
+# for coalescing to be enabled.
+# otc_coalescing_window_us: 200
+
+# Do not try to coalesce messages if we already got that many messages. This should be more than 2 and less than 128.
+# otc_coalescing_enough_coalesced_messages: 8
+
+# How many milliseconds to wait between two expiration runs on the backlog (queue) of the OutboundTcpConnection.
+# Expiration is done if messages are piling up in the backlog. Droppable messages are expired to free the memory
+# taken by expired messages. The interval should be between 0 and 1000, and in most installations the default value
+# will be appropriate. A smaller value could potentially expire messages slightly sooner at the expense of more CPU
+# time and queue contention while iterating the backlog of messages.
+# An interval of 0 disables any wait time, which is the behavior of former Cassandra versions.
+#
+# otc_backlog_expiration_interval_ms: 200
diff --git a/modules/cassandra/src/test/resources/cassandra-ssl-configuration/cassandra.cer b/modules/cassandra/src/test/resources/cassandra-ssl-configuration/cassandra.cer
new file mode 100644
index 00000000000..7a6aee6dec4
Binary files /dev/null and b/modules/cassandra/src/test/resources/cassandra-ssl-configuration/cassandra.cer differ
diff --git a/modules/cassandra/src/test/resources/cassandra-ssl-configuration/cassandra.yaml b/modules/cassandra/src/test/resources/cassandra-ssl-configuration/cassandra.yaml
new file mode 100644
index 00000000000..116ba3429cf
--- /dev/null
+++ b/modules/cassandra/src/test/resources/cassandra-ssl-configuration/cassandra.yaml
@@ -0,0 +1,1233 @@
+# Cassandra storage config YAML
+
+# NOTE:
+# See http://wiki.apache.org/cassandra/StorageConfiguration for
+# full explanations of configuration directives
+# /NOTE
+
+# The name of the cluster. This is mainly used to prevent machines in
+# one logical cluster from joining another.
+cluster_name: 'Test Cluster Integration Test'
+
+# This defines the number of tokens randomly assigned to this node on the ring
+# The more tokens, relative to other nodes, the larger the proportion of data
+# that this node will store. You probably want all nodes to have the same number
+# of tokens assuming they have equal hardware capability.
+#
+# If you leave this unspecified, Cassandra will use the default of 1 token for legacy compatibility,
+# and will use the initial_token as described below.
+#
+# Specifying initial_token will override this setting on the node's initial start,
+# on subsequent starts, this setting will apply even if initial token is set.
+#
+# If you already have a cluster with 1 token per node, and wish to migrate to
+# multiple tokens per node, see http://wiki.apache.org/cassandra/Operations
+num_tokens: 256
+
+# Triggers automatic allocation of num_tokens tokens for this node. The allocation
+# algorithm attempts to choose tokens in a way that optimizes replicated load over
+# the nodes in the datacenter for the replication strategy used by the specified
+# keyspace.
+#
+# The load assigned to each node will be close to proportional to its number of
+# vnodes.
+#
+# Only supported with the Murmur3Partitioner.
+# allocate_tokens_for_keyspace: KEYSPACE
+
+# initial_token allows you to specify tokens manually. While you can use it with
+# vnodes (num_tokens > 1, above) -- in which case you should provide a
+# comma-separated list -- it's primarily used when adding nodes to legacy clusters
+# that do not have vnodes enabled.
+# initial_token:
+
+# See http://wiki.apache.org/cassandra/HintedHandoff
+# May either be "true" or "false" to enable globally
+hinted_handoff_enabled: true
+
+# When hinted_handoff_enabled is true, a black list of data centers that will not
+# perform hinted handoff
+# hinted_handoff_disabled_datacenters:
+# - DC1
+# - DC2
+
+# this defines the maximum amount of time a dead host will have hints
+# generated. After it has been dead this long, new hints for it will not be
+# created until it has been seen alive and gone down again.
+max_hint_window_in_ms: 10800000 # 3 hours
+
+# Maximum throttle in KBs per second, per delivery thread. This will be
+# reduced proportionally to the number of nodes in the cluster. (If there
+# are two nodes in the cluster, each delivery thread will use the maximum
+# rate; if there are three, each will throttle to half of the maximum,
+# since we expect two nodes to be delivering hints simultaneously.)
+hinted_handoff_throttle_in_kb: 1024
+
+# Number of threads with which to deliver hints;
+# Consider increasing this number when you have multi-dc deployments, since
+# cross-dc handoff tends to be slower
+max_hints_delivery_threads: 2
+
+# Directory where Cassandra should store hints.
+# If not set, the default directory is $CASSANDRA_HOME/data/hints.
+# hints_directory: /var/lib/cassandra/hints
+
+# How often hints should be flushed from the internal buffers to disk.
+# Will *not* trigger fsync.
+hints_flush_period_in_ms: 10000
+
+# Maximum size for a single hints file, in megabytes.
+max_hints_file_size_in_mb: 128
+
+# Compression to apply to the hint files. If omitted, hints files
+# will be written uncompressed. LZ4, Snappy, and Deflate compressors
+# are supported.
+#hints_compression:
+# - class_name: LZ4Compressor
+# parameters:
+# -
+
+# Maximum throttle in KBs per second, total. This will be
+# reduced proportionally to the number of nodes in the cluster.
+batchlog_replay_throttle_in_kb: 1024
+
+# Authentication backend, implementing IAuthenticator; used to identify users
+# Out of the box, Cassandra provides org.apache.cassandra.auth.{AllowAllAuthenticator,
+# PasswordAuthenticator}.
+#
+# - AllowAllAuthenticator performs no checks - set it to disable authentication.
+# - PasswordAuthenticator relies on username/password pairs to authenticate
+# users. It keeps usernames and hashed passwords in system_auth.roles table.
+# Please increase system_auth keyspace replication factor if you use this authenticator.
+# If using PasswordAuthenticator, CassandraRoleManager must also be used (see below)
+authenticator: AllowAllAuthenticator
+
+# Authorization backend, implementing IAuthorizer; used to limit access/provide permissions
+# Out of the box, Cassandra provides org.apache.cassandra.auth.{AllowAllAuthorizer,
+# CassandraAuthorizer}.
+#
+# - AllowAllAuthorizer allows any action to any user - set it to disable authorization.
+# - CassandraAuthorizer stores permissions in system_auth.role_permissions table. Please
+# increase system_auth keyspace replication factor if you use this authorizer.
+authorizer: AllowAllAuthorizer
+
+# Part of the Authentication & Authorization backend, implementing IRoleManager; used
+# to maintain grants and memberships between roles.
+# Out of the box, Cassandra provides org.apache.cassandra.auth.CassandraRoleManager,
+# which stores role information in the system_auth keyspace. Most functions of the
+# IRoleManager require an authenticated login, so unless the configured IAuthenticator
+# actually implements authentication, most of this functionality will be unavailable.
+#
+# - CassandraRoleManager stores role data in the system_auth keyspace. Please
+# increase system_auth keyspace replication factor if you use this role manager.
+role_manager: CassandraRoleManager
+
+# Validity period for roles cache (fetching granted roles can be an expensive
+# operation depending on the role manager, CassandraRoleManager is one example)
+# Granted roles are cached for authenticated sessions in AuthenticatedUser and
+# after the period specified here, become eligible for (async) reload.
+# Defaults to 2000, set to 0 to disable caching entirely.
+# Will be disabled automatically for AllowAllAuthenticator.
+roles_validity_in_ms: 2000
+
+# Refresh interval for roles cache (if enabled).
+# After this interval, cache entries become eligible for refresh. Upon next
+# access, an async reload is scheduled and the old value returned until it
+# completes. If roles_validity_in_ms is non-zero, then this must be
+# also.
+# Defaults to the same value as roles_validity_in_ms.
+# roles_update_interval_in_ms: 2000
+
+# Validity period for permissions cache (fetching permissions can be an
+# expensive operation depending on the authorizer, CassandraAuthorizer is
+# one example). Defaults to 2000, set to 0 to disable.
+# Will be disabled automatically for AllowAllAuthorizer.
+permissions_validity_in_ms: 2000
+
+# Refresh interval for permissions cache (if enabled).
+# After this interval, cache entries become eligible for refresh. Upon next
+# access, an async reload is scheduled and the old value returned until it
+# completes. If permissions_validity_in_ms is non-zero, then this must be
+# also.
+# Defaults to the same value as permissions_validity_in_ms.
+# permissions_update_interval_in_ms: 2000
+
+# Validity period for credentials cache. This cache is tightly coupled to
+# the provided PasswordAuthenticator implementation of IAuthenticator. If
+# another IAuthenticator implementation is configured, this cache will not
+# be automatically used and so the following settings will have no effect.
+# Please note, credentials are cached in their encrypted form, so while
+# activating this cache may reduce the number of queries made to the
+# underlying table, it may not bring a significant reduction in the
+# latency of individual authentication attempts.
+# Defaults to 2000, set to 0 to disable credentials caching.
+credentials_validity_in_ms: 2000
+
+# Refresh interval for credentials cache (if enabled).
+# After this interval, cache entries become eligible for refresh. Upon next
+# access, an async reload is scheduled and the old value returned until it
+# completes. If credentials_validity_in_ms is non-zero, then this must be
+# also.
+# Defaults to the same value as credentials_validity_in_ms.
+# credentials_update_interval_in_ms: 2000
+
+# The partitioner is responsible for distributing groups of rows (by
+# partition key) across nodes in the cluster. You should leave this
+# alone for new clusters. The partitioner can NOT be changed without
+# reloading all data, so when upgrading you should set this to the
+# same partitioner you were already using.
+#
+# Besides Murmur3Partitioner, partitioners included for backwards
+# compatibility include RandomPartitioner, ByteOrderedPartitioner, and
+# OrderPreservingPartitioner.
+#
+partitioner: org.apache.cassandra.dht.Murmur3Partitioner
+
+# Directories where Cassandra should store data on disk. Cassandra
+# will spread data evenly across them, subject to the granularity of
+# the configured compaction strategy.
+# If not set, the default directory is $CASSANDRA_HOME/data/data.
+data_file_directories:
+ - /var/lib/cassandra/data
+
+# commit log. when running on magnetic HDD, this should be a
+# separate spindle than the data directories.
+# If not set, the default directory is $CASSANDRA_HOME/data/commitlog.
+commitlog_directory: /var/lib/cassandra/commitlog
+
+# Enable / disable CDC functionality on a per-node basis. This modifies the logic used
+# for write path allocation rejection (standard: never reject. cdc: reject Mutation
+# containing a CDC-enabled table if at space limit in cdc_raw_directory).
+cdc_enabled: false
+
+# CommitLogSegments are moved to this directory on flush if cdc_enabled: true and the
+# segment contains mutations for a CDC-enabled table. This should be placed on a
+# separate spindle than the data directories. If not set, the default directory is
+# $CASSANDRA_HOME/data/cdc_raw.
+# cdc_raw_directory: /var/lib/cassandra/cdc_raw
+
+# Policy for data disk failures:
+#
+# die
+# shut down gossip and client transports and kill the JVM for any fs errors or
+# single-sstable errors, so the node can be replaced.
+#
+# stop_paranoid
+# shut down gossip and client transports even for single-sstable errors,
+# kill the JVM for errors during startup.
+#
+# stop
+# shut down gossip and client transports, leaving the node effectively dead, but
+# can still be inspected via JMX, kill the JVM for errors during startup.
+#
+# best_effort
+# stop using the failed disk and respond to requests based on
+# remaining available sstables. This means you WILL see obsolete
+# data at CL.ONE!
+#
+# ignore
+# ignore fatal errors and let requests fail, as in pre-1.2 Cassandra
+disk_failure_policy: stop
+
+# Policy for commit disk failures:
+#
+# die
+# shut down gossip and Thrift and kill the JVM, so the node can be replaced.
+#
+# stop
+# shut down gossip and Thrift, leaving the node effectively dead, but
+# can still be inspected via JMX.
+#
+# stop_commit
+# shutdown the commit log, letting writes collect but
+# continuing to service reads, as in pre-2.0.5 Cassandra
+#
+# ignore
+# ignore fatal errors and let the batches fail
+commit_failure_policy: stop
+
+# Maximum size of the native protocol prepared statement cache
+#
+# Valid values are either "auto" (omitting the value) or a value greater 0.
+#
+# Note that specifying a too large value will result in long running GCs and possbily
+# out-of-memory errors. Keep the value at a small fraction of the heap.
+#
+# If you constantly see "prepared statements discarded in the last minute because
+# cache limit reached" messages, the first step is to investigate the root cause
+# of these messages and check whether prepared statements are used correctly -
+# i.e. use bind markers for variable parts.
+#
+# Do only change the default value, if you really have more prepared statements than
+# fit in the cache. In most cases it is not neccessary to change this value.
+# Constantly re-preparing statements is a performance penalty.
+#
+# Default value ("auto") is 1/256th of the heap or 10MB, whichever is greater
+prepared_statements_cache_size_mb:
+
+# Maximum size of the Thrift prepared statement cache
+#
+# If you do not use Thrift at all, it is safe to leave this value at "auto".
+#
+# See description of 'prepared_statements_cache_size_mb' above for more information.
+#
+# Default value ("auto") is 1/256th of the heap or 10MB, whichever is greater
+thrift_prepared_statements_cache_size_mb:
+
+# Maximum size of the key cache in memory.
+#
+# Each key cache hit saves 1 seek and each row cache hit saves 2 seeks at the
+# minimum, sometimes more. The key cache is fairly tiny for the amount of
+# time it saves, so it's worthwhile to use it at large numbers.
+# The row cache saves even more time, but must contain the entire row,
+# so it is extremely space-intensive. It's best to only use the
+# row cache if you have hot rows or static rows.
+#
+# NOTE: if you reduce the size, you may not get you hottest keys loaded on startup.
+#
+# Default value is empty to make it "auto" (min(5% of Heap (in MB), 100MB)). Set to 0 to disable key cache.
+key_cache_size_in_mb:
+
+# Duration in seconds after which Cassandra should
+# save the key cache. Caches are saved to saved_caches_directory as
+# specified in this configuration file.
+#
+# Saved caches greatly improve cold-start speeds, and is relatively cheap in
+# terms of I/O for the key cache. Row cache saving is much more expensive and
+# has limited use.
+#
+# Default is 14400 or 4 hours.
+key_cache_save_period: 14400
+
+# Number of keys from the key cache to save
+# Disabled by default, meaning all keys are going to be saved
+# key_cache_keys_to_save: 100
+
+# Row cache implementation class name. Available implementations:
+#
+# org.apache.cassandra.cache.OHCProvider
+# Fully off-heap row cache implementation (default).
+#
+# org.apache.cassandra.cache.SerializingCacheProvider
+# This is the row cache implementation availabile
+# in previous releases of Cassandra.
+# row_cache_class_name: org.apache.cassandra.cache.OHCProvider
+
+# Maximum size of the row cache in memory.
+# Please note that OHC cache implementation requires some additional off-heap memory to manage
+# the map structures and some in-flight memory during operations before/after cache entries can be
+# accounted against the cache capacity. This overhead is usually small compared to the whole capacity.
+# Do not specify more memory that the system can afford in the worst usual situation and leave some
+# headroom for OS block level cache. Do never allow your system to swap.
+#
+# Default value is 0, to disable row caching.
+row_cache_size_in_mb: 0
+
+# Duration in seconds after which Cassandra should save the row cache.
+# Caches are saved to saved_caches_directory as specified in this configuration file.
+#
+# Saved caches greatly improve cold-start speeds, and is relatively cheap in
+# terms of I/O for the key cache. Row cache saving is much more expensive and
+# has limited use.
+#
+# Default is 0 to disable saving the row cache.
+row_cache_save_period: 0
+
+# Number of keys from the row cache to save.
+# Specify 0 (which is the default), meaning all keys are going to be saved
+# row_cache_keys_to_save: 100
+
+# Maximum size of the counter cache in memory.
+#
+# Counter cache helps to reduce counter locks' contention for hot counter cells.
+# In case of RF = 1 a counter cache hit will cause Cassandra to skip the read before
+# write entirely. With RF > 1 a counter cache hit will still help to reduce the duration
+# of the lock hold, helping with hot counter cell updates, but will not allow skipping
+# the read entirely. Only the local (clock, count) tuple of a counter cell is kept
+# in memory, not the whole counter, so it's relatively cheap.
+#
+# NOTE: if you reduce the size, you may not get you hottest keys loaded on startup.
+#
+# Default value is empty to make it "auto" (min(2.5% of Heap (in MB), 50MB)). Set to 0 to disable counter cache.
+# NOTE: if you perform counter deletes and rely on low gcgs, you should disable the counter cache.
+counter_cache_size_in_mb:
+
+# Duration in seconds after which Cassandra should
+# save the counter cache (keys only). Caches are saved to saved_caches_directory as
+# specified in this configuration file.
+#
+# Default is 7200 or 2 hours.
+counter_cache_save_period: 7200
+
+# Number of keys from the counter cache to save
+# Disabled by default, meaning all keys are going to be saved
+# counter_cache_keys_to_save: 100
+
+# saved caches
+# If not set, the default directory is $CASSANDRA_HOME/data/saved_caches.
+saved_caches_directory: /var/lib/cassandra/saved_caches
+
+# commitlog_sync may be either "periodic" or "batch."
+#
+# When in batch mode, Cassandra won't ack writes until the commit log
+# has been fsynced to disk. It will wait
+# commitlog_sync_batch_window_in_ms milliseconds between fsyncs.
+# This window should be kept short because the writer threads will
+# be unable to do extra work while waiting. (You may need to increase
+# concurrent_writes for the same reason.)
+#
+# commitlog_sync: batch
+# commitlog_sync_batch_window_in_ms: 2
+#
+# the other option is "periodic" where writes may be acked immediately
+# and the CommitLog is simply synced every commitlog_sync_period_in_ms
+# milliseconds.
+commitlog_sync: periodic
+commitlog_sync_period_in_ms: 10000
+
+# The size of the individual commitlog file segments. A commitlog
+# segment may be archived, deleted, or recycled once all the data
+# in it (potentially from each columnfamily in the system) has been
+# flushed to sstables.
+#
+# The default size is 32, which is almost always fine, but if you are
+# archiving commitlog segments (see commitlog_archiving.properties),
+# then you probably want a finer granularity of archiving; 8 or 16 MB
+# is reasonable.
+# Max mutation size is also configurable via max_mutation_size_in_kb setting in
+# cassandra.yaml. The default is half the size commitlog_segment_size_in_mb * 1024.
+# This should be positive and less than 2048.
+#
+# NOTE: If max_mutation_size_in_kb is set explicitly then commitlog_segment_size_in_mb must
+# be set to at least twice the size of max_mutation_size_in_kb / 1024
+#
+commitlog_segment_size_in_mb: 32
+
+# Compression to apply to the commit log. If omitted, the commit log
+# will be written uncompressed. LZ4, Snappy, and Deflate compressors
+# are supported.
+# commitlog_compression:
+# - class_name: LZ4Compressor
+# parameters:
+# -
+
+# any class that implements the SeedProvider interface and has a
+# constructor that takes a Map of parameters will do.
+seed_provider:
+ # Addresses of hosts that are deemed contact points.
+ # Cassandra nodes use this list of hosts to find each other and learn
+ # the topology of the ring. You must change this if you are running
+ # multiple nodes!
+ - class_name: org.apache.cassandra.locator.SimpleSeedProvider
+ parameters:
+ # seeds is actually a comma-delimited list of addresses.
+ # Ex: ",,"
+ - seeds: "172.17.0.2"
+
+# For workloads with more data than can fit in memory, Cassandra's
+# bottleneck will be reads that need to fetch data from
+# disk. "concurrent_reads" should be set to (16 * number_of_drives) in
+# order to allow the operations to enqueue low enough in the stack
+# that the OS and drives can reorder them. Same applies to
+# "concurrent_counter_writes", since counter writes read the current
+# values before incrementing and writing them back.
+#
+# On the other hand, since writes are almost never IO bound, the ideal
+# number of "concurrent_writes" is dependent on the number of cores in
+# your system; (8 * number_of_cores) is a good rule of thumb.
+concurrent_reads: 32
+concurrent_writes: 32
+concurrent_counter_writes: 32
+
+# For materialized view writes, as there is a read involved, so this should
+# be limited by the less of concurrent reads or concurrent writes.
+concurrent_materialized_view_writes: 32
+
+# Maximum memory to use for sstable chunk cache and buffer pooling.
+# 32MB of this are reserved for pooling buffers, the rest is used as an
+# cache that holds uncompressed sstable chunks.
+# Defaults to the smaller of 1/4 of heap or 512MB. This pool is allocated off-heap,
+# so is in addition to the memory allocated for heap. The cache also has on-heap
+# overhead which is roughly 128 bytes per chunk (i.e. 0.2% of the reserved size
+# if the default 64k chunk size is used).
+# Memory is only allocated when needed.
+# file_cache_size_in_mb: 512
+
+# Flag indicating whether to allocate on or off heap when the sstable buffer
+# pool is exhausted, that is when it has exceeded the maximum memory
+# file_cache_size_in_mb, beyond which it will not cache buffers but allocate on request.
+
+# buffer_pool_use_heap_if_exhausted: true
+
+# The strategy for optimizing disk read
+# Possible values are:
+# ssd (for solid state disks, the default)
+# spinning (for spinning disks)
+# disk_optimization_strategy: ssd
+
+# Total permitted memory to use for memtables. Cassandra will stop
+# accepting writes when the limit is exceeded until a flush completes,
+# and will trigger a flush based on memtable_cleanup_threshold
+# If omitted, Cassandra will set both to 1/4 the size of the heap.
+# memtable_heap_space_in_mb: 2048
+# memtable_offheap_space_in_mb: 2048
+
+# memtable_cleanup_threshold is deprecated. The default calculation
+# is the only reasonable choice. See the comments on memtable_flush_writers
+# for more information.
+#
+# Ratio of occupied non-flushing memtable size to total permitted size
+# that will trigger a flush of the largest memtable. Larger mct will
+# mean larger flushes and hence less compaction, but also less concurrent
+# flush activity which can make it difficult to keep your disks fed
+# under heavy write load.
+#
+# memtable_cleanup_threshold defaults to 1 / (memtable_flush_writers + 1)
+# memtable_cleanup_threshold: 0.11
+
+# Specify the way Cassandra allocates and manages memtable memory.
+# Options are:
+#
+# heap_buffers
+# on heap nio buffers
+#
+# offheap_buffers
+# off heap (direct) nio buffers
+#
+# offheap_objects
+# off heap objects
+memtable_allocation_type: heap_buffers
+
+# Total space to use for commit logs on disk.
+#
+# If space gets above this value, Cassandra will flush every dirty CF
+# in the oldest segment and remove it. So a small total commitlog space
+# will tend to cause more flush activity on less-active columnfamilies.
+#
+# The default value is the smaller of 8192, and 1/4 of the total space
+# of the commitlog volume.
+#
+# commitlog_total_space_in_mb: 8192
+
+# This sets the number of memtable flush writer threads per disk
+# as well as the total number of memtables that can be flushed concurrently.
+# These are generally a combination of compute and IO bound.
+#
+# Memtable flushing is more CPU efficient than memtable ingest and a single thread
+# can keep up with the ingest rate of a whole server on a single fast disk
+# until it temporarily becomes IO bound under contention typically with compaction.
+# At that point you need multiple flush threads. At some point in the future
+# it may become CPU bound all the time.
+#
+# You can tell if flushing is falling behind using the MemtablePool.BlockedOnAllocation
+# metric which should be 0, but will be non-zero if threads are blocked waiting on flushing
+# to free memory.
+#
+# memtable_flush_writers defaults to two for a single data directory.
+# This means that two memtables can be flushed concurrently to the single data directory.
+# If you have multiple data directories the default is one memtable flushing at a time
+# but the flush will use a thread per data directory so you will get two or more writers.
+#
+# Two is generally enough to flush on a fast disk [array] mounted as a single data directory.
+# Adding more flush writers will result in smaller more frequent flushes that introduce more
+# compaction overhead.
+#
+# There is a direct tradeoff between number of memtables that can be flushed concurrently
+# and flush size and frequency. More is not better you just need enough flush writers
+# to never stall waiting for flushing to free memory.
+#
+#memtable_flush_writers: 2
+
+# Total space to use for change-data-capture logs on disk.
+#
+# If space gets above this value, Cassandra will throw WriteTimeoutException
+# on Mutations including tables with CDC enabled. A CDCCompactor is responsible
+# for parsing the raw CDC logs and deleting them when parsing is completed.
+#
+# The default value is the min of 4096 mb and 1/8th of the total space
+# of the drive where cdc_raw_directory resides.
+# cdc_total_space_in_mb: 4096
+
+# When we hit our cdc_raw limit and the CDCCompactor is either running behind
+# or experiencing backpressure, we check at the following interval to see if any
+# new space for cdc-tracked tables has been made available. Default to 250ms
+# cdc_free_space_check_interval_ms: 250
+
+# A fixed memory pool size in MB for for SSTable index summaries. If left
+# empty, this will default to 5% of the heap size. If the memory usage of
+# all index summaries exceeds this limit, SSTables with low read rates will
+# shrink their index summaries in order to meet this limit. However, this
+# is a best-effort process. In extreme conditions Cassandra may need to use
+# more than this amount of memory.
+index_summary_capacity_in_mb:
+
+# How frequently index summaries should be resampled. This is done
+# periodically to redistribute memory from the fixed-size pool to sstables
+# proportional their recent read rates. Setting to -1 will disable this
+# process, leaving existing index summaries at their current sampling level.
+index_summary_resize_interval_in_minutes: 60
+
+# Whether to, when doing sequential writing, fsync() at intervals in
+# order to force the operating system to flush the dirty
+# buffers. Enable this to avoid sudden dirty buffer flushing from
+# impacting read latencies. Almost always a good idea on SSDs; not
+# necessarily on platters.
+trickle_fsync: false
+trickle_fsync_interval_in_kb: 10240
+
+# TCP port, for commands and data
+# For security reasons, you should not expose this port to the internet. Firewall it if needed.
+storage_port: 7000
+
+# SSL port, for encrypted communication. Unused unless enabled in
+# encryption_options
+# For security reasons, you should not expose this port to the internet. Firewall it if needed.
+ssl_storage_port: 7001
+
+# Address or interface to bind to and tell other Cassandra nodes to connect to.
+# You _must_ change this if you want multiple nodes to be able to communicate!
+#
+# Set listen_address OR listen_interface, not both.
+#
+# Leaving it blank leaves it up to InetAddress.getLocalHost(). This
+# will always do the Right Thing _if_ the node is properly configured
+# (hostname, name resolution, etc), and the Right Thing is to use the
+# address associated with the hostname (it might not be).
+#
+# Setting listen_address to 0.0.0.0 is always wrong.
+#
+listen_address: 172.17.0.2
+
+# Set listen_address OR listen_interface, not both. Interfaces must correspond
+# to a single address, IP aliasing is not supported.
+# listen_interface: eth0
+
+# If you choose to specify the interface by name and the interface has an ipv4 and an ipv6 address
+# you can specify which should be chosen using listen_interface_prefer_ipv6. If false the first ipv4
+# address will be used. If true the first ipv6 address will be used. Defaults to false preferring
+# ipv4. If there is only one address it will be selected regardless of ipv4/ipv6.
+# listen_interface_prefer_ipv6: false
+
+# Address to broadcast to other Cassandra nodes
+# Leaving this blank will set it to the same value as listen_address
+broadcast_address: 172.17.0.2
+
+# When using multiple physical network interfaces, set this
+# to true to listen on broadcast_address in addition to
+# the listen_address, allowing nodes to communicate in both
+# interfaces.
+# Ignore this property if the network configuration automatically
+# routes between the public and private networks such as EC2.
+# listen_on_broadcast_address: false
+
+# Internode authentication backend, implementing IInternodeAuthenticator;
+# used to allow/disallow connections from peer nodes.
+# internode_authenticator: org.apache.cassandra.auth.AllowAllInternodeAuthenticator
+
+# Whether to start the native transport server.
+# Please note that the address on which the native transport is bound is the
+# same as the rpc_address. The port however is different and specified below.
+start_native_transport: true
+# port for the CQL native transport to listen for clients on
+# For security reasons, you should not expose this port to the internet. Firewall it if needed.
+native_transport_port: 9042
+# Enabling native transport encryption in client_encryption_options allows you to either use
+# encryption for the standard port or to use a dedicated, additional port along with the unencrypted
+# standard native_transport_port.
+# Enabling client encryption and keeping native_transport_port_ssl disabled will use encryption
+# for native_transport_port. Setting native_transport_port_ssl to a different value
+# from native_transport_port will use encryption for native_transport_port_ssl while
+# keeping native_transport_port unencrypted.
+# native_transport_port_ssl: 9142
+# The maximum threads for handling requests when the native transport is used.
+# This is similar to rpc_max_threads though the default differs slightly (and
+# there is no native_transport_min_threads, idle threads will always be stopped
+# after 30 seconds).
+# native_transport_max_threads: 128
+#
+# The maximum size of allowed frame. Frame (requests) larger than this will
+# be rejected as invalid. The default is 256MB. If you're changing this parameter,
+# you may want to adjust max_value_size_in_mb accordingly. This should be positive and less than 2048.
+# native_transport_max_frame_size_in_mb: 256
+
+# The maximum number of concurrent client connections.
+# The default is -1, which means unlimited.
+# native_transport_max_concurrent_connections: -1
+
+# The maximum number of concurrent client connections per source ip.
+# The default is -1, which means unlimited.
+# native_transport_max_concurrent_connections_per_ip: -1
+
+# Whether to start the thrift rpc server.
+start_rpc: false
+
+# The address or interface to bind the Thrift RPC service and native transport
+# server to.
+#
+# Set rpc_address OR rpc_interface, not both.
+#
+# Leaving rpc_address blank has the same effect as on listen_address
+# (i.e. it will be based on the configured hostname of the node).
+#
+# Note that unlike listen_address, you can specify 0.0.0.0, but you must also
+# set broadcast_rpc_address to a value other than 0.0.0.0.
+#
+# For security reasons, you should not expose this port to the internet. Firewall it if needed.
+rpc_address: 0.0.0.0
+
+# Set rpc_address OR rpc_interface, not both. Interfaces must correspond
+# to a single address, IP aliasing is not supported.
+# rpc_interface: eth1
+
+# If you choose to specify the interface by name and the interface has an ipv4 and an ipv6 address
+# you can specify which should be chosen using rpc_interface_prefer_ipv6. If false the first ipv4
+# address will be used. If true the first ipv6 address will be used. Defaults to false preferring
+# ipv4. If there is only one address it will be selected regardless of ipv4/ipv6.
+# rpc_interface_prefer_ipv6: false
+
+# port for Thrift to listen for clients on
+rpc_port: 9160
+
+# RPC address to broadcast to drivers and other Cassandra nodes. This cannot
+# be set to 0.0.0.0. If left blank, this will be set to the value of
+# rpc_address. If rpc_address is set to 0.0.0.0, broadcast_rpc_address must
+# be set.
+broadcast_rpc_address: 172.17.0.2
+
+# enable or disable keepalive on rpc/native connections
+rpc_keepalive: true
+
+# Cassandra provides two out-of-the-box options for the RPC Server:
+#
+# sync
+# One thread per thrift connection. For a very large number of clients, memory
+# will be your limiting factor. On a 64 bit JVM, 180KB is the minimum stack size
+# per thread, and that will correspond to your use of virtual memory (but physical memory
+# may be limited depending on use of stack space).
+#
+# hsha
+# Stands for "half synchronous, half asynchronous." All thrift clients are handled
+# asynchronously using a small number of threads that does not vary with the amount
+# of thrift clients (and thus scales well to many clients). The rpc requests are still
+# synchronous (one thread per active request). If hsha is selected then it is essential
+# that rpc_max_threads is changed from the default value of unlimited.
+#
+# The default is sync because on Windows hsha is about 30% slower. On Linux,
+# sync/hsha performance is about the same, with hsha of course using less memory.
+#
+# Alternatively, can provide your own RPC server by providing the fully-qualified class name
+# of an o.a.c.t.TServerFactory that can create an instance of it.
+rpc_server_type: sync
+
+# Uncomment rpc_min|max_thread to set request pool size limits.
+#
+# Regardless of your choice of RPC server (see above), the number of maximum requests in the
+# RPC thread pool dictates how many concurrent requests are possible (but if you are using the sync
+# RPC server, it also dictates the number of clients that can be connected at all).
+#
+# The default is unlimited and thus provides no protection against clients overwhelming the server. You are
+# encouraged to set a maximum that makes sense for you in production, but do keep in mind that
+# rpc_max_threads represents the maximum number of client requests this server may execute concurrently.
+#
+# rpc_min_threads: 16
+# rpc_max_threads: 2048
+
+# uncomment to set socket buffer sizes on rpc connections
+# rpc_send_buff_size_in_bytes:
+# rpc_recv_buff_size_in_bytes:
+
+# Uncomment to set socket buffer size for internode communication
+# Note that when setting this, the buffer size is limited by net.core.wmem_max
+# and when not setting it it is defined by net.ipv4.tcp_wmem
+# See also:
+# /proc/sys/net/core/wmem_max
+# /proc/sys/net/core/rmem_max
+# /proc/sys/net/ipv4/tcp_wmem
+# /proc/sys/net/ipv4/tcp_wmem
+# and 'man tcp'
+# internode_send_buff_size_in_bytes:
+
+# Uncomment to set socket buffer size for internode communication
+# Note that when setting this, the buffer size is limited by net.core.wmem_max
+# and when not setting it it is defined by net.ipv4.tcp_wmem
+# internode_recv_buff_size_in_bytes:
+
+# Frame size for thrift (maximum message length).
+thrift_framed_transport_size_in_mb: 15
+
+# Set to true to have Cassandra create a hard link to each sstable
+# flushed or streamed locally in a backups/ subdirectory of the
+# keyspace data. Removing these links is the operator's
+# responsibility.
+incremental_backups: false
+
+# Whether or not to take a snapshot before each compaction. Be
+# careful using this option, since Cassandra won't clean up the
+# snapshots for you. Mostly useful if you're paranoid when there
+# is a data format change.
+snapshot_before_compaction: false
+
+# Whether or not a snapshot is taken of the data before keyspace truncation
+# or dropping of column families. The STRONGLY advised default of true
+# should be used to provide data safety. If you set this flag to false, you will
+# lose data on truncation or drop.
+auto_snapshot: true
+
+# Granularity of the collation index of rows within a partition.
+# Increase if your rows are large, or if you have a very large
+# number of rows per partition. The competing goals are these:
+#
+# - a smaller granularity means more index entries are generated
+# and looking up rows withing the partition by collation column
+# is faster
+# - but, Cassandra will keep the collation index in memory for hot
+# rows (as part of the key cache), so a larger granularity means
+# you can cache more hot rows
+column_index_size_in_kb: 64
+
+# Per sstable indexed key cache entries (the collation index in memory
+# mentioned above) exceeding this size will not be held on heap.
+# This means that only partition information is held on heap and the
+# index entries are read from disk.
+#
+# Note that this size refers to the size of the
+# serialized index information and not the size of the partition.
+column_index_cache_size_in_kb: 2
+
+# Number of simultaneous compactions to allow, NOT including
+# validation "compactions" for anti-entropy repair. Simultaneous
+# compactions can help preserve read performance in a mixed read/write
+# workload, by mitigating the tendency of small sstables to accumulate
+# during a single long running compactions. The default is usually
+# fine and if you experience problems with compaction running too
+# slowly or too fast, you should look at
+# compaction_throughput_mb_per_sec first.
+#
+# concurrent_compactors defaults to the smaller of (number of disks,
+# number of cores), with a minimum of 2 and a maximum of 8.
+#
+# If your data directories are backed by SSD, you should increase this
+# to the number of cores.
+#concurrent_compactors: 1
+
+# Throttles compaction to the given total throughput across the entire
+# system. The faster you insert data, the faster you need to compact in
+# order to keep the sstable count down, but in general, setting this to
+# 16 to 32 times the rate you are inserting data is more than sufficient.
+# Setting this to 0 disables throttling. Note that this account for all types
+# of compaction, including validation compaction.
+compaction_throughput_mb_per_sec: 16
+
+# When compacting, the replacement sstable(s) can be opened before they
+# are completely written, and used in place of the prior sstables for
+# any range that has been written. This helps to smoothly transfer reads
+# between the sstables, reducing page cache churn and keeping hot rows hot
+sstable_preemptive_open_interval_in_mb: 50
+
+# Throttles all outbound streaming file transfers on this node to the
+# given total throughput in Mbps. This is necessary because Cassandra does
+# mostly sequential IO when streaming data during bootstrap or repair, which
+# can lead to saturating the network connection and degrading rpc performance.
+# When unset, the default is 200 Mbps or 25 MB/s.
+# stream_throughput_outbound_megabits_per_sec: 200
+
+# Throttles all streaming file transfer between the datacenters,
+# this setting allows users to throttle inter dc stream throughput in addition
+# to throttling all network stream traffic as configured with
+# stream_throughput_outbound_megabits_per_sec
+# When unset, the default is 200 Mbps or 25 MB/s
+# inter_dc_stream_throughput_outbound_megabits_per_sec: 200
+
+# How long the coordinator should wait for read operations to complete
+read_request_timeout_in_ms: 5000
+# How long the coordinator should wait for seq or index scans to complete
+range_request_timeout_in_ms: 10000
+# How long the coordinator should wait for writes to complete
+write_request_timeout_in_ms: 2000
+# How long the coordinator should wait for counter writes to complete
+counter_write_request_timeout_in_ms: 5000
+# How long a coordinator should continue to retry a CAS operation
+# that contends with other proposals for the same row
+cas_contention_timeout_in_ms: 1000
+# How long the coordinator should wait for truncates to complete
+# (This can be much longer, because unless auto_snapshot is disabled
+# we need to flush first so we can snapshot before removing the data.)
+truncate_request_timeout_in_ms: 60000
+# The default timeout for other, miscellaneous operations
+request_timeout_in_ms: 10000
+
+# How long before a node logs slow queries. Select queries that take longer than
+# this timeout to execute, will generate an aggregated log message, so that slow queries
+# can be identified. Set this value to zero to disable slow query logging.
+slow_query_log_timeout_in_ms: 500
+
+# Enable operation timeout information exchange between nodes to accurately
+# measure request timeouts. If disabled, replicas will assume that requests
+# were forwarded to them instantly by the coordinator, which means that
+# under overload conditions we will waste that much extra time processing
+# already-timed-out requests.
+#
+# Warning: before enabling this property make sure to ntp is installed
+# and the times are synchronized between the nodes.
+cross_node_timeout: false
+
+# Set keep-alive period for streaming
+# This node will send a keep-alive message periodically with this period.
+# If the node does not receive a keep-alive message from the peer for
+# 2 keep-alive cycles the stream session times out and fail
+# Default value is 300s (5 minutes), which means stalled stream
+# times out in 10 minutes by default
+# streaming_keep_alive_period_in_secs: 300
+
+# phi value that must be reached for a host to be marked down.
+# most users should never need to adjust this.
+# phi_convict_threshold: 8
+
+# endpoint_snitch -- Set this to a class that implements
+# IEndpointSnitch. The snitch has two functions:
+#
+# - it teaches Cassandra enough about your network topology to route
+# requests efficiently
+# - it allows Cassandra to spread replicas around your cluster to avoid
+# correlated failures. It does this by grouping machines into
+# "datacenters" and "racks." Cassandra will do its best not to have
+# more than one replica on the same "rack" (which may not actually
+# be a physical location)
+#
+# CASSANDRA WILL NOT ALLOW YOU TO SWITCH TO AN INCOMPATIBLE SNITCH
+# ONCE DATA IS INSERTED INTO THE CLUSTER. This would cause data loss.
+# This means that if you start with the default SimpleSnitch, which
+# locates every node on "rack1" in "datacenter1", your only options
+# if you need to add another datacenter are GossipingPropertyFileSnitch
+# (and the older PFS). From there, if you want to migrate to an
+# incompatible snitch like Ec2Snitch you can do it by adding new nodes
+# under Ec2Snitch (which will locate them in a new "datacenter") and
+# decommissioning the old ones.
+#
+# Out of the box, Cassandra provides:
+#
+# SimpleSnitch:
+# Treats Strategy order as proximity. This can improve cache
+# locality when disabling read repair. Only appropriate for
+# single-datacenter deployments.
+#
+# GossipingPropertyFileSnitch
+# This should be your go-to snitch for production use. The rack
+# and datacenter for the local node are defined in
+# cassandra-rackdc.properties and propagated to other nodes via
+# gossip. If cassandra-topology.properties exists, it is used as a
+# fallback, allowing migration from the PropertyFileSnitch.
+#
+# PropertyFileSnitch:
+# Proximity is determined by rack and data center, which are
+# explicitly configured in cassandra-topology.properties.
+#
+# Ec2Snitch:
+# Appropriate for EC2 deployments in a single Region. Loads Region
+# and Availability Zone information from the EC2 API. The Region is
+# treated as the datacenter, and the Availability Zone as the rack.
+# Only private IPs are used, so this will not work across multiple
+# Regions.
+#
+# Ec2MultiRegionSnitch:
+# Uses public IPs as broadcast_address to allow cross-region
+# connectivity. (Thus, you should set seed addresses to the public
+# IP as well.) You will need to open the storage_port or
+# ssl_storage_port on the public IP firewall. (For intra-Region
+# traffic, Cassandra will switch to the private IP after
+# establishing a connection.)
+#
+# RackInferringSnitch:
+# Proximity is determined by rack and data center, which are
+# assumed to correspond to the 3rd and 2nd octet of each node's IP
+# address, respectively. Unless this happens to match your
+# deployment conventions, this is best used as an example of
+# writing a custom Snitch class and is provided in that spirit.
+#
+# You can use a custom Snitch by setting this to the full class name
+# of the snitch, which will be assumed to be on your classpath.
+endpoint_snitch: SimpleSnitch
+
+# controls how often to perform the more expensive part of host score
+# calculation
+dynamic_snitch_update_interval_in_ms: 100
+# controls how often to reset all host scores, allowing a bad host to
+# possibly recover
+dynamic_snitch_reset_interval_in_ms: 600000
+# if set greater than zero and read_repair_chance is < 1.0, this will allow
+# 'pinning' of replicas to hosts in order to increase cache capacity.
+# The badness threshold will control how much worse the pinned host has to be
+# before the dynamic snitch will prefer other replicas over it. This is
+# expressed as a double which represents a percentage. Thus, a value of
+# 0.2 means Cassandra would continue to prefer the static snitch values
+# until the pinned host was 20% worse than the fastest.
+dynamic_snitch_badness_threshold: 0.1
+
+# request_scheduler -- Set this to a class that implements
+# RequestScheduler, which will schedule incoming client requests
+# according to the specific policy. This is useful for multi-tenancy
+# with a single Cassandra cluster.
+# NOTE: This is specifically for requests from the client and does
+# not affect inter node communication.
+# org.apache.cassandra.scheduler.NoScheduler - No scheduling takes place
+# org.apache.cassandra.scheduler.RoundRobinScheduler - Round robin of
+# client requests to a node with a separate queue for each
+# request_scheduler_id. The scheduler is further customized by
+# request_scheduler_options as described below.
+request_scheduler: org.apache.cassandra.scheduler.NoScheduler
+
+# Scheduler Options vary based on the type of scheduler
+#
+# NoScheduler
+# Has no options
+#
+# RoundRobin
+# throttle_limit
+# The throttle_limit is the number of in-flight
+# requests per client. Requests beyond
+# that limit are queued up until
+# running requests can complete.
+# The value of 80 here is twice the number of
+# concurrent_reads + concurrent_writes.
+# default_weight
+# default_weight is optional and allows for
+# overriding the default which is 1.
+# weights
+# Weights are optional and will default to 1 or the
+# overridden default_weight. The weight translates into how
+# many requests are handled during each turn of the
+# RoundRobin, based on the scheduler id.
+#
+# request_scheduler_options:
+# throttle_limit: 80
+# default_weight: 5
+# weights:
+# Keyspace1: 1
+# Keyspace2: 5
+
+# request_scheduler_id -- An identifier based on which to perform
+# the request scheduling. Currently the only valid option is keyspace.
+# request_scheduler_id: keyspace
+
+# Enable or disable inter-node encryption
+# JVM defaults for supported SSL socket protocols and cipher suites can
+# be replaced using custom encryption options. This is not recommended
+# unless you have policies in place that dictate certain settings, or
+# need to disable vulnerable ciphers or protocols in case the JVM cannot
+# be updated.
+# FIPS compliant settings can be configured at JVM level and should not
+# involve changing encryption settings here:
+# https://docs.oracle.com/javase/8/docs/technotes/guides/security/jsse/FIPS.html
+# *NOTE* No custom encryption options are enabled at the moment
+# The available internode options are : all, none, dc, rack
+#
+# If set to dc cassandra will encrypt the traffic between the DCs
+# If set to rack cassandra will encrypt the traffic between the racks
+#
+# The passwords used in these options must match the passwords used when generating
+# the keystore and truststore. For instructions on generating these files, see:
+# http://download.oracle.com/javase/6/docs/technotes/guides/security/jsse/JSSERefGuide.html#CreateKeystore
+#
+server_encryption_options:
+ internode_encryption: none
+ keystore: conf/keystore
+ keystore_password: cassandra
+ truststore: conf/.truststore
+ truststore_password: cassandra
+ # More advanced defaults below:
+ # protocol: TLS
+ # algorithm: SunX509
+ # store_type: JKS
+ # cipher_suites: [TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA,TLS_DHE_RSA_WITH_AES_128_CBC_SHA,TLS_DHE_RSA_WITH_AES_256_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA]
+ # require_client_auth: false
+ # require_endpoint_verification: false
+
+# enable or disable client/server encryption.
+client_encryption_options:
+ enabled: true
+ # If enabled and optional is set to true encrypted and unencrypted connections are handled.
+ optional: false
+ keystore: /etc/cassandra/keystore.p12
+ keystore_password: "cassandra"
+ require_client_auth: true
+ truststore: /etc/cassandra/truststore.p12
+ truststore_password: "cassandra"
+ store_type: PKCS12
+ # More advanced defaults below:
+ # protocol: TLS
+ # algorithm: SunX509
+ # store_type: JKS
+ # cipher_suites: [TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA,TLS_DHE_RSA_WITH_AES_128_CBC_SHA,TLS_DHE_RSA_WITH_AES_256_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA]
+
+# internode_compression controls whether traffic between nodes is
+# compressed.
+# Can be:
+#
+# all
+# all traffic is compressed
+#
+# dc
+# traffic between different datacenters is compressed
+#
+# none
+# nothing is compressed.
+internode_compression: dc
+
+# Enable or disable tcp_nodelay for inter-dc communication.
+# Disabling it will result in larger (but fewer) network packets being sent,
+# reducing overhead from the TCP protocol itself, at the cost of increasing
+# latency if you block for cross-datacenter responses.
+inter_dc_tcp_nodelay: false
+
+# TTL for different trace types used during logging of the repair process.
+tracetype_query_ttl: 86400
+tracetype_repair_ttl: 604800
+
+# By default, Cassandra logs GC Pauses greater than 200 ms at INFO level
+# This threshold can be adjusted to minimize logging if necessary
+# gc_log_threshold_in_ms: 200
+
+# If unset, all GC Pauses greater than gc_log_threshold_in_ms will log at
+# INFO level
+# UDFs (user defined functions) are disabled by default.
+# As of Cassandra 3.0 there is a sandbox in place that should prevent execution of evil code.
+enable_user_defined_functions: false
+
+# Enables scripted UDFs (JavaScript UDFs).
+# Java UDFs are always enabled, if enable_user_defined_functions is true.
+# Enable this option to be able to use UDFs with "language javascript" or any custom JSR-223 provider.
+# This option has no effect, if enable_user_defined_functions is false.
+enable_scripted_user_defined_functions: false
+
+# The default Windows kernel timer and scheduling resolution is 15.6ms for power conservation.
+# Lowering this value on Windows can provide much tighter latency and better throughput, however
+# some virtualized environments may see a negative performance impact from changing this setting
+# below their system default. The sysinternals 'clockres' tool can confirm your system's default
+# setting.
+windows_timer_interval: 1
+
+
+# Enables encrypting data at-rest (on disk). Different key providers can be plugged in, but the default reads from
+# a JCE-style keystore. A single keystore can hold multiple keys, but the one referenced by
+# the "key_alias" is the only key that will be used for encrypt opertaions; previously used keys
+# can still (and should!) be in the keystore and will be used on decrypt operations
+# (to handle the case of key rotation).
+#
+# It is strongly recommended to download and install Java Cryptography Extension (JCE)
+# Unlimited Strength Jurisdiction Policy Files for your version of the JDK.
+# (current link: http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html)
+#
+# Currently, only the following file types are supported for transparent data encryption, although
+# more are coming in future cassandra releases: commitlog, hints
+transparent_data_encryption_options:
+ enabled: false
+ chunk_length_kb: 64
+ cipher: AES/CBC/PKCS5Padding
+ key_alias: testing:1
+ # CBC IV length for AES needs to be 16 bytes (which is also the default size)
+ # iv_length: 16
+ key_provider:
+ - class_name: org.apache.cassandra.security.JKSKeyProvider
+ parameters:
+ - keystore: conf/keystore
+ keystore_password: cassandra
+ store_type: JCEKS
+ key_password: cassandra
+
+
+#####################
+# SAFETY THRESHOLDS #
+#####################
+
+# When executing a scan, within or across a partition, we need to keep the
+# tombstones seen in memory so we can return them to the coordinator, which
+# will use them to make sure other replicas also know about the deleted rows.
+# With workloads that generate a lot of tombstones, this can cause performance
+# problems and even exaust the server heap.
+# (http://www.datastax.com/dev/blog/cassandra-anti-patterns-queues-and-queue-like-datasets)
+# Adjust the thresholds here if you understand the dangers and want to
+# scan more tombstones anyway. These thresholds may also be adjusted at runtime
+# using the StorageService mbean.
+tombstone_warn_threshold: 1000
+tombstone_failure_threshold: 100000
+
+# Log WARN on any multiple-partition batch size exceeding this value. 5kb per batch by default.
+# Caution should be taken on increasing the size of this threshold as it can lead to node instability.
+batch_size_warn_threshold_in_kb: 5
+
+# Fail any multiple-partition batch exceeding this value. 50kb (10x warn threshold) by default.
+batch_size_fail_threshold_in_kb: 50
+
+# Log WARN on any batches not of type LOGGED than span across more partitions than this limit
+unlogged_batch_across_partitions_warn_threshold: 10
+
+# Log a warning when compacting partitions larger than this value
+compaction_large_partition_warning_threshold_mb: 100
+
+# GC Pauses greater than gc_warn_threshold_in_ms will be logged at WARN level
+# Adjust the threshold based on your application throughput requirement
+# By default, Cassandra logs GC Pauses greater than 200 ms at INFO level
+gc_warn_threshold_in_ms: 1000
+
+# Maximum size of any value in SSTables. Safety measure to detect SSTable corruption
+# early. Any value size larger than this threshold will result into marking an SSTable
+# as corrupted. This should be positive and less than 2048.
+# max_value_size_in_mb: 256
+
+# Back-pressure settings #
+# If enabled, the coordinator will apply the back-pressure strategy specified below to each mutation
+# sent to replicas, with the aim of reducing pressure on overloaded replicas.
+back_pressure_enabled: false
+# The back-pressure strategy applied.
+# The default implementation, RateBasedBackPressure, takes three arguments:
+# high ratio, factor, and flow type, and uses the ratio between incoming mutation responses and outgoing mutation requests.
+# If below high ratio, outgoing mutations are rate limited according to the incoming rate decreased by the given factor;
+# if above high ratio, the rate limiting is increased by the given factor;
+# such factor is usually best configured between 1 and 10, use larger values for a faster recovery
+# at the expense of potentially more dropped mutations;
+# the rate limiting is applied according to the flow type: if FAST, it's rate limited at the speed of the fastest replica,
+# if SLOW at the speed of the slowest one.
+# New strategies can be added. Implementors need to implement org.apache.cassandra.net.BackpressureStrategy and
+# provide a public constructor accepting a Map.
+back_pressure_strategy:
+ - class_name: org.apache.cassandra.net.RateBasedBackPressure
+ parameters:
+ - high_ratio: 0.90
+ factor: 5
+ flow: FAST
+
+# Coalescing Strategies #
+# Coalescing multiples messages turns out to significantly boost message processing throughput (think doubling or more).
+# On bare metal, the floor for packet processing throughput is high enough that many applications won't notice, but in
+# virtualized environments, the point at which an application can be bound by network packet processing can be
+# surprisingly low compared to the throughput of task processing that is possible inside a VM. It's not that bare metal
+# doesn't benefit from coalescing messages, it's that the number of packets a bare metal network interface can process
+# is sufficient for many applications such that no load starvation is experienced even without coalescing.
+# There are other benefits to coalescing network messages that are harder to isolate with a simple metric like messages
+# per second. By coalescing multiple tasks together, a network thread can process multiple messages for the cost of one
+# trip to read from a socket, and all the task submission work can be done at the same time reducing context switching
+# and increasing cache friendliness of network message processing.
+# See CASSANDRA-8692 for details.
+
+# Strategy to use for coalescing messages in OutboundTcpConnection.
+# Can be fixed, movingaverage, timehorizon, disabled (default).
+# You can also specify a subclass of CoalescingStrategies.CoalescingStrategy by name.
+# otc_coalescing_strategy: DISABLED
+
+# How many microseconds to wait for coalescing. For fixed strategy this is the amount of time after the first
+# message is received before it will be sent with any accompanying messages. For moving average this is the
+# maximum amount of time that will be waited as well as the interval at which messages must arrive on average
+# for coalescing to be enabled.
+# otc_coalescing_window_us: 200
+
+# Do not try to coalesce messages if we already got that many messages. This should be more than 2 and less than 128.
+# otc_coalescing_enough_coalesced_messages: 8
+
+# How many milliseconds to wait between two expiration runs on the backlog (queue) of the OutboundTcpConnection.
+# Expiration is done if messages are piling up in the backlog. Droppable messages are expired to free the memory
+# taken by expired messages. The interval should be between 0 and 1000, and in most installations the default value
+# will be appropriate. A smaller value could potentially expire messages slightly sooner at the expense of more CPU
+# time and queue contention while iterating the backlog of messages.
+# An interval of 0 disables any wait time, which is the behavior of former Cassandra versions.
+#
+# otc_backlog_expiration_interval_ms: 200
diff --git a/modules/cassandra/src/test/resources/cassandra-ssl-configuration/keystore.p12 b/modules/cassandra/src/test/resources/cassandra-ssl-configuration/keystore.p12
new file mode 100644
index 00000000000..501e25cf967
Binary files /dev/null and b/modules/cassandra/src/test/resources/cassandra-ssl-configuration/keystore.p12 differ
diff --git a/modules/cassandra/src/test/resources/cassandra-ssl-configuration/truststore.p12 b/modules/cassandra/src/test/resources/cassandra-ssl-configuration/truststore.p12
new file mode 100644
index 00000000000..57107fc3813
Binary files /dev/null and b/modules/cassandra/src/test/resources/cassandra-ssl-configuration/truststore.p12 differ
diff --git a/modules/cassandra/src/test/resources/cassandra-test-configuration-example/cassandra.yaml b/modules/cassandra/src/test/resources/cassandra-test-configuration-example/cassandra.yaml
index 5b57b2a8e58..426dea64771 100644
--- a/modules/cassandra/src/test/resources/cassandra-test-configuration-example/cassandra.yaml
+++ b/modules/cassandra/src/test/resources/cassandra-test-configuration-example/cassandra.yaml
@@ -250,7 +250,7 @@ commit_failure_policy: stop
#
# Valid values are either "auto" (omitting the value) or a value greater 0.
#
-# Note that specifying a too large value will result in long running GCs and possbily
+# Note that specifying a too large value will result in long running GCs and possibly
# out-of-memory errors. Keep the value at a small fraction of the heap.
#
# If you constantly see "prepared statements discarded in the last minute because
@@ -259,7 +259,7 @@ commit_failure_policy: stop
# i.e. use bind markers for variable parts.
#
# Do only change the default value, if you really have more prepared statements than
-# fit in the cache. In most cases it is not neccessary to change this value.
+# fit in the cache. In most cases it is not necessary to change this value.
# Constantly re-preparing statements is a performance penalty.
#
# Default value ("auto") is 1/256th of the heap or 10MB, whichever is greater
@@ -309,7 +309,7 @@ key_cache_save_period: 14400
# Fully off-heap row cache implementation (default).
#
# org.apache.cassandra.cache.SerializingCacheProvider
-# This is the row cache implementation availabile
+# This is the row cache implementation available
# in previous releases of Cassandra.
# row_cache_class_name: org.apache.cassandra.cache.OHCProvider
@@ -444,7 +444,7 @@ concurrent_counter_writes: 32
concurrent_materialized_view_writes: 32
# Maximum memory to use for sstable chunk cache and buffer pooling.
-# 32MB of this are reserved for pooling buffers, the rest is used as an
+# 32MB of this are reserved for pooling buffers, the rest is used as a
# cache that holds uncompressed sstable chunks.
# Defaults to the smaller of 1/4 of heap or 512MB. This pool is allocated off-heap,
# so is in addition to the memory allocated for heap. The cache also has on-heap
@@ -553,7 +553,7 @@ memtable_allocation_type: heap_buffers
# new space for cdc-tracked tables has been made available. Default to 250ms
# cdc_free_space_check_interval_ms: 250
-# A fixed memory pool size in MB for for SSTable index summaries. If left
+# A fixed memory pool size in MB for SSTable index summaries. If left
# empty, this will default to 5% of the heap size. If the memory usage of
# all index summaries exceeds this limit, SSTables with low read rates will
# shrink their index summaries in order to meet this limit. However, this
@@ -778,7 +778,7 @@ auto_snapshot: true
# number of rows per partition. The competing goals are these:
#
# - a smaller granularity means more index entries are generated
-# and looking up rows withing the partition by collation column
+# and looking up rows within the partition by collation column
# is faster
# - but, Cassandra will keep the collation index in memory for hot
# rows (as part of the key cache), so a larger granularity means
@@ -1109,7 +1109,7 @@ windows_timer_interval: 1
# Enables encrypting data at-rest (on disk). Different key providers can be plugged in, but the default reads from
# a JCE-style keystore. A single keystore can hold multiple keys, but the one referenced by
-# the "key_alias" is the only key that will be used for encrypt opertaions; previously used keys
+# the "key_alias" is the only key that will be used for encrypt operations; previously used keys
# can still (and should!) be in the keystore and will be used on decrypt operations
# (to handle the case of key rotation).
#
@@ -1143,7 +1143,7 @@ transparent_data_encryption_options:
# tombstones seen in memory so we can return them to the coordinator, which
# will use them to make sure other replicas also know about the deleted rows.
# With workloads that generate a lot of tombstones, this can cause performance
-# problems and even exaust the server heap.
+# problems and even exhaust the server heap.
# (http://www.datastax.com/dev/blog/cassandra-anti-patterns-queues-and-queue-like-datasets)
# Adjust the thresholds here if you understand the dangers and want to
# scan more tombstones anyway. These thresholds may also be adjusted at runtime
diff --git a/modules/cassandra/src/test/resources/client-ssl/cassandra.cer.pem b/modules/cassandra/src/test/resources/client-ssl/cassandra.cer.pem
new file mode 100644
index 00000000000..bafaa00317b
--- /dev/null
+++ b/modules/cassandra/src/test/resources/client-ssl/cassandra.cer.pem
@@ -0,0 +1,26 @@
+Bag Attributes
+ friendlyName: localhost
+ localKeyID: 54 69 6D 65 20 31 37 32 39 33 34 38 39 36 38 31 31 39
+subject=C = None, L = None, O = Testcontainers, OU = Testcontainers, CN = localhost
+issuer=C = None, L = None, O = Testcontainers, OU = Testcontainers, CN = localhost
+-----BEGIN CERTIFICATE-----
+MIIDbjCCAlagAwIBAgIJAKCVIipuH03/MA0GCSqGSIb3DQEBCwUAMGQxDTALBgNV
+BAYTBE5vbmUxDTALBgNVBAcTBE5vbmUxFzAVBgNVBAoTDlRlc3Rjb250YWluZXJz
+MRcwFQYDVQQLEw5UZXN0Y29udGFpbmVyczESMBAGA1UEAxMJbG9jYWxob3N0MCAX
+DTI0MTAxOTE0NDIwOFoYDzIxMjQwOTI1MTQ0MjA4WjBkMQ0wCwYDVQQGEwROb25l
+MQ0wCwYDVQQHEwROb25lMRcwFQYDVQQKEw5UZXN0Y29udGFpbmVyczEXMBUGA1UE
+CxMOVGVzdGNvbnRhaW5lcnMxEjAQBgNVBAMTCWxvY2FsaG9zdDCCASIwDQYJKoZI
+hvcNAQEBBQADggEPADCCAQoCggEBALocrhrM1gYB/pF/qlDY+eFQZ9L8SMgCmn+I
+mgx/UbKqJwLp5wYuoW/PA4RwraFPkimf5CAE2kpBGcJu/Qzyp0fJZlBXpmkDJVrG
+pRbYz5mN4CrXNliYfAC1RzxvTT1tOjiDkk9kHVfs5nMVb9e2kq6tQEItflhlPzdD
+FOe0pY2XBX2stcQ6URRkK5buyPeLhnTrKMfLWEWKKKzSQGen+lbtBURZzkpmK88q
+qjLqqaZusXP6QlRVLqMADjQf7aXLi0A/fIhVrq1amqqiApJbijT0LP48DvS8DQQL
+jNKkQ17vMClMmXusU5IgJMlXfGEzeTNUI56wHGYUdE69FTGFvZECAwEAAaMhMB8w
+HQYDVR0OBBYEFNsvIE+IgkE0aTc+1MI7hpPQL2ZEMA0GCSqGSIb3DQEBCwUAA4IB
+AQC4U/tGPuRS3m/r1p3aAq0D88UGg6oKHwqe3re3xrFAv9y+Y3M+FXyh5w/yMCAr
+PcVo6Pef3hEjwc9wDuQoIcQ9eRZtYI1RnhkkuC8TZRk1KGKg9Lj4Zzbse7FfK92Z
+DUYgIVyhC/YkeEDwTiZI8WxhbglozNg5Ygw+qLK4rYmk+X/NgdfdQHocuJ3Jwqqx
+eYz0m2RUMhzxEI2z9jQr3DgjNkYrphLzaVXmO4MovzXx3DNeC8ADot9PGmaz24rl
+RDeSWynxbgqzdXGHxtyR0LY1k+Y+5wqU28L90D0o3ZtaMBnK+Ft2AP2zpbtgr8rR
+sf12uPyRUPzJQ46KNpjy4HN6
+-----END CERTIFICATE-----
diff --git a/modules/cassandra/src/test/resources/client-ssl/cassandra.key.pem b/modules/cassandra/src/test/resources/client-ssl/cassandra.key.pem
new file mode 100644
index 00000000000..4d291cf8852
--- /dev/null
+++ b/modules/cassandra/src/test/resources/client-ssl/cassandra.key.pem
@@ -0,0 +1,32 @@
+Bag Attributes
+ friendlyName: localhost
+ localKeyID: 54 69 6D 65 20 31 37 32 39 33 34 38 39 36 38 31 31 39
+Key Attributes:
+-----BEGIN PRIVATE KEY-----
+MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQC6HK4azNYGAf6R
+f6pQ2PnhUGfS/EjIApp/iJoMf1GyqicC6ecGLqFvzwOEcK2hT5Ipn+QgBNpKQRnC
+bv0M8qdHyWZQV6ZpAyVaxqUW2M+ZjeAq1zZYmHwAtUc8b009bTo4g5JPZB1X7OZz
+FW/XtpKurUBCLX5YZT83QxTntKWNlwV9rLXEOlEUZCuW7sj3i4Z06yjHy1hFiiis
+0kBnp/pW7QVEWc5KZivPKqoy6qmmbrFz+kJUVS6jAA40H+2ly4tAP3yIVa6tWpqq
+ogKSW4o09Cz+PA70vA0EC4zSpENe7zApTJl7rFOSICTJV3xhM3kzVCOesBxmFHRO
+vRUxhb2RAgMBAAECggEACqD5e7C+Rr8oz+jS/z8FAxsmcsqgFXW6NEjG4EPWx89a
+RWfthVFDov3XNsizzp/OulXWH2xnhkOyU7cm+Ia7JI+Z9w8Qz+dM5AkVA8Y23o9X
+TnSjNx57DODnEP21eZAzxpp50DlPFU02pzsbYhE2AbsFp0HirB9MI70CN24xR9hP
+i1zPgO7FVnLvn4INqVKgcV4vXlxvgDEvO4Myc1WoJXkyPCCObvEflBBWr2QwQfKT
+T2qjCJWv/P2PJGFaZbOrEvOHZjprSid4/n9gbQrodGoChhjiZT//l19Ay+7eJkUc
+yiiSK4u3fF4YPH9+CVpRQ94PHFe+0kQVvf+VGX/iqQKBgQDp5umTcZoho/KQzOd/
+pA8fgnzbipEl5ep2MHB98cqEQ93eFv4l/bBehDQ1WvmFJY8SIzU4EQotpnCZd4Vb
+KH9PE8tsTRvw2cYbBuD751boLVaBn8wxtlTkFrN/CyAtV7w7AG0dXnDKushJx1NN
+8AgvSr0X4hf0AKIWGtVteoX7qwKBgQDLse7Ze5dNbG48CpBGqQS4wFkTSEs5QKI5
+68JXEQoCmJb06O7rxj4f5CALv3pReP3nrl5+kLmT8O+yU5C5dXf06k/z4GDJ6Esm
+8XTEfB2Ca+kI2RLyMRRXPA2nEunbSsyk1AVo2GeRJxG4TaDbu2zTkUBAEyCuwarW
+OMsuYodPswKBgQCZc/kB1qH8OAdHoGawgv24+m7Xycz4RCLSb20d86edprjEn+kV
+G56+I5Xs+0aAZ+e5Sof7xJIc6Pkudg9zgtojEyV+ZAhUt0sVKCoqmdeWc0gxupjI
+dIq1KX+RdccieFDxlJIBlpgBKRGF9dNdaoC0JiBwrtBwMIomXmxvatbECQKBgQCS
+X1xZn/xLwJ0+PAENJauk72OS/aJAk/d/U7ElS7M7xlbDyxbVCnHeDNoSVxgYr68U
+6zIwFOOmMb6tEGuxOX5n2nB1uUkUDf7jDyNvhhjWfaDJoOOCck5BmX/eDTNLR+bi
+kxEIFGnn3oFXRUFQZNCA/6GB6bzUl4qhwdIPlPHTDQKBgQCgztlUF5IOJFKMjVlY
+yoA/7+b5zwrh8Y2+SLzF/HLah85AuHxsgdTuQh+HLKSwJejKCT95BSRJO/kV0XCR
+KZGStqETpEH/2AJkxpjt0FZxtIQdnyTargbiipe4JzI3iCTLtfN5C9Pn3ZJ9giap
+B5uQm4762aH2jw1kKFegHlIgJg==
+-----END PRIVATE KEY-----
diff --git a/modules/cassandra/src/test/resources/initial-with-error.cql b/modules/cassandra/src/test/resources/initial-with-error.cql
new file mode 100644
index 00000000000..4f0e11d721b
--- /dev/null
+++ b/modules/cassandra/src/test/resources/initial-with-error.cql
@@ -0,0 +1,6 @@
+CREATE KEYSPACE keySpaceTest WITH replication = {'class': 'SimpleStrategy', 'replication_factor' : 1};
+
+USE keySpaceTest;
+
+/* The following statement contains an error (missing primary key) on purpose, do not fix it! */
+CREATE TABLE catalog_category (id bigint);
diff --git a/modules/chromadb/build.gradle b/modules/chromadb/build.gradle
new file mode 100644
index 00000000000..ec41def56df
--- /dev/null
+++ b/modules/chromadb/build.gradle
@@ -0,0 +1,7 @@
+description = "Testcontainers :: ChromaDB"
+
+dependencies {
+ api project(':testcontainers')
+
+ testImplementation 'io.rest-assured:rest-assured:5.5.7'
+}
diff --git a/modules/chromadb/src/main/java/org/testcontainers/chromadb/ChromaDBContainer.java b/modules/chromadb/src/main/java/org/testcontainers/chromadb/ChromaDBContainer.java
new file mode 100644
index 00000000000..af6c3df33fc
--- /dev/null
+++ b/modules/chromadb/src/main/java/org/testcontainers/chromadb/ChromaDBContainer.java
@@ -0,0 +1,56 @@
+package org.testcontainers.chromadb;
+
+import lombok.extern.slf4j.Slf4j;
+import org.testcontainers.containers.GenericContainer;
+import org.testcontainers.containers.wait.strategy.Wait;
+import org.testcontainers.utility.ComparableVersion;
+import org.testcontainers.utility.DockerImageName;
+
+/**
+ * Testcontainers implementation of ChromaDB.
+ *