In my Spring Boot 1.5.1 application I'm going to write unit/integration tests for Cassandra related logic.
I have added folowing Maven dependency:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-cassandra</artifactId>
</dependency>
The default Spring Boot Cassandra configuration is going to connect with a real Cassandra DB server.
Is there any options in Spring/Spring Boot in order to configure my tests to use embedded Cassandra server ? If so, could you please show the required configuration.
We use on the project Cassandra + Spring Boot. Here are the steps which worked for us:
a) Configure you test like this
b) in your src/test/resources/application.properties, add this (please note, embedded cassandra starts on port 9142, but not on default 9042)
c) Create empty file bootstrap_test.cql in src/test/resources
d) Add to your pom.xml
This should be enough to run your tests with Embedded Cassandra. Hope it helps.