Recorded Activity

If you want to verify your application executes the correct queries rather than testing behaviour via stubbing you can retrieve all the queries, connections and prepared statements that have been executed.

This can be useful if you want to verify queries are executed at the correct consistency, or are retried the correct number of times.


List<Query> queries = activityClient.retrieveQueries();

// Where each Query has:

Prepared Statement Preparations

List<PreparedStatementPreparation> preparations = activityClient.retrievePreparedStatementPreparations();

// Where each PreparedStatementPreparation has:

Prepared Statement Executions

List<PreparedStatementExecution> executions = activityClient.retrievePreparedStatementExecutions();

// Where each PreparedStatementExecution has:

Batch Executions

List<BatchExecution> batches = activityClient.retrieveBatches();

// Where each BatchExecution has:

Deleting recorded activity

You can reset the recorded activity between tests: