DefaultAggregateDsl

class DefaultAggregateDsl<C : Any, S : Any>(commandAggregateType: Class<C>) : AbstractDynamicTestBuilder, AggregateDsl<S>

Default implementation of the AggregateDsl interface for testing aggregate behavior.

This class provides the core functionality for setting up aggregate tests by configuring the testing environment and delegating to the appropriate DSL stages. It manages the service provider and coordinates the creation of GivenDsl instances for test scenarios.

Parameters

C

the command type that triggers aggregate operations

S

the state type maintained by the aggregate

Constructors

Link copied to clipboard
constructor(commandAggregateType: Class<C>)

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 dynamicNodes: MutableList<DynamicNode>

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

Link copied to clipboard

Public service provider instance that can be configured with test-specific services. This provider is copied to the test service provider during test execution.

Functions

Link copied to clipboard
open override fun fork(ref: String, name: String, verifyError: Boolean, block: ForkedVerifiedStageDsl<S>.() -> Unit)

Creates a branching test scenario from a previously referenced ExpectStage.

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

Injects services into the public service provider.

Link copied to clipboard
open override fun on(aggregateId: String, tenantId: String, stateAggregateFactory: StateAggregateFactory, eventStore: EventStore, serviceProvider: ServiceProvider, block: GivenDsl<S>.() -> Unit)

Sets up a test scenario for the specified aggregate.