Crate stomp_test_utils[][src]

Traits

A BehaviourFunction can send messages to the provided sender and check responses on the provided receiver, thereby testing expected behaviour. It returns the channels it received as inputs in order to faciliate further checks downstream, and enable chaining.

Enables chaining of BehaviourFunctions.

Creates a session which receives and sends messages on the provided receiver and sender respectively.

Functions

The core function of this crate, it can be used to test the session returned by session_factory by executing behaviour against it - in other words, the InSender provided to behaviour will send messages to the created session, and the OutReceiver will receive messages the session sends to its ‘counterparty’. Any errors returned by either side will result in a panic.

Asserts that the receiver can immediately provide a message which passes

Returns a BehaviourFunction which will assert that a message is waiting, and that that message matches the provided predicate.

Returns a [BehaviourFuntion] which sends the provided data, and then yields.

Sends data via sender, after converting it to bytes and transforming any error using from. Panics it the send fails.

Pauses tokio, sleeps for millis milliseconds, and then resumes tokio. Allows testing of actions that occur after some time, such as heartbeats, without actually having to wait for that amount of time.

Type Definitions