Spring Boot Data嵌入式Cassandra
问题描述:
在我的Spring Boot 1.5.1应用程序中,我将为Cassandra相关逻辑编写单元/集成测试。Spring Boot Data嵌入式Cassandra
我加入了如下因素Maven的依赖性:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-cassandra</artifactId>
</dependency>
默认春季启动Cassandra的配置要与一个真正的卡桑德拉DB服务器连接。
是否有在春/春启动任何选项,以便配置我的测试中使用嵌入式卡桑德拉服务器?如果是这样,你能否显示所需的配置。
答
Spring Boot中没有嵌入式Apache Cassandra支持,并且没有计划。一方面对嵌入式Apache Cassandra的需求不大,另一方面,Apache Cassandra带有很多与Boot的其他依赖冲突的依赖关系。
您也可以使用JUnit测试,可以让您在Apache Cassandra的版本,运行时的行为等全面控制时,建立一个自己的测试规则。看看可能的实现:CassandraRule.java。