DefaultWhenDsl

Default implementation of WhenDsl that creates dynamic test containers for saga scenarios.

This class wraps a WhenStage and provides methods to configure event processing and create dynamic test containers that group related expectation tests. It supports naming test scenarios for better organization.

Parameters

T

The type of the saga being tested.

Constructors

Link copied to clipboard
constructor(delegate: WhenStage<T>)

Properties

Link copied to clipboard
open override val delegate: WhenStage<T>

The underlying when stage that handles event processing.

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
open override var name: String

The name of the test scenario (can be set via name method).

Functions

Link copied to clipboard
open override fun functionFilter(filter: (MessageFunction<*, *, *>) -> Boolean)

Sets a filter for message functions in the underlying when stage.

Link copied to clipboard
open fun functionName(functionName: String)

Filters message functions by name.

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

Injects services into the underlying when stage.

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

Sets the name for this test scenario.

Link copied to clipboard
open override fun whenEvent(event: Any, state: Any?, ownerId: String, block: ExpectDsl<T>.() -> Unit)

Defines an event processing scenario and sets up expectations.