ForkedVerifiedStageDsl

Defines a forked test context that allows continuing testing from a verified state.

This interface extends GivenDsl to provide full testing capabilities within a forked scenario, allowing additional command executions and expectations starting from the verified state of a previous command execution.

Parameters

S

the type of the aggregate state

Inheritors

Properties

Link copied to clipboard

The aggregate DSL context for managing shared test state.

Link copied to clipboard

The state aggregate from the verified result.

Link copied to clipboard
open val stateRoot: S

The root state object from the aggregate.

Link copied to clipboard

The verified result from the previous command execution that this fork starts from.

Functions

Link copied to clipboard
abstract fun givenEvent(event: Any, block: WhenDsl<S>.() -> Unit)

Initializes the aggregate by replaying a single domain event.

abstract fun givenEvent(events: Array<out Any>, block: WhenDsl<S>.() -> Unit)

Initializes the aggregate by replaying multiple domain events.

Link copied to clipboard
abstract fun givenOwnerId(ownerId: String)

Sets the owner ID for the aggregate in this test scenario.

Link copied to clipboard
abstract fun givenState(state: S, version: Int, block: WhenDsl<S>.() -> Unit)

Initializes the aggregate with a specific state and version.

Link copied to clipboard
abstract fun inject(inject: ServiceProvider.() -> Unit)

Injects services or dependencies into the test context.

Link copied to clipboard
abstract fun name(name: String)

Sets the name for this test element.

Link copied to clipboard
abstract fun whenCommand(command: Any, header: Header, ownerId: String, block: ExpectDsl<S>.() -> Unit)

Executes a command on the aggregate and validates the results.