Interface PublisherStep<T>
-
- Type Parameters:
T- The type ofPublisherSource.Subscriber.
- All Superinterfaces:
PublisherLastStep
- All Known Subinterfaces:
PublisherFirstStep<T>
public interface PublisherStep<T> extends PublisherLastStep
Provides the ability to express expectations for thePublisherSource.Subscriber.onNext(Object)stages of aSubscriber's lifecycle.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description PublisherStep<T>expectNext(long min, long max, java.util.function.Consumer<? super java.lang.Iterable<? extends T>> signalsConsumer)PublisherStep<T>expectNext(long n, java.util.function.Consumer<? super java.lang.Iterable<? extends T>> signalsConsumer)PublisherStep<T>expectNext(T signal)Declare an expectation thatsignalwill be the nextsignal.PublisherStep<T>expectNext(T... signals)Declare an expectation thatsignalswill be the next in-order sequence ofsignals.PublisherStep<T>expectNextConsumed(java.util.function.Consumer<? super T> signalConsumer)Declare an expectation thatonNextwill be the next signal and evaluate it withsignalConsumer.PublisherStep<T>expectNextCount(long n)Expect between[min, max]onNextsignals, and discard the values.PublisherStep<T>expectNextCount(long min, long max)Expect between[min, max]onNextsignals, and discard the values.PublisherStep<T>expectNextMatches(java.util.function.Predicate<? super T> signalPredicate)Declare an expectation thatonNextwill be the next signal and evaluate it withsignalPredicate.PublisherStep<T>expectNextSequence(java.lang.Iterable<? extends T> signals)Declare an expectation thatsignalswill be the next in-order sequence ofsignals.PublisherStep<T>expectNoSignals(java.time.Duration duration)Expect noPublisherSource.Subscriber.onNext(Object),PublisherSource.Subscriber.onError(Throwable), orPublisherSource.Subscriber.onComplete()signals indurationtime.PublisherStep<T>then(java.lang.Runnable r)InvokeRunnable.run()on the thread which invokesStepVerifier.verify().PublisherStep<T>thenAwait(java.time.Duration duration)Wait for a time delay ofdurationon the thread which invokesStepVerifier.verify().PublisherStep<T>thenRequest(long n)Manually request more from thePublisherSource.Subscription.-
Methods inherited from interface io.servicetalk.concurrent.api.test.PublisherLastStep
expectComplete, expectError, expectError, expectErrorConsumed, expectErrorMatches, thenCancel
-
-
-
-
Method Detail
-
expectNext
PublisherStep<T> expectNext(@Nullable T signal)
Declare an expectation thatsignalwill be the nextsignal.- Parameters:
signal- The next signal which is expected.- Returns:
- An object which allows for subsequent expectations to be defined.
-
expectNext
PublisherStep<T> expectNext(T... signals)
Declare an expectation thatsignalswill be the next in-order sequence ofsignals.- Parameters:
signals- The next signals which are expected in-order.- Returns:
- An object which allows for subsequent expectations to be defined.
-
expectNextSequence
PublisherStep<T> expectNextSequence(java.lang.Iterable<? extends T> signals)
Declare an expectation thatsignalswill be the next in-order sequence ofsignals.- Parameters:
signals- The next signals which are expected in-order.- Returns:
- An object which allows for subsequent expectations to be defined.
-
expectNextMatches
PublisherStep<T> expectNextMatches(java.util.function.Predicate<? super T> signalPredicate)
Declare an expectation thatonNextwill be the next signal and evaluate it withsignalPredicate.- Parameters:
signalPredicate- Will be invoked whenonNextis called and will raise aAssertionErrorif the predicate returnsfalse.- Returns:
- An object which allows for subsequent expectations to be defined.
-
expectNextConsumed
PublisherStep<T> expectNextConsumed(java.util.function.Consumer<? super T> signalConsumer)
Declare an expectation thatonNextwill be the next signal and evaluate it withsignalConsumer.- Parameters:
signalConsumer- Consumes the nextonNextsignal.- Returns:
- An object which allows for subsequent expectations to be defined.
-
expectNext
PublisherStep<T> expectNext(long n, java.util.function.Consumer<? super java.lang.Iterable<? extends T>> signalsConsumer)
- Parameters:
n- The number ofonNextsignals that are expected.signalsConsumer- AConsumerthat accepts anIterablewhich hasnitems.- Returns:
- An object which allows for subsequent expectations to be defined.
-
expectNext
PublisherStep<T> expectNext(long min, long max, java.util.function.Consumer<? super java.lang.Iterable<? extends T>> signalsConsumer)
- Parameters:
min- The minimum number ofonNextsignals that are required before invokingsignalsConsumer. If a terminal signal is processed and the number of accumulatedonNextsignals is>=this value thesignalsConsumerwill be invoked for verification, otherwise the expectation will fail.max- The maximum number ofonNextsignals that will be accumulated before invokingsignalsConsumer.signalsConsumer- AConsumerthat accepts anIterablewhich has between[min, max]items and preforms verification.- Returns:
- An object which allows for subsequent expectations to be defined.
-
expectNextCount
PublisherStep<T> expectNextCount(long n)
Expect between[min, max]onNextsignals, and discard the values.- Parameters:
n- The number ofonNextsignals that are expected.- Returns:
- An object which allows for subsequent expectations to be defined.
-
expectNextCount
PublisherStep<T> expectNextCount(long min, long max)
Expect between[min, max]onNextsignals, and discard the values.- Parameters:
min- The minimum number ofonNextsignals that are required before. If a terminal signal is processed and the number of accumulatedonNextsignals is<this value, the expectation will fail.max- The maximum number ofonNextsignals that will be expected and ignored before moving on to the next expectation.- Returns:
- An object which allows for subsequent expectations to be defined.
-
expectNoSignals
PublisherStep<T> expectNoSignals(java.time.Duration duration)
Expect noPublisherSource.Subscriber.onNext(Object),PublisherSource.Subscriber.onError(Throwable), orPublisherSource.Subscriber.onComplete()signals indurationtime.- Parameters:
duration- The amount of time to wait for a signal.- Returns:
- An object which allows for subsequent expectations to be defined.
-
thenRequest
PublisherStep<T> thenRequest(long n)
Manually request more from thePublisherSource.Subscription.- Parameters:
n- The amount to request.- Returns:
- An object which allows for subsequent expectations to be defined.
-
then
PublisherStep<T> then(java.lang.Runnable r)
InvokeRunnable.run()on the thread which invokesStepVerifier.verify().- Parameters:
r- theRunnableto invoke.- Returns:
- An object which allows for subsequent expectations to be defined.
-
thenAwait
PublisherStep<T> thenAwait(java.time.Duration duration)
Wait for a time delay ofdurationon the thread which invokesStepVerifier.verify().- Parameters:
duration- the duration to wait for.- Returns:
- An object which allows for subsequent expectations to be defined.
-
-