givenState

fun givenState(state: S, version: Int = 1, scope: Scope = unscoped)

Starts the aggregate in state at version, as if its first version streams had left it there (9.x's givenState), in scope: the commands after it are decided on that state, and their streams continue from version; an aggregate whose id is its owner's is given in that owner's scope by default. It is the first step of a specification, before any event or command. The state is copied through its JSON, as a snapshot would be, so changing state afterwards changes nothing.


fun givenState(version: Int = 1, scope: Scope = unscoped, build: S.() -> Unit)

Starts the aggregate in its initial state changed by build, at version, as givenState does.