Probe

org.apache.pekko.stream.testkit.TestPublisher.Probe
See theProbe companion object
class Probe[T] extends ManualProbe[T]

Single subscription and demand tracking for TestPublisher.ManualProbe.

Attributes

Companion
object
Source
StreamTestKit.scala
Graph
Supertypes
class ManualProbe[T]
trait Publisher[T]
class Object
trait Matchable
class Any

Members list

Type members

Types

type Self = Probe[T]

Attributes

Source
StreamTestKit.scala

Value members

Concrete methods

Asserts that a subscription has been received or will be received

Asserts that a subscription has been received or will be received

Attributes

Source
StreamTestKit.scala

Attributes

Source
StreamTestKit.scala

Attributes

Source
StreamTestKit.scala
def expectCancellationWithCause[E <: Throwable](causeClass: Class[E]): E

Java API

Java API

Attributes

Source
StreamTestKit.scala

Attributes

Source
StreamTestKit.scala
def pending: Long

Current pending requests.

Current pending requests.

Attributes

Source
StreamTestKit.scala

Attributes

Source
StreamTestKit.scala
def sendError(cause: Throwable): Self

Attributes

Source
StreamTestKit.scala
def sendNext(elem: T): Self

Attributes

Source
StreamTestKit.scala
def unsafeSendNext(elem: T): Self

Attributes

Source
StreamTestKit.scala

Inherited methods

JAVA API

JAVA API

Attributes

Since

1.1.0

Inherited from:
ManualProbe
Source
StreamTestKit.scala
def executeAfterSubscription[T](f: => T): T

Attributes

Inherited from:
ManualProbe
Source
StreamTestKit.scala

Attributes

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

JAVA API

JAVA API

Expect no messages for a given duration.

Attributes

Since

1.1.0

Inherited from:
ManualProbe
Source
StreamTestKit.scala

Expect no messages for a given duration.

Expect no messages for a given duration.

Attributes

Inherited from:
ManualProbe
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

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

Expect demand from a given subscription.

Expect demand from a given subscription.

Attributes

Inherited from:
ManualProbe
Source
StreamTestKit.scala
def expectSubscription(): PublisherProbeSubscription[T]

Expect a subscription.

Expect a subscription.

Attributes

Inherited from:
ManualProbe
Source
StreamTestKit.scala

Attributes

Inherited from:
ManualProbe
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

Inherited from:
ManualProbe
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

Inherited from:
ManualProbe
Source
StreamTestKit.scala
def subscribe(subscriber: Subscriber[_ >: T]): Unit

Subscribes a given org.reactivestreams.Subscriber to this probe publisher.

Subscribes a given org.reactivestreams.Subscriber to this probe publisher.

Attributes

Inherited from:
ManualProbe
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

Inherited from:
ManualProbe
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

Inherited from:
ManualProbe
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

Inherited from:
ManualProbe
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

Inherited from:
ManualProbe
Source
StreamTestKit.scala

Deprecated and Inherited methods

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
Inherited from:
ManualProbe
Source
StreamTestKit.scala
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
Inherited from:
ManualProbe
Source
StreamTestKit.scala