class ManualProbe[I] extends Publisher[I]
Implementation of org.reactivestreams.Publisher that allows various assertions. This probe does not track demand. Therefore you need to expect demand before sending elements downstream.
- Source
- StreamTestKit.scala
- Alphabetic
- By Inheritance
- ManualProbe
- Publisher
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- Protected
Type Members
- abstract type Self <: ManualProbe[I]
Value Members
- def executeAfterSubscription[T](f: => T): T
- def expectEventPF[T](f: PartialFunction[PublisherEvent, T]): T
- def expectNoMessage(max: FiniteDuration): Self
Expect no messages for a given duration.
- def expectNoMessage(): Self
Expect no messages.
Expect no messages. Waits for the default period configured as
akka.actor.testkit.expect-no-message-default
. - def expectRequest(subscription: Subscription, n: Int): Self
Expect demand from a given subscription.
- def expectSubscription(): PublisherProbeSubscription[I]
Expect a subscription.
- def getPublisher: Publisher[I]
- def receiveWhile[T](max: Duration = Duration.Undefined, idle: Duration = Duration.Inf, messages: Int = Int.MaxValue)(f: PartialFunction[PublisherEvent, T]): Seq[T]
Receive messages for a given duration or until one does not match a given partial function.
- def subscribe(subscriber: Subscriber[_ >: I]): Unit
Subscribes a given org.reactivestreams.Subscriber to this probe publisher.
Subscribes a given org.reactivestreams.Subscriber to this probe publisher.
- Definition Classes
- ManualProbe → Publisher
- def within[T](max: FiniteDuration)(f: => T): T
Same as calling
within(0 seconds, max)(f)
. - 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]) }
Deprecated Value Members
- def expectNoMsg(max: FiniteDuration): Self
Expect no messages for a given duration.
Expect no messages for a given duration. NOTE! Timeout value is automatically multiplied by timeFactor.
- Annotations
- @deprecated
- Deprecated
(Since version 2.5.5) Use expectNoMessage instead
- def expectNoMsg(): Self
Expect no messages.
Expect no messages. NOTE! Timeout value is automatically multiplied by timeFactor.
- Annotations
- @deprecated
- Deprecated
(Since version 2.5.5) Use expectNoMessage instead