Crate stomp_test_utils

Source

Traits§

BehaviourFunction
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.
Chainable
Enables chaining of BehaviourFunctions.
ErrorType
SessionFactory
Creates a session which receives and sends messages on the provided receiver and sender respectively.

Functions§

assert_behaviour
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.
assert_receive
Asserts that the receiver can immediately provide a message which passes
into_behaviour
Help the compiler to assign appropriate lifetimes to inputs and outputs of BehaviourFunction-equivalent closure.
receive
Returns a BehaviourFunction which will assert that a message is waiting, and that that message matches the provided predicate.
send
Returns a [BehaviourFuntion] which sends the provided data, and then yields.
send_data
Sends data via sender, after converting it to bytes and transforming any error using from. Panics it the send fails.
sleep_in_pause
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.
wait_for_disconnect

Type Aliases§

InReceiver
InSender
OutReceiver
OutSender