Class TestPublisher.ManualProbe<I>
- java.lang.Object
- 
- org.apache.pekko.stream.testkit.TestPublisher.ManualProbe<I>
 
- 
- All Implemented Interfaces:
- org.reactivestreams.Publisher<I>
 - Direct Known Subclasses:
- TestPublisher.Probe
 - Enclosing class:
- TestPublisher
 
 public static class TestPublisher.ManualProbe<I> extends java.lang.Object implements org.reactivestreams.Publisher<I>
- 
- 
Method SummaryAll Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description <T> TexecuteAfterSubscription(Creator<T> f)JAVA API<T> TexecuteAfterSubscription(scala.Function0<T> f)<T> TexpectEventPF(scala.PartialFunction<TestPublisher.PublisherEvent,T> f)JAVA APITestPublisher.ManualProbeexpectNoMessage()Expect no messages.TestPublisher.ManualProbeexpectNoMessage(java.time.Duration max)JAVA APITestPublisher.ManualProbeexpectNoMessage(scala.concurrent.duration.FiniteDuration max)Expect no messages for a given duration.TestPublisher.ManualProbeexpectNoMsg()Deprecated.Use expectNoMessage instead.TestPublisher.ManualProbeexpectNoMsg(scala.concurrent.duration.FiniteDuration max)Deprecated.Use expectNoMessage instead.TestPublisher.ManualProbeexpectRequest(org.reactivestreams.Subscription subscription, int n)Expect demand from a given subscription.StreamTestKit.PublisherProbeSubscription<I>expectSubscription()Expect a subscription.org.reactivestreams.Publisher<I>getPublisher()<T> java.util.List<T>receiveWhile(java.time.Duration max, java.time.Duration idle, int messages, scala.PartialFunction<TestPublisher.PublisherEvent,T> f)JAVA API<T> scala.collection.immutable.Seq<T>receiveWhile(scala.concurrent.duration.Duration max, scala.concurrent.duration.Duration idle, int messages, scala.PartialFunction<TestPublisher.PublisherEvent,T> f)Receive messages for a given duration or until one does not match a given partial function.<T> scala.concurrent.duration.DurationreceiveWhile$default$1()<T> scala.concurrent.duration.DurationreceiveWhile$default$2()<T> intreceiveWhile$default$3()voidsubscribe(org.reactivestreams.Subscriber<? super I> subscriber)Subscribes a givenSubscriberto this probe publisher.<T> Twithin(java.time.Duration min, java.time.Duration max, Creator<T> creator)JAVA API<T> Twithin(java.time.Duration max, Creator<T> creator)JAVA API<T> Twithin(scala.concurrent.duration.FiniteDuration min, scala.concurrent.duration.FiniteDuration max, scala.Function0<T> f)Execute code block while bounding its execution time betweenminandmax.<T> Twithin(scala.concurrent.duration.FiniteDuration max, scala.Function0<T> f)Same as callingwithin(0 seconds, max)(f).
 
- 
- 
- 
Method Detail- 
subscribepublic void subscribe(org.reactivestreams.Subscriber<? super I> subscriber) Subscribes a givenSubscriberto this probe publisher.- Specified by:
- subscribein interface- org.reactivestreams.Publisher<I>
 
 - 
executeAfterSubscriptionpublic <T> T executeAfterSubscription(scala.Function0<T> f) 
 - 
executeAfterSubscriptionpublic <T> T executeAfterSubscription(Creator<T> f) JAVA API- Since:
- 1.1.0
 
 - 
expectSubscriptionpublic StreamTestKit.PublisherProbeSubscription<I> expectSubscription() Expect a subscription.
 - 
expectRequestpublic TestPublisher.ManualProbe expectRequest(org.reactivestreams.Subscription subscription, int n) Expect demand from a given subscription.
 - 
expectNoMsgpublic TestPublisher.ManualProbe expectNoMsg() Deprecated.Use expectNoMessage instead. Since Akka 2.5.5.Expect no messages. NOTE! Timeout value is automatically multiplied by timeFactor.
 - 
expectNoMsgpublic TestPublisher.ManualProbe expectNoMsg(scala.concurrent.duration.FiniteDuration max) Deprecated.Use expectNoMessage instead. Since Akka 2.5.5.Expect no messages for a given duration. NOTE! Timeout value is automatically multiplied by timeFactor.
 - 
expectNoMessagepublic TestPublisher.ManualProbe expectNoMessage() Expect no messages. Waits for the default period configured aspekko.actor.testkit.expect-no-message-default.
 - 
expectNoMessagepublic TestPublisher.ManualProbe expectNoMessage(scala.concurrent.duration.FiniteDuration max) Expect no messages for a given duration.
 - 
expectNoMessagepublic TestPublisher.ManualProbe expectNoMessage(java.time.Duration max) JAVA APIExpect no messages for a given duration. - Since:
- 1.1.0
 
 - 
receiveWhilepublic <T> scala.collection.immutable.Seq<T> receiveWhile(scala.concurrent.duration.Duration max, scala.concurrent.duration.Duration idle, int messages, scala.PartialFunction<TestPublisher.PublisherEvent,T> f)Receive messages for a given duration or until one does not match a given partial function.
 - 
receiveWhilepublic <T> java.util.List<T> receiveWhile(java.time.Duration max, java.time.Duration idle, int messages, scala.PartialFunction<TestPublisher.PublisherEvent,T> f)JAVA APIReceive messages for a given duration or until one does not match a given partial function. - Since:
- 1.1.0
 
 - 
receiveWhile$default$1public <T> scala.concurrent.duration.Duration receiveWhile$default$1() 
 - 
receiveWhile$default$2public <T> scala.concurrent.duration.Duration receiveWhile$default$2() 
 - 
receiveWhile$default$3public <T> int receiveWhile$default$3() 
 - 
expectEventPFpublic <T> T expectEventPF(scala.PartialFunction<TestPublisher.PublisherEvent,T> f) JAVA APIReceive messages for a given duration or until one does not match a given partial function. - Since:
- 1.1.0
 
 - 
getPublisherpublic org.reactivestreams.Publisher<I> getPublisher() 
 - 
withinpublic <T> T within(scala.concurrent.duration.FiniteDuration min, scala.concurrent.duration.FiniteDuration max, scala.Function0<T> f)Execute code block while bounding its execution time betweenminandmax.withinblocks 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 enclosingwithinblock.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]) }
 - 
withinpublic <T> T within(java.time.Duration min, java.time.Duration max, Creator<T> creator)JAVA APIExecute code block while bounding its execution time between minandmax.withinblocks 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 enclosingwithinblock.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]) }- Since:
- 1.1.0
 
 - 
withinpublic <T> T within(scala.concurrent.duration.FiniteDuration max, scala.Function0<T> f)Same as callingwithin(0 seconds, max)(f).
 - 
withinpublic <T> T within(java.time.Duration max, Creator<T> creator)JAVA APISame as calling within(Duration.ofSeconds(0), max)(f).- Since:
- 1.1.0
 
 
- 
 
-