expectEventBody

open fun <E : Any> expectEventBody(expected: E.() -> Unit): AE

Expects specific conditions on the body of the first domain event.

This method focuses on the business data within the event, allowing assertions on the event payload without concern for event metadata.

Return

the current expecter instance for method chaining

Parameters

E

the type of the event body

expected

a lambda function that receives the event body and performs assertions


open fun <E : Any> expectEventBody(expected: Consumer<E>): AE

Expects specific conditions on the body of the first domain event using a Consumer.

Java-friendly overload for expectEventBody that accepts a Consumer instead of a lambda.

Return

the current expecter instance for method chaining

Parameters

E

the type of the event body

expected

a Consumer that receives the event body and performs assertions