ExpectedResult

data class ExpectedResult<S : Any>(val exchange: ServerCommandExchange<*>, val stateAggregate: StateAggregate<S>, val domainEventStream: DomainEventStream? = null, val error: Throwable? = null)

Encapsulates the complete result of an aggregate command execution for testing purposes.

This data class holds all the information needed to validate the outcome of a command execution, including the command exchange, resulting aggregate state, generated events, and any errors that occurred.

Parameters

S

the type of the aggregate state

Constructors

Link copied to clipboard
constructor(exchange: ServerCommandExchange<*>, stateAggregate: StateAggregate<S>, domainEventStream: DomainEventStream? = null, error: Throwable? = null)

Properties

Link copied to clipboard

the stream of domain events produced by the command (null if error occurred)

Link copied to clipboard

any Throwable that occurred during command execution (null if successful)

Link copied to clipboard

the server command exchange containing command execution details

Link copied to clipboard

convenience property indicating whether an error occurred

Link copied to clipboard

the resulting state of the aggregate after command execution