Interface PublisherStep<T>
- Type Parameters:
T
- The type ofPublisherSource.Subscriber
.
- All Superinterfaces:
PublisherLastStep
- All Known Subinterfaces:
PublisherFirstStep<T>
Provides the ability to express expectations for the
PublisherSource.Subscriber.onNext(Object)
stages of a
Subscriber
's lifecycle.-
Method Summary
Modifier and TypeMethodDescriptionexpectNext
(long min, long max, Consumer<? super Iterable<? extends T>> signalsConsumer) expectNext
(long n, Consumer<? super Iterable<? extends T>> signalsConsumer) expectNext
(T signal) Declare an expectation thatsignal
will be the nextsignal
.expectNext
(T... signals) Declare an expectation thatsignals
will be the next in-order sequence ofsignals
.expectNextConsumed
(Consumer<? super T> signalConsumer) Declare an expectation thatonNext
will be the next signal and evaluate it withsignalConsumer
.expectNextCount
(long n) Expect between[min, max]
onNext
signals, and discard the values.expectNextCount
(long min, long max) Expect between[min, max]
onNext
signals, and discard the values.expectNextMatches
(Predicate<? super T> signalPredicate) Declare an expectation thatonNext
will be the next signal and evaluate it withsignalPredicate
.expectNextSequence
(Iterable<? extends T> signals) Declare an expectation thatsignals
will be the next in-order sequence ofsignals
.expectNoSignals
(Duration duration) Expect noPublisherSource.Subscriber.onNext(Object)
,PublisherSource.Subscriber.onError(Throwable)
, orPublisherSource.Subscriber.onComplete()
signals induration
time.InvokeRunnable.run()
on the thread which invokesStepVerifier.verify()
.Wait for a time delay ofduration
on the thread which invokesStepVerifier.verify()
.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 Details
-
expectNext
Declare an expectation thatsignal
will be the nextsignal
.- Parameters:
signal
- The next signal which is expected.- Returns:
- An object which allows for subsequent expectations to be defined.
-
expectNext
Declare an expectation thatsignals
will 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
Declare an expectation thatsignals
will 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
Declare an expectation thatonNext
will be the next signal and evaluate it withsignalPredicate
.- Parameters:
signalPredicate
- Will be invoked whenonNext
is called and will raise aAssertionError
if the predicate returnsfalse
.- Returns:
- An object which allows for subsequent expectations to be defined.
-
expectNextConsumed
Declare an expectation thatonNext
will be the next signal and evaluate it withsignalConsumer
.- Parameters:
signalConsumer
- Consumes the nextonNext
signal.- Returns:
- An object which allows for subsequent expectations to be defined.
-
expectNext
-
expectNext
PublisherStep<T> expectNext(long min, long max, Consumer<? super Iterable<? extends T>> signalsConsumer) - Parameters:
min
- The minimum number ofonNext
signals that are required before invokingsignalsConsumer
. If a terminal signal is processed and the number of accumulatedonNext
signals is>=
this value thesignalsConsumer
will be invoked for verification, otherwise the expectation will fail.max
- The maximum number ofonNext
signals that will be accumulated before invokingsignalsConsumer
.signalsConsumer
- AConsumer
that accepts anIterable
which has between[min, max]
items and preforms verification.- Returns:
- An object which allows for subsequent expectations to be defined.
-
expectNextCount
Expect between[min, max]
onNext
signals, and discard the values.- Parameters:
n
- The number ofonNext
signals that are expected.- Returns:
- An object which allows for subsequent expectations to be defined.
-
expectNextCount
Expect between[min, max]
onNext
signals, and discard the values.- Parameters:
min
- The minimum number ofonNext
signals that are required before. If a terminal signal is processed and the number of accumulatedonNext
signals is<
this value, the expectation will fail.max
- The maximum number ofonNext
signals 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
Expect noPublisherSource.Subscriber.onNext(Object)
,PublisherSource.Subscriber.onError(Throwable)
, orPublisherSource.Subscriber.onComplete()
signals induration
time.- Parameters:
duration
- The amount of time to wait for a signal.- Returns:
- An object which allows for subsequent expectations to be defined.
-
thenRequest
Manually request more from thePublisherSource.Subscription
.- Parameters:
n
- The amount to request.- Returns:
- An object which allows for subsequent expectations to be defined.
-
then
InvokeRunnable.run()
on the thread which invokesStepVerifier.verify()
.- Parameters:
r
- theRunnable
to invoke.- Returns:
- An object which allows for subsequent expectations to be defined.
-
thenAwait
Wait for a time delay ofduration
on the thread which invokesStepVerifier.verify()
.- Parameters:
duration
- the duration to wait for.- Returns:
- An object which allows for subsequent expectations to be defined.
-