class Probe[T] extends ManualProbe[T]
Single subscription tracking for ManualProbe.
- Source
- StreamTestKit.scala
- Alphabetic
- By Inheritance
- Probe
- ManualProbe
- Subscriber
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- All
Type Members
-
type
Self = Probe[T]
- Definition Classes
- Probe → ManualProbe
Value Members
- def cancel(): Self
-
def
ensureSubscription(): Self
Asserts that a subscription has been received or will be received
-
def
expectComplete(): Self
Fluent DSL
Fluent DSL
Expect completion.
- Definition Classes
- ManualProbe
-
def
expectError(cause: Throwable): Self
Fluent DSL
Fluent DSL
Expect given Throwable.
- Definition Classes
- ManualProbe
-
def
expectError(): Throwable
Expect and return the signalled Throwable.
Expect and return the signalled Throwable.
- Definition Classes
- ManualProbe
-
def
expectEvent(event: SubscriberEvent): Self
Fluent DSL
Fluent DSL
Expect SubscriberEvent (any of:
OnSubscribe
,OnNext
,OnError
orOnComplete
).- Definition Classes
- ManualProbe
-
def
expectEvent(max: FiniteDuration): SubscriberEvent
Expect and return SubscriberEvent (any of:
OnSubscribe
,OnNext
,OnError
orOnComplete
).Expect and return SubscriberEvent (any of:
OnSubscribe
,OnNext
,OnError
orOnComplete
).- Definition Classes
- ManualProbe
-
def
expectEvent(): SubscriberEvent
Expect and return SubscriberEvent (any of:
OnSubscribe
,OnNext
,OnError
orOnComplete
).Expect and return SubscriberEvent (any of:
OnSubscribe
,OnNext
,OnError
orOnComplete
).- Definition Classes
- ManualProbe
-
def
expectEventPF[T](f: PartialFunction[SubscriberEvent, T]): T
- Definition Classes
- ManualProbe
-
def
expectEventWithTimeoutPF[T](max: Duration, f: PartialFunction[SubscriberEvent, T]): T
- Definition Classes
- ManualProbe
-
def
expectNext(e1: T, e2: T, es: T*): Self
Fluent DSL
Fluent DSL
Expect multiple stream elements.
- Definition Classes
- ManualProbe
- Annotations
- @varargs()
-
def
expectNext(d: FiniteDuration, element: T): Self
Fluent DSL
Fluent DSL
Expect a stream element during specified time or timeout.
- Definition Classes
- ManualProbe
-
def
expectNext(element: T): Self
Fluent DSL
Fluent DSL
Expect a stream element.
- Definition Classes
- ManualProbe
-
def
expectNext(d: FiniteDuration): T
Expect and return a stream element during specified time or timeout.
Expect and return a stream element during specified time or timeout.
- Definition Classes
- ManualProbe
-
def
expectNext(): T
Expect and return a stream element.
Expect and return a stream element.
- Definition Classes
- ManualProbe
-
def
expectNextChainingPF(f: PartialFunction[Any, Any]): Self
Expect a stream element during specified time or timeout and test it with partial function.
Expect a stream element during specified time or timeout and test it with partial function.
Allows chaining probe methods.
- Definition Classes
- ManualProbe
-
def
expectNextChainingPF(max: Duration, f: PartialFunction[Any, Any]): Self
Expect a stream element during specified time or timeout and test it with partial function.
Expect a stream element during specified time or timeout and test it with partial function.
Allows chaining probe methods.
- max
wait no more than max time, otherwise throw AssertionError
- Definition Classes
- ManualProbe
-
def
expectNextN(all: Seq[T]): Self
Fluent DSL Expect the given elements to be signalled in order.
Fluent DSL Expect the given elements to be signalled in order.
- Definition Classes
- ManualProbe
-
def
expectNextN(n: Long): Seq[T]
Expect and return the next
n
stream elements.Expect and return the next
n
stream elements.- Definition Classes
- ManualProbe
-
def
expectNextOrComplete(element: T): Self
Fluent DSL
Fluent DSL
Expect given next element or stream completion.
- Definition Classes
- ManualProbe
-
def
expectNextOrComplete(): Either[OnComplete.type, T]
Expect next element or stream completion - returning whichever was signalled.
Expect next element or stream completion - returning whichever was signalled.
- Definition Classes
- ManualProbe
-
def
expectNextOrError(element: T, cause: Throwable): Either[Throwable, T]
Fluent DSL Expect given next element or error signal.
Fluent DSL Expect given next element or error signal.
- Definition Classes
- ManualProbe
-
def
expectNextOrError(): Either[Throwable, T]
Fluent DSL
Fluent DSL
Expect given next element or error signal, returning whichever was signalled.
- Definition Classes
- ManualProbe
-
def
expectNextPF[T](f: PartialFunction[Any, T]): T
Expect a stream element and test it with partial function.
Expect a stream element and test it with partial function.
- Definition Classes
- ManualProbe
-
def
expectNextUnordered(e1: T, e2: T, es: T*): Self
Fluent DSL
Fluent DSL
Expect multiple stream elements in arbitrary order.
- Definition Classes
- ManualProbe
- Annotations
- @varargs()
-
def
expectNextUnorderedN(all: Seq[T]): Self
Fluent DSL Expect the given elements to be signalled in any order.
Fluent DSL Expect the given elements to be signalled in any order.
- Definition Classes
- ManualProbe
-
def
expectNextWithTimeoutPF[T](max: Duration, f: PartialFunction[Any, T]): T
Expect a stream element and test it with partial function.
Expect a stream element and test it with partial function.
- max
wait no more than max time, otherwise throw AssertionError
- Definition Classes
- ManualProbe
-
def
expectNoMessage(remaining: Duration): Self
Java API: Assert that no message is received for the specified time.
Java API: Assert that no message is received for the specified time.
- Definition Classes
- ManualProbe
-
def
expectNoMessage(remaining: FiniteDuration): Self
Fluent DSL
Fluent DSL
Assert that no message is received for the specified time.
- Definition Classes
- ManualProbe
-
def
expectSubscription(): Subscription
Expect and return a org.reactivestreams.Subscription.
Expect and return a org.reactivestreams.Subscription.
- Definition Classes
- ManualProbe
-
def
expectSubscriptionAndComplete(signalDemand: Boolean): Self
Fluent DSL
Fluent DSL
Expect subscription followed by immediate stream completion.
Depending on the
signalDemand
parameter demand may be signalled immediately after obtaining the subscription in order to wake up a possibly lazy upstream. You can disable this by setting thesignalDemand
parameter tofalse
.See also #expectSubscriptionAndComplete.
- Definition Classes
- ManualProbe
-
def
expectSubscriptionAndComplete(): Self
Fluent DSL
Fluent DSL
Expect subscription followed by immediate stream completion. By default
1
demand will be signalled in order to wake up a possibly lazy upstreamSee also Boolean) if no demand should be signalled.
- Definition Classes
- ManualProbe
-
def
expectSubscriptionAndError(cause: Throwable, signalDemand: Boolean): Self
Fluent DSL
Fluent DSL
Expect subscription followed by immediate stream completion. By default
1
demand will be signalled in order to wake up a possibly lazy upstreamSee also Throwable).
- Definition Classes
- ManualProbe
-
def
expectSubscriptionAndError(cause: Throwable): Self
Fluent DSL
Fluent DSL
Expect subscription followed by immediate stream completion.
By default
1
demand will be signalled in order to wake up a possibly lazy upstream.See also Throwable, signalDemand: Boolean) if no demand should be signalled.
- Definition Classes
- ManualProbe
-
def
expectSubscriptionAndError(signalDemand: Boolean): Throwable
Expect subscription to be followed immediately by an error signal.
Expect subscription to be followed immediately by an error signal.
Depending on the
signalDemand
parameter demand may be signalled immediately after obtaining the subscription in order to wake up a possibly lazy upstream. You can disable this by setting thesignalDemand
parameter tofalse
.See also #expectSubscriptionAndError().
- Definition Classes
- ManualProbe
-
def
expectSubscriptionAndError(): Throwable
Expect subscription to be followed immediately by an error signal.
Expect subscription to be followed immediately by an error signal.
By default
1
demand will be signalled in order to wake up a possibly lazy upstream.See also #expectSubscriptionAndError(Boolean) if no demand should be signalled.
- Definition Classes
- ManualProbe
-
def
onComplete(): Unit
- Definition Classes
- ManualProbe → Subscriber
-
def
onError(cause: Throwable): Unit
- Definition Classes
- ManualProbe → Subscriber
-
def
onNext(element: T): Unit
- Definition Classes
- ManualProbe → Subscriber
-
def
onSubscribe(subscription: Subscription): Unit
- Definition Classes
- ManualProbe → Subscriber
-
def
receiveWhile[T](max: Duration = Duration.Undefined, idle: Duration = Duration.Inf, messages: Int = Int.MaxValue)(f: PartialFunction[SubscriberEvent, T]): Seq[T]
Receive messages for a given duration or until one does not match a given partial function.
Receive messages for a given duration or until one does not match a given partial function.
- Definition Classes
- ManualProbe
-
def
receiveWithin(max: FiniteDuration, messages: Int = Int.MaxValue): Seq[T]
Drains a given number of messages
Drains a given number of messages
- Definition Classes
- ManualProbe
- def request(n: Long): Self
-
def
requestNext(d: FiniteDuration): T
Request and expect a stream element during the specified time or timeout.
-
def
requestNext(): T
Request and expect a stream element.
-
def
requestNext(element: T): Self
Request and expect a stream element.
-
def
toStrict(atMost: FiniteDuration): Seq[T]
Attempt to drain the stream into a strict collection (by requesting
Long.MaxValue
elements).Attempt to drain the stream into a strict collection (by requesting
Long.MaxValue
elements).Use with caution: Be warned that this may not be a good idea if the stream is infinite or its elements are very large!
- Definition Classes
- ManualProbe
-
def
within[T](max: FiniteDuration)(f: ⇒ T): T
Same as calling
within(0 seconds, max)(f)
.Same as calling
within(0 seconds, max)(f)
.- Definition Classes
- ManualProbe
-
def
within[T](min: FiniteDuration, max: FiniteDuration)(f: ⇒ T): T
Execute code block while bounding its execution time between
min
andmax
.Execute code block while bounding its execution time between
min
andmax
.within
blocks may be nested. All methods in this trait which take maximum wait times are available in a version which implicitly uses the remaining time governed by the innermost enclosingwithin
block.Note that the timeout is scaled using Duration.dilated, which uses the configuration entry "akka.test.timefactor", while the min Duration is not.
val ret = within(50 millis) { test ! "ping" expectMsgClass(classOf[String]) }
- Definition Classes
- ManualProbe
Deprecated Value Members
-
def
expectNoMsg(remaining: FiniteDuration): Self
Fluent DSL
Fluent DSL
Assert that no message is received for the specified time. NOTE! Timeout value is automatically multiplied by timeFactor.
- Definition Classes
- ManualProbe
- Annotations
- @deprecated
- Deprecated
(Since version 2.5.5) Use expectNoMessage instead
-
def
expectNoMsg(): Self
Fluent DSL
Fluent DSL
Same as
expectNoMsg(remaining)
, but correctly treating the timeFactor. NOTE! Timeout value is automatically multiplied by timeFactor.- Definition Classes
- ManualProbe
- Annotations
- @deprecated
- Deprecated
(Since version 2.5.5) Use expectNoMessage instead