AbstractGivenStageDsl

Abstract base class for GivenDsl implementations that provides common functionality.

This class implements the core GivenDsl interface methods and provides a foundation for concrete implementations. It handles service injection, owner ID management, and coordinates the setup of test scenarios with events or state.

Parameters

S

the state type of the aggregate

Inheritors

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

The aggregate DSL context for managing shared test state.

Link copied to clipboard
abstract val delegate: GivenStage<S>
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.

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 without prior event setup.