freshKeyspace

fun freshKeyspace(vararg classes: KClass<*>, replicationFactor: Int = 1, statementBuilderConsistencyConfig: ConsistencyConfig = ConsistencyConfig()): KandraRuntimeHandle

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

Call KandraRuntimeHandle.close in @AfterEach to drop the keyspace.

Parameters

replicationFactor

SimpleStrategy replication factor for the created keyspace. Defaults to 1 (the only sensible choice for a single-node Testcontainers cluster to actually serve reads/writes at). A higher value is useful when a test only needs the keyspace metadata to reflect a given RF — e.g. exercising Strict Mode's RF-vs-(R+W) check (ISS-075 / GH #83) — since SimpleStrategy will happily declare replication_factor: 3 on a one-node cluster even though only one real replica ever exists; such a keyspace can't safely serve queries above ONE/ LOCAL_ONE, so callers passing a higher factor should stick to metadata-only assertions.

statementBuilderConsistencyConfig

ConsistencyConfig used for the StatementBuilder backing the returned runtime's repositories — e.g. to enable strictMode for a test. Defaults to a plain ConsistencyConfig(), matching prior behavior.