WhenStage

interface WhenStage<S : Any>

Defines the stage for specifying commands to execute in aggregate testing.

This interface provides methods to execute commands on aggregates that have been set up in the Given stage, transitioning to the Expect stage for result validation.

Parameters

S

the type of the aggregate state

Functions

Link copied to clipboard
open fun when(command: Any): ExpectStage<S>

Executes a command with default header.

open fun when(command: Any, header: Header): ExpectStage<S>

Executes a command with a custom header.

Link copied to clipboard
abstract fun whenCommand(command: Any, header: Header = DefaultHeader.empty(), ownerId: String = OwnerId.DEFAULT_OWNER_ID): ExpectStage<S>

Executes a command with full parameter control.