StatelessSagaExpecter

Interface for expecting results in stateless saga testing.

This interface provides a fluent API for asserting expectations on the results of stateless saga processing, including commands, errors, and command streams.

Parameters

T

The type of the result being expected.

SE

The self-referential type for method chaining.

Inheritors

Functions

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

Sets expectations on the expected result using a lambda.

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

Sets expectations on the first command in the command stream.

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

Sets expectations on the body of the first command.

Link copied to clipboard
open fun expectCommandCount(expected: Int): SE

Expects a specific number of commands in the command stream.

Link copied to clipboard
open fun expectCommandIterator(expected: CommandIterator.() -> Unit): SE

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

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

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

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

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

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

Expects commands of specific types in order.

Link copied to clipboard
open fun expectError(): SE

Expects that an error occurred during saga processing.

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

Expects a specific error with custom assertions.

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

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

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

Expects an error of a specific type.

Link copied to clipboard
open fun expectNoCommand(): SE

Expects that no commands were generated by the saga.

Link copied to clipboard
open fun expectNoError(): SE

Expects that no error occurred during saga processing.