Class ManualTime
java.lang.Object
org.apache.pekko.actor.testkit.typed.scaladsl.ManualTime
Not for user instantiation, see
apply(org.apache.pekko.actor.typed.ActorSystem<?>)-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ManualTimeapply(ActorSystem<?> system) Access the manual scheduler, note that you need to setup the actor system/testkit withManualTime.configfor this to work.static com.typesafe.config.Configconfig()Config needed to use theExplicitlyTriggeredSchedulervoidexpectNoMessageFor(scala.concurrent.duration.FiniteDuration duration, TestProbe<?>... on) Advance the clock by the specified duration and assert that the probes receive no messages.voidexpectNoMessageFor(scala.concurrent.duration.FiniteDuration duration, scala.collection.immutable.Seq<TestProbe<?>> on) Advance the clock by the specified duration and assert that the probes receive no messages.voidtimePasses(scala.concurrent.duration.FiniteDuration amount) Advance the clock by the specified duration, executing all outstanding jobs on the calling thread before returning.
-
Constructor Details
-
ManualTime
-
-
Method Details
-
config
public static com.typesafe.config.Config config()Config needed to use theExplicitlyTriggeredScheduler -
apply
Access the manual scheduler, note that you need to setup the actor system/testkit withManualTime.configfor this to work. -
expectNoMessageFor
public void expectNoMessageFor(scala.concurrent.duration.FiniteDuration duration, TestProbe<?>... on) Advance the clock by the specified duration and assert that the probes receive no messages.After advancing the clock, each probe waits for the configured
pekko.actor.testkit.typed.expect-no-message-defaultduration so that asynchronously dispatched messages can arrive. -
timePasses
public void timePasses(scala.concurrent.duration.FiniteDuration amount) Advance the clock by the specified duration, executing all outstanding jobs on the calling thread before returning.We will not add a dilation factor to this amount, since the scheduler API also does not apply dilation. If you want the amount of time passed to be dilated, apply the dilation before passing the delay to this method.
-
expectNoMessageFor
public void expectNoMessageFor(scala.concurrent.duration.FiniteDuration duration, scala.collection.immutable.Seq<TestProbe<?>> on) Advance the clock by the specified duration and assert that the probes receive no messages.After advancing the clock, each probe waits for the configured
pekko.actor.testkit.typed.expect-no-message-defaultduration so that asynchronously dispatched messages can arrive.
-