For testing purposes, Reactor offers an additional reactor-test module that provides StepVerifier. StepVerifier provides a fluent API for building a verification flow for any Publisher. In the following subsections, we will cover everything about the Reactor Test module, starting with the essentials and finishing with advanced testing cases.
Testing reactive streams with StepVerifier
Essentials of StepVerifier
There are two main methods for verifying a Publisher. The first one is StepVerifier.<T>create(Publisher<T> source). The test that can be built with this technique looks like the following:
StepVerifier
.create(Flux.just("foo", "bar")) ...