A short guide on integrating Cassandra Unit with TestNG for unit testing Spring Data Cassandra repositories. Since Cassandra Unit defaults to JUnit, a custom TestExecutionListener is needed to start an embedded Cassandra server before the Spring context loads. The post shows the required Maven dependencies and a PreContextLoadingTestExecutionListener implementation that calls EmbeddedCassandraServerHelper.startEmbeddedCassandra() at the right lifecycle point.

1m read timeFrom wimdeblauwe.com
Post cover image

Sort: