ExpectDsl

DSL interface for defining expectations on saga test results.

This interface extends StatelessSagaExpecter to provide a fluent API for asserting expectations on the commands and errors produced by saga processing.

Parameters

T

The type of the saga being tested.

Inheritors

Functions

Link copied to clipboard
abstract fun expect(expected: ExpectedResult<T>.() -> Unit): ExpectDsl<T>

Sets expectations on the expected result using a lambda.

Link copied to clipboard
open fun <C : Any> expectCommand(expected: CommandMessage<C>.() -> Unit): ExpectDsl<T>

Sets expectations on the first command in the command stream.

Link copied to clipboard
open fun <C : Any> expectCommandBody(expected: C.() -> Unit): ExpectDsl<T>

Sets expectations on the body of the first command.

Link copied to clipboard
open fun expectCommandCount(expected: Int): ExpectDsl<T>

Expects a specific number of commands in the command stream.

Link copied to clipboard

Sets expectations on a command iterator created from the command stream.

Link copied to clipboard
open fun expectCommandStream(expected: CommandStream.() -> Unit): ExpectDsl<T>

Sets expectations on the command stream, ensuring no error occurred first.

Link copied to clipboard
open fun expectCommandType(vararg expected: Class<*>): ExpectDsl<T>

Expects commands of specific types in order (Java Class version).

open fun expectCommandType(vararg expected: KClass<*>): ExpectDsl<T>

Expects commands of specific types in order.

Link copied to clipboard
open fun expectError(): ExpectDsl<T>

Expects that an error occurred during saga processing.

open fun <E : Throwable> expectError(expected: E.() -> Unit): ExpectDsl<T>

Expects a specific error with custom assertions.

Link copied to clipboard
open fun <E : Throwable> expectErrorType(expected: Class<E>): ExpectDsl<T>

Expects an error of a specific type (Java Class version).

open fun <E : Throwable> expectErrorType(expected: KClass<E>): ExpectDsl<T>

Expects an error of a specific type.

Link copied to clipboard

Expects that no commands were generated by the saga.

Link copied to clipboard

Expects that no error occurred during saga processing.