FakeKandraSession

class FakeKandraSession : CqlSession

In-memory drop-in replacement for CqlSession — no ScyllaDB connection required.

prepare(cql).bind(...) returns a FakePreparedStatement/FakeBoundStatement pair that records the CQL string and positional bound values without touching a real driver session, so the full KandraRepository/KandraSuspendRepository surface (save, findById, delete, update, batch writes, ...) can run against this fake end-to-end. execute captures every Statement it's handed (see capturedStatements), with capturedBatches as a convenience filter for just the BatchStatements (save/delete/update/saveAll all route through a LOGGED batch). Use via KandraTestUtils.inMemory to wire a full repository stack without Testcontainers.

Note: this performs no real CQL type encoding/decoding or query semantics — execute() always returns an empty, wasApplied() == true result set, regardless of the statement. Use this fake to verify structural behaviour (batch composition, save/delete ordering, what was bound to what) rather than actual data round-trips or LWT applied/not-applied semantics; for those, use KandraTestcontainers instead.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
fun capturedBatches(): List<BatchStatement>

Returns all BatchStatement instances that were executed via execute.

Link copied to clipboard
fun capturedStatements(): List<Statement<*>>

Returns every Statement executed synchronously via execute, in call order.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun close()
Link copied to clipboard
open override fun closeAsync(): CompletionStage<Void>
Link copied to clipboard
open override fun closeFuture(): CompletionStage<Void>
Link copied to clipboard
@NonNull
open fun execute(@NonNull p0: GraphStatement<*>): GraphResultSet
@NonNull
open fun execute(@NonNull p0: String): ResultSet
@NonNull
open fun execute(@NonNull p0: String, @NonNull vararg p1: Any): ResultSet
@NonNull
open fun execute(@NonNull p0: String, @NonNull p1: MutableMap<String, Any>): ResultSet
open override fun execute(statement: Statement<*>): ResultSet
open override fun <RequestT : Request, ResultT : Any> execute(request: RequestT, resultType: GenericType<ResultT>): ResultT?
Link copied to clipboard
@NonNull
open fun executeAsync(@NonNull p0: GraphStatement<*>): CompletionStage<AsyncGraphResultSet>
@NonNull
open fun executeAsync(@NonNull p0: String): CompletionStage<AsyncResultSet>
@NonNull
open fun executeAsync(@NonNull p0: String, @NonNull vararg p1: Any): CompletionStage<AsyncResultSet>
@NonNull
open fun executeAsync(@NonNull p0: String, @NonNull p1: MutableMap<String, Any>): CompletionStage<AsyncResultSet>
open override fun executeAsync(statement: Statement<*>): CompletionStage<AsyncResultSet>
Link copied to clipboard
@NonNull
open fun executeContinuously(@NonNull p0: Statement<*>): ContinuousResultSet
Link copied to clipboard
@NonNull
open fun executeContinuouslyAsync(@NonNull p0: Statement<*>): CompletionStage<ContinuousAsyncResultSet>
Link copied to clipboard
@NonNull
open fun executeContinuouslyReactive(@NonNull p0: Statement<*>): ContinuousReactiveResultSet
@NonNull
open fun executeContinuouslyReactive(@NonNull p0: String): ContinuousReactiveResultSet
Link copied to clipboard
@NonNull
open fun executeReactive(@NonNull p0: Statement<*>): ReactiveResultSet
@NonNull
open fun executeReactive(@NonNull p0: String): ReactiveResultSet
@NonNull
open fun executeReactive(@NonNull p0: String, @NonNull vararg p1: Any): ReactiveResultSet
@NonNull
open fun executeReactive(@NonNull p0: String, @NonNull p1: MutableMap<String, Any>): ReactiveResultSet
@NonNull
open fun executeReactive(@NonNull p0: GraphStatement<*>): ReactiveGraphResultSet
Link copied to clipboard
open override fun forceCloseAsync(): CompletionStage<Void>
Link copied to clipboard
open override fun getContext(): DriverContext
Link copied to clipboard
open override fun getKeyspace(): Optional<CqlIdentifier>
Link copied to clipboard
open override fun getMetadata(): Metadata
Link copied to clipboard
open override fun getMetrics(): Optional<Metrics>
Link copied to clipboard
open override fun getName(): String
Link copied to clipboard
open override fun isClosed(): Boolean
Link copied to clipboard
open override fun isSchemaMetadataEnabled(): Boolean
Link copied to clipboard
@NonNull
open fun prepare(@NonNull p0: PrepareRequest): PreparedStatement
open override fun prepare(statement: SimpleStatement): PreparedStatement
open override fun prepare(query: String): PreparedStatement
Link copied to clipboard
@NonNull
open fun prepareAsync(p0: PrepareRequest): CompletionStage<PreparedStatement>
@NonNull
open fun prepareAsync(@NonNull p0: SimpleStatement): CompletionStage<PreparedStatement>
@NonNull
open fun prepareAsync(@NonNull p0: String): CompletionStage<PreparedStatement>
Link copied to clipboard
@NonNull
open fun refreshSchema(): Metadata
Link copied to clipboard
open override fun refreshSchemaAsync(): CompletionStage<Metadata>
Link copied to clipboard
fun reset(): <Error class: unknown class>

Clears all captured statements/batches.

Link copied to clipboard
open override fun setSchemaMetadataEnabled(newValue: Boolean?): CompletionStage<Metadata>
Link copied to clipboard
fun tableContents(tableName: String): List<Map<String, Any?>>

Returns an empty in-memory table contents list (structural test placeholder).