java.lang.Object
org.apache.pekko.actor.testkit.typed.javadsl.Effects

public class Effects extends Object
Factories for behavior effects for BehaviorTestKit, each effect has a suitable equals and can be used to compare actual effects to expected ones.
  • Constructor Details

    • Effects

      public Effects()
  • Method Details

    • spawned

      public static <T> Effect.Spawned<T> spawned(Behavior<T> behavior, String childName)
      The behavior spawned a named child with the given behavior with no specific props
    • spawned

      public static <T> Effect.Spawned<T> spawned(Behavior<T> behavior, String childName, ActorRef<T> ref)
      The behavior spawned a named child with the given behavior with no specific props
    • spawned

      public static <T> Effect.Spawned<T> spawned(Behavior<T> behavior, String childName, Props props)
      The behavior spawned a named child with the given behavior and specific props
    • spawned

      public static <T> Effect.Spawned<T> spawned(Behavior<T> behavior, String childName, Props props, ActorRef<T> ref)
      The behavior spawned a named child with the given behavior and specific props
    • spawnedAnonymous

      public static <T> Effect.SpawnedAnonymous<T> spawnedAnonymous(Behavior<T> behavior)
      The behavior spawned an anonymous child with the given behavior with no specific props
    • spawnedAnonymous

      public static <T> Effect.SpawnedAnonymous<T> spawnedAnonymous(Behavior<T> behavior, ActorRef<T> ref)
      The behavior spawned an anonymous child with the given behavior with no specific props
    • spawnedAnonymous

      public static <T> Effect.SpawnedAnonymous<T> spawnedAnonymous(Behavior<T> behavior, Props props)
      The behavior spawned an anonymous child with the given behavior with specific props
    • spawnedAnonymous

      public static <T> Effect.SpawnedAnonymous<T> spawnedAnonymous(Behavior<T> behavior, Props props, ActorRef<T> ref)
      The behavior spawned an anonymous child with the given behavior with specific props
    • stopped

      public static Effect.Stopped stopped(String childName)
      The behavior stopped childName
    • watched

      public static <T> Effect.Watched<T> watched(ActorRef<T> other)
      The behavior started watching other, through context.watch(other)
    • watchedWith

      public static <U, T> Effect.WatchedWith<U,T> watchedWith(ActorRef<U> other, T message)
      The behavior started watching other, through context.watchWith(other, message)
    • unwatched

      public static <T> Effect.Unwatched<T> unwatched(ActorRef<T> other)
      The behavior stopped watching other, through context.unwatch(other)
    • receiveTimeoutSet

      public static <T> Effect.ReceiveTimeoutSet<T> receiveTimeoutSet(Duration d, T message)
      The behavior set a new receive timeout, with message as timeout notification
    • scheduled

      public static <U> Effect.Scheduled<U> scheduled(Duration delay, ActorRef<U> target, U message)
      The behavior used context.schedule to schedule message to be sent to target after delay FIXME what about events scheduled through the scheduler?
    • timerScheduled

      public static <U> Effect.TimerScheduled<U> timerScheduled(Object key, U msg, Duration delay, org.apache.pekko.actor.testkit.typed.Effect.TimerScheduled.TimerMode mode, boolean overriding, Effect send)
    • noEffects

      public static Effect.NoEffects noEffects()
      Used to represent an empty list of effects - in other words, the behavior didn't do anything observable