givenState

abstract fun givenState(state: S, version: Int, block: WhenDsl<S>.() -> Unit)

Initializes the aggregate with a specific state and version.

This method directly sets the aggregate state and version number, bypassing event sourcing for scenarios where direct state setup is preferred.

Parameters

state

the initial state to set on the aggregate

version

the version number for the aggregate state

block

the continuation block for command execution