ManualProbe

org.apache.pekko.stream.testkit.TestPublisher.ManualProbe
See theManualProbe companion object
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.

Attributes

Companion
object
Source
StreamTestKit.scala
Graph
Supertypes
trait Publisher[I]
class Object
trait Matchable
class Any
Known subtypes
class Probe[T]

Members list

Type members

Types

type Self <: ManualProbe[I]

Attributes

Source
StreamTestKit.scala

Value members

Concrete methods

def executeAfterSubscription[T](f: => T): T

Attributes

Source
StreamTestKit.scala

JAVA API

JAVA API

Attributes

Since

1.1.0

Source
StreamTestKit.scala

Attributes

Source
StreamTestKit.scala

Expect no messages. Waits for the default period configured as pekko.actor.testkit.expect-no-message-default.

Expect no messages. Waits for the default period configured as pekko.actor.testkit.expect-no-message-default.

Attributes

Source
StreamTestKit.scala

Expect no messages for a given duration.

Expect no messages for a given duration.

Attributes

Source
StreamTestKit.scala
def expectNoMessage(max: Duration): Self

JAVA API

JAVA API

Expect no messages for a given duration.

Attributes

Since

1.1.0

Source
StreamTestKit.scala
def expectRequest(subscription: Subscription, n: Int): Self

Expect demand from a given subscription.

Expect demand from a given subscription.

Attributes

Source
StreamTestKit.scala
def expectSubscription(): PublisherProbeSubscription[I]

Expect a subscription.

Expect a subscription.

Attributes

Source
StreamTestKit.scala

Attributes

Source
StreamTestKit.scala
def receiveWhile[T](max: Duration, idle: Duration, messages: Int)(f: PartialFunction[PublisherEvent, 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.

Attributes

Source
StreamTestKit.scala
def receiveWhile[T](max: Duration, idle: Duration, messages: Int, f: PartialFunction[PublisherEvent, T]): List[T]

JAVA API

JAVA API

Receive messages for a given duration or until one does not match a given partial function.

Attributes

Since

1.1.0

Source
StreamTestKit.scala
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.

Attributes

Source
StreamTestKit.scala
def within[T](min: FiniteDuration, max: FiniteDuration)(f: => T): T

Execute code block while bounding its execution time between min and max. 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 enclosing within block.

Execute code block while bounding its execution time between min and max. 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 enclosing within block.

Note that the timeout is scaled using Duration.dilated, which uses the configuration entry "pekko.test.timefactor", while the min Duration is not.

val ret = within(50 millis) {
 test ! "ping"
 expectMsgClass(classOf[String])
}

Attributes

Source
StreamTestKit.scala
def within[T](min: Duration, max: Duration, creator: Creator[T]): T

JAVA API

JAVA API

Execute code block while bounding its execution time between min and max. 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 enclosing within block.

Note that the timeout is scaled using Duration.dilated, which uses the configuration entry "pekko.test.timefactor", while the min Duration is not.

val ret = within(Duration.ofMillis(50)) {
 test ! "ping"
 expectMsgClass(classOf[String])
}

Attributes

Since

1.1.0

Source
StreamTestKit.scala
def within[T](max: FiniteDuration)(f: => T): T

Same as calling within(0 seconds, max)(f).

Same as calling within(0 seconds, max)(f).

Attributes

Source
StreamTestKit.scala
def within[T](max: Duration, creator: Creator[T]): T

JAVA API

JAVA API

Same as calling within(Duration.ofSeconds(0), max)(f).

Attributes

Since

1.1.0

Source
StreamTestKit.scala

Deprecated methods

def expectNoMsg(): Self

Expect no messages. NOTE! Timeout value is automatically multiplied by timeFactor.

Expect no messages. NOTE! Timeout value is automatically multiplied by timeFactor.

Attributes

Deprecated
[Since version Akka 2.5.5] Use expectNoMessage instead
Source
StreamTestKit.scala

Expect no messages for a given duration. NOTE! Timeout value is automatically multiplied by timeFactor.

Expect no messages for a given duration. NOTE! Timeout value is automatically multiplied by timeFactor.

Attributes

Deprecated
[Since version Akka 2.5.5] Use expectNoMessage instead
Source
StreamTestKit.scala