whenEvent
abstract fun whenEvent(event: Any, state: Any? = null, ownerId: String = OwnerId.DEFAULT_OWNER_ID, block: ExpectDsl<T>.() -> Unit)
Defines an event that triggers the saga and sets expectations on the result.
Parameters
event
The domain event that triggers the saga.
state
Optional state to provide to the saga processing.
ownerId
The owner ID for the event processing.
block
The expectation block that defines assertions on the saga results.