CommandIterator

A decorator iterator for command messages that provides testing utilities.

This class wraps an iterator of CommandMessage instances and provides convenient methods for skipping commands and asserting command types during saga testing.

Constructors

Link copied to clipboard
constructor(delegate: Iterator<CommandMessage<*>>)

Properties

Link copied to clipboard
open override val delegate: Iterator<CommandMessage<*>>

The underlying iterator being decorated.

Functions

Link copied to clipboard
open operator override fun hasNext(): Boolean
Link copied to clipboard
open operator override fun next(): CommandMessage<*>
Link copied to clipboard
inline fun <C : Any> nextCommand(): CommandMessage<C>

Retrieves the next command with reified type checking.

fun <C : Any> nextCommand(commandType: Class<C>): CommandMessage<C>

Retrieves the next command and asserts it is of the specified type (Java Class version).

fun <C : Any> nextCommand(commandType: KClass<C>): CommandMessage<C>

Retrieves the next command and asserts it is of the specified type.

Link copied to clipboard
inline fun <C : Any> nextCommandBody(): C

Retrieves the body of the next command with reified type checking.

fun <C : Any> nextCommandBody(commandType: Class<C>): C

Retrieves the body of the next command and asserts it is of the specified type (Java Class version).

fun <C : Any> nextCommandBody(commandType: KClass<C>): C

Retrieves the body of the next command and asserts it is of the specified type.

Link copied to clipboard

Skips a specified number of commands in the iterator.