This example connects to the Cassandra cluster:
-
Define a container:
Container definition inside_block:container-definition
-
Build a
CqlSession:Building CqlSession inside_block:cql-session
-
Define a container with custom
cassandra.yamllocated in a directorycassandra-auth-required-configuration:Running init script with required authentication inside_block:init-with-auth
Add the following dependency to your pom.xml/build.gradle file:
=== "Gradle"
groovy testImplementation "org.testcontainers:cassandra:{{latest_version}}"
=== "Maven"
xml <dependency> <groupId>org.testcontainers</groupId> <artifactId>cassandra</artifactId> <version>{{latest_version}}</version> <scope>test</scope> </dependency>