Class ActorTestKit$

java.lang.Object
org.apache.pekko.actor.testkit.typed.scaladsl.ActorTestKit$

public class ActorTestKit$ extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final ActorTestKit$
    Static reference to the singleton instance of this Scala object.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    com.typesafe.config.Config
    Config loaded from application-test.conf, which is used if no specific config is given.
    Create a testkit named from the ActorTestKit class.
    apply(com.typesafe.config.Config customConfig)
    Create a testkit named from the ActorTestKit class, and use a custom config for the actor system.
    apply(String name)
    Create a testkit using the provided name.
    apply(String name, com.typesafe.config.Config customConfig)
    Create a test kit named based on the provided name, and uses the provided custom config for the actor system.
    apply(String name, com.typesafe.config.Config customConfig, TestKitSettings settings)
    Create an pekko.actor.typed.ActorSystem named based on the provided name, use the provided custom config for the actor system, and the testkit will use the provided setting.
    apply(ActorSystem<?> system)
    Create a testkit from the provided actor system.
    void
    shutdown(ActorSystem<?> system)
    Shutdown the given pekko.actor.typed.ActorSystem and block until it shuts down, if more time than TestKitSettings.DefaultActorSystemShutdownTimeout passes an exception is thrown
    void
    shutdown(ActorSystem<?> system, scala.concurrent.duration.Duration timeout, boolean throwIfShutdownFails)
    Shutdown the given pekko.actor.typed.ActorSystem and block until it shuts down or the duration hits.
    boolean
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • MODULE$

      public static final ActorTestKit$ MODULE$
      Static reference to the singleton instance of this Scala object.
  • Constructor Details

    • ActorTestKit$

      public ActorTestKit$()
  • Method Details

    • apply

      public ActorTestKit apply()
      Create a testkit named from the ActorTestKit class.

      When the test has completed you should terminate the ActorSystem and the testkit with ActorTestKit.shutdownTestKit().

      Config loaded from application-test.conf if that exists, otherwise using default configuration from the reference.conf resources that ship with the Akka libraries. The application.conf of your project is not used in this case.

    • apply

      public ActorTestKit apply(ActorSystem<?> system)
      Create a testkit from the provided actor system.

      When the test has completed you should terminate the ActorSystem and the testkit with ActorTestKit.shutdownTestKit().

      Config loaded from the provided actor if that exists, otherwise using default configuration from the reference.conf resources that ship with the Akka libraries.

    • apply

      public ActorTestKit apply(String name)
      Create a testkit using the provided name.

      It will create an pekko.actor.typed.ActorSystem with this name, e.g. threads will include the name. When the test has completed you should terminate the ActorSystem and the testkit with ActorTestKit.shutdownTestKit().

      Config loaded from application-test.conf if that exists, otherwise using default configuration from the reference.conf resources that ship with the Akka libraries. The application.conf of your project is not used in this case.

    • apply

      public ActorTestKit apply(com.typesafe.config.Config customConfig)
      Create a testkit named from the ActorTestKit class, and use a custom config for the actor system.

      It will also used the provided customConfig provided to create the ActorSystem

      When the test has completed you should terminate the ActorSystem and the testkit with ActorTestKit.shutdownTestKit().

    • apply

      public ActorTestKit apply(String name, com.typesafe.config.Config customConfig)
      Create a test kit named based on the provided name, and uses the provided custom config for the actor system.

      It will create an pekko.actor.typed.ActorSystem with this name, e.g. threads will include the name.

      It will also used the provided customConfig provided to create the ActorSystem

      When the test has completed you should terminate the ActorSystem and the testkit with ActorTestKit.shutdownTestKit().

    • apply

      public ActorTestKit apply(String name, com.typesafe.config.Config customConfig, TestKitSettings settings)
      Create an pekko.actor.typed.ActorSystem named based on the provided name, use the provided custom config for the actor system, and the testkit will use the provided setting.

      It will create an pekko.actor.typed.ActorSystem with this name, e.g. threads will include the name.

      It will also used the provided customConfig provided to create the ActorSystem, and provided setting.

      When the test has completed you should terminate the ActorSystem and the testkit with ActorTestKit.shutdownTestKit().

    • shutdown

      public void shutdown(ActorSystem<?> system)
      Shutdown the given pekko.actor.typed.ActorSystem and block until it shuts down, if more time than TestKitSettings.DefaultActorSystemShutdownTimeout passes an exception is thrown
    • shutdown

      public void shutdown(ActorSystem<?> system, scala.concurrent.duration.Duration timeout, boolean throwIfShutdownFails)
      Shutdown the given pekko.actor.typed.ActorSystem and block until it shuts down or the duration hits. If the timeout hits verifySystemShutdown decides
    • shutdown$default$3

      public boolean shutdown$default$3()
    • ApplicationTestConfig

      public com.typesafe.config.Config ApplicationTestConfig()
      Config loaded from application-test.conf, which is used if no specific config is given.