KandraTestcontainers

Integration test utilities for running Kandra against a real ScyllaDB/Cassandra instance.

Starts one shared container per JVM and creates a fresh, randomly-named keyspace per test class — ensuring complete isolation between test classes running in parallel.

class UserRepositoryTest {
private val db = KandraTestcontainers.freshKeyspace(User::class)
private val userRepo = db.suspendRepository<User>()

@AfterEach fun cleanup() = db.close()
}

Properties

Link copied to clipboard
val container: CassandraContainer<*>

Shared container — started once per JVM, reused across all test classes.

Functions

Link copied to clipboard
fun freshKeyspace(vararg classes: KClass<*>): KandraRuntimeHandle

Creates a fresh keyspace with a random name, registers classes, and creates tables.