DefaultForkedVerifiedStageDsl

Default implementation of the ForkedVerifiedStageDsl interface for forked test scenarios.

This class provides functionality for testing alternative paths after an aggregate has been verified, allowing branching of test execution to explore different outcomes or error conditions from the same verified state.

Parameters

S

the state type of the aggregate

Constructors

Link copied to clipboard
constructor(context: AggregateDslContext<S>, delegate: VerifiedStage<S>)

Properties

Link copied to clipboard
open override val context: AggregateDslContext<S>

The aggregate DSL context for managing shared test state.

Link copied to clipboard
open override val delegate: VerifiedStage<S>

the underlying VerifiedStage that provides the verified result

Link copied to clipboard
open override val dynamicNodes: MutableList<DynamicNode>

A mutable list of dynamic test nodes that can be modified by subclasses.

Link copied to clipboard
override var name: String

The name identifier for this test scenario. Used in dynamic test naming and reporting.

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
open override val verifiedResult: ExpectedResult<S>

The verified result from the parent test execution. This contains the final state, events, and any errors from the command processing.

Functions

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

Sets up the aggregate with a single initial event.

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

Sets up the aggregate by replaying multiple domain events.

Link copied to clipboard
open override fun givenOwnerId(ownerId: String)

Sets the owner ID for subsequent operations.

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

Sets up the aggregate with a specific initial state and version.

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

Injects services into the test service provider.

Link copied to clipboard
open override fun name(name: String)

Sets the name for this test scenario.

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

Executes a command in the context of the verified stage.