when

open fun when(event: Any, state: Any?, ownerId: String = OwnerId.Companion.DEFAULT_OWNER_ID): ExpectStage<T>

Triggers saga processing with a domain event and optional state.

This method simulates receiving a domain event and processes it through the saga, returning an expectation stage to verify the results.

Return

An expectation stage to define assertions on the saga results.

Parameters

event

The domain event that triggers the saga.

state

Optional state aggregate to provide to the saga processing.

ownerId

The owner ID for the event processing (defaults to default owner).


open fun when(event: Any): ExpectStage<T>

Triggers saga processing with a domain event.

This is a convenience overload that processes an event without providing state.

Return

An expectation stage to define assertions on the saga results.

Parameters

event

The domain event that triggers the saga.