GivenStage
Defines the stage for setting up test preconditions in aggregate testing.
This interface provides methods to configure the initial state of aggregates before command execution, including injecting services, setting owner IDs, and providing initial events or state.
Parameters
S
the type of the aggregate state
Inheritors
Functions
Link copied to clipboard
Link copied to clipboard
Sets the owner ID for the aggregate in this test.
Link copied to clipboard
Link copied to clipboard
open fun <SERVICE : Any> inject(service: SERVICE, serviceName: String = service.javaClass.toName(), serviceType: KType = service.javaClass.kotlin.defaultType): GivenStage<S>
Injects a service instance into the test context.
Injects services into the test context using the provided configuration block.
Link copied to clipboard
fun <S : Any> GivenStage<S>.whenCommand(command: Any, header: Header = DefaultHeader.empty(), ownerId: String = OwnerId.DEFAULT_OWNER_ID): ExpectStage<S>
Extension function that allows executing a command directly from the Given stage.