Skip to content

Latest commit

 

History

History
50 lines (40 loc) · 1.66 KB

File metadata and controls

50 lines (40 loc) · 1.66 KB

embedded-cassandra

Maven dependency

pom.xml
<dependency>
    <groupId>com.playtika.testcontainers</groupId>
    <artifactId>embedded-cassandra</artifactId>
    <scope>test</scope>
</dependency>

Consumes (via bootstrap.properties)

  • embedded.cassandra.enabled (true|false, default is true)

  • embedded.cassandra.reuseContainer (true|false, default is false)

  • embedded.cassandra.keyspace-name (default is 'embedded')

  • embedded.cassandra.replication-factor (default is '1')

  • embedded.cassandra.dockerImage (default is 'cassandra:5.0')

  • embedded.toxiproxy.proxies.cassandra.enabled Enables both creation of the container with ToxiProxy TCP proxy and a proxy to the embedded-cassandra container.

Produces

  • embedded.cassandra.host

  • embedded.cassandra.port

  • embedded.cassandra.datacenter

  • embedded.cassandra.keyspace-name

  • embedded.cassandra.toxiproxy.host

  • embedded.cassandra.toxiproxy.port

  • embedded.cassandra.networkAlias

  • embedded.cassandra.internalPort

  • Bean ToxiproxyContainer.ContainerProxy cassandraContainerProxy

Example

To configure spring-data-cassandra use these properties in your test application.properties:

/src/test/resources/application.properties
spring.data.cassandra.keyspace-name=${embedded.cassandra.keyspace-name}
spring.data.cassandra.local-datacenter=${embedded.cassandra.datacenter}
spring.data.cassandra.contact-points=${embedded.cassandra.host}
spring.data.cassandra.port=${embedded.cassandra.port}
spring.data.cassandra.schema-action=CREATE_IF_NOT_EXISTS