程序包 | 说明 |
---|---|
reactor.test |
Main test components supporting the testing and assertion of publishers.
|
reactor.test.publisher |
Components supporting the creation of test-oriented
Publishers . |
限定符和类型 | 接口和说明 |
---|---|
static interface |
StepVerifier.FirstStep<T>
Define a builder for explicitly expecting an initializing
Subscription as
first signal. |
限定符和类型 | 方法和说明 |
---|---|
StepVerifier.Step<T> |
StepVerifier.Step.as(java.lang.String description)
Set a description for the previous verification step.
|
default StepVerifier.Step<T> |
StepVerifier.Step.assertNext(java.util.function.Consumer<? super T> assertionConsumer)
Expect an element and consume it with the given consumer, usually performing
assertions on it (eg. using Hamcrest, AssertJ or JUnit assertion methods).
|
StepVerifier.Step<T> |
StepVerifier.Step.consumeNextWith(java.util.function.Consumer<? super T> consumer)
Expect an element and consume with the given consumer.Any
AssertionError s thrown by the consumer will be rethrown during verification. |
StepVerifier.Step<T> |
StepVerifier.Step.consumeRecordedWith(java.util.function.Consumer<? super java.util.Collection<T>> consumer)
Expect a recording session started via
recordWith(java.util.function.Supplier<? extends java.util.Collection<T>>) , end it and verify
it by applying the given consumer. |
StepVerifier.Step<T> |
StepVerifier.Step.consumeSubscriptionWith(java.util.function.Consumer<? super org.reactivestreams.Subscription> consumer)
Expect a
Subscription and consume with the given consumer. |
StepVerifier.Step<T> |
StepVerifier.FirstStep.expectFusion()
Expect the source
Publisher to run with Reactor Fusion flow
optimization. |
StepVerifier.Step<T> |
StepVerifier.FirstStep.expectFusion(int requested)
Expect the source
Publisher to run the requested Reactor Fusion mode
from any of these modes :
Fuseable.NONE , Fuseable.SYNC , Fuseable.ASYNC ,
Fuseable.ANY , Fuseable.THREAD_BARRIER . |
StepVerifier.Step<T> |
StepVerifier.FirstStep.expectFusion(int requested,
int expected)
Expect the source
Publisher to run with Reactor Fusion flow
optimization. |
StepVerifier.Step<T> |
StepVerifier.Step.expectNext(T... ts)
Expect the next elements received to be equal to the given values.
|
StepVerifier.Step<T> |
StepVerifier.Step.expectNext(T t)
Expect the next element received to be equal to the given value.
|
StepVerifier.Step<T> |
StepVerifier.Step.expectNext(T t1,
T t2)
Expect the next elements received to be equal to the given values.
|
StepVerifier.Step<T> |
StepVerifier.Step.expectNext(T t1,
T t2,
T t3)
Expect the next elements received to be equal to the given values.
|
StepVerifier.Step<T> |
StepVerifier.Step.expectNext(T t1,
T t2,
T t3,
T t4)
Expect the next elements received to be equal to the given values.
|
StepVerifier.Step<T> |
StepVerifier.Step.expectNext(T t1,
T t2,
T t3,
T t4,
T t5)
Expect the next elements received to be equal to the given values.
|
StepVerifier.Step<T> |
StepVerifier.Step.expectNext(T t1,
T t2,
T t3,
T t4,
T t5,
T t6)
Expect the next elements received to be equal to the given values.
|
StepVerifier.Step<T> |
StepVerifier.Step.expectNextCount(long count)
Expect to received
count elements, starting from the previous
expectation or onSubscribe. |
StepVerifier.Step<T> |
StepVerifier.Step.expectNextMatches(java.util.function.Predicate<? super T> predicate)
Expect an element and evaluate with the given predicate.
|
StepVerifier.Step<T> |
StepVerifier.Step.expectNextSequence(java.lang.Iterable<? extends T> iterable)
Expect the next elements to match the given
Iterable until its
iterator depletes. |
StepVerifier.Step<T> |
StepVerifier.Step.expectNoAccessibleContext()
Expect that NO
Context was propagated after the Subscription
phase, which usually indicates that the sequence under test doesn't contain
Reactor operators (i.e. external Publisher, just a scalar source...). |
StepVerifier.Step<T> |
StepVerifier.Step.expectNoEvent(java.time.Duration duration)
Expect that no event has been observed by the verifier for the length of
the provided
Duration . |
StepVerifier.Step<T> |
StepVerifier.FirstStep.expectNoFusionSupport()
Expect the source
Publisher to NOT run with Reactor Fusion flow
optimization. |
StepVerifier.Step<T> |
StepVerifier.Step.expectRecordedMatches(java.util.function.Predicate<? super java.util.Collection<T>> predicate)
Expect a recording session started via
recordWith(java.util.function.Supplier<? extends java.util.Collection<T>>) , end it and verify
it by ensuring the provided predicate matches. |
StepVerifier.Step<T> |
StepVerifier.FirstStep.expectSubscription()
Expect a
Subscription . |
StepVerifier.Step<T> |
StepVerifier.FirstStep.expectSubscriptionMatches(java.util.function.Predicate<? super org.reactivestreams.Subscription> predicate)
Expect a
Subscription and evaluate with the given predicate. |
StepVerifier.Step<T> |
StepVerifier.Step.recordWith(java.util.function.Supplier<? extends java.util.Collection<T>> supplier)
Start a recording session storing
Subscriber.onNext(Object) values in
the supplied Collection . |
StepVerifier.Step<T> |
StepVerifier.ContextExpectations.then()
Add the context checks set up by this
StepVerifier.ContextExpectations as a
StepVerifier expectation, and return the current StepVerifier.Step in order
to build further sequence expectations and ultimately verify the sequence. |
StepVerifier.Step<T> |
StepVerifier.Step.then(java.lang.Runnable task)
Run an arbitrary task scheduled after previous expectations or tasks.
|
default StepVerifier.Step<T> |
StepVerifier.Step.thenAwait()
Mark a Pause in the expectation evaluation.
|
StepVerifier.Step<T> |
StepVerifier.Step.thenAwait(java.time.Duration timeshift)
Pause the expectation evaluation for a given
Duration . |
StepVerifier.Step<T> |
StepVerifier.Step.thenConsumeWhile(java.util.function.Predicate<T> predicate)
Consume further onNext signals as long as they match a predicate.
|
StepVerifier.Step<T> |
StepVerifier.Step.thenConsumeWhile(java.util.function.Predicate<T> predicate,
java.util.function.Consumer<T> consumer)
Consume further onNext signals using a provided
Consumer as long as
they match a Predicate . |
StepVerifier.Step<T> |
StepVerifier.Step.thenRequest(long n)
Request the given amount of elements from the upstream
Publisher . |
限定符和类型 | 方法和说明 |
---|---|
FluxOperatorTest.Scenario<I,O> |
FluxOperatorTest.Scenario.verifier(java.util.function.Consumer<StepVerifier.Step<O>> verifier) |
MonoOperatorTest.Scenario<I,O> |
MonoOperatorTest.Scenario.verifier(java.util.function.Consumer<StepVerifier.Step<O>> verifier) |
OperatorScenario<I,PI,O,PO> |
OperatorScenario.verifier(java.util.function.Consumer<StepVerifier.Step<O>> verifier) |
ParallelOperatorTest.Scenario<I,O> |
ParallelOperatorTest.Scenario.verifier(java.util.function.Consumer<StepVerifier.Step<O>> verifier) |
ReduceOperatorTest.Scenario<I,O> |
ReduceOperatorTest.Scenario.verifier(java.util.function.Consumer<StepVerifier.Step<O>> verifier) |