Class ActorTestKit$
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ActorTestKit$Static reference to the singleton instance of this Scala object. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.typesafe.config.ConfigConfig loaded fromapplication-test.conf, which is used if no specific config is given.apply()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.Create a testkit using the provided name.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 anpekko.actor.typed.ActorSystemnamed 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.voidshutdown(ActorSystem<?> system) Shutdown the givenpekko.actor.typed.ActorSystemand block until it shuts down, if more time thanTestKitSettings.DefaultActorSystemShutdownTimeoutpasses an exception is thrownvoidshutdown(ActorSystem<?> system, scala.concurrent.duration.Duration timeout, boolean throwIfShutdownFails) Shutdown the givenpekko.actor.typed.ActorSystemand block until it shuts down or thedurationhits.boolean
-
Field Details
-
MODULE$
Static reference to the singleton instance of this Scala object.
-
-
Constructor Details
-
ActorTestKit$
public ActorTestKit$()
-
-
Method Details
-
apply
Create a testkit named from the ActorTestKit class.When the test has completed you should terminate the
ActorSystemand the testkit withActorTestKit.shutdownTestKit().Config loaded from
application-test.confif 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
Create a testkit from the provided actor system.When the test has completed you should terminate the
ActorSystemand the testkit withActorTestKit.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
Create a testkit using the provided name.It will create an
pekko.actor.typed.ActorSystemwith this name, e.g. threads will include the name. When the test has completed you should terminate theActorSystemand the testkit withActorTestKit.shutdownTestKit().Config loaded from
application-test.confif 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
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
ActorSystemWhen the test has completed you should terminate the
ActorSystemand the testkit withActorTestKit.shutdownTestKit(). -
apply
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.ActorSystemwith this name, e.g. threads will include the name.It will also used the provided customConfig provided to create the
ActorSystemWhen the test has completed you should terminate the
ActorSystemand the testkit withActorTestKit.shutdownTestKit(). -
apply
public ActorTestKit apply(String name, com.typesafe.config.Config customConfig, TestKitSettings settings) Create anpekko.actor.typed.ActorSystemnamed 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.ActorSystemwith 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
ActorSystemand the testkit withActorTestKit.shutdownTestKit(). -
shutdown
Shutdown the givenpekko.actor.typed.ActorSystemand block until it shuts down, if more time thanTestKitSettings.DefaultActorSystemShutdownTimeoutpasses an exception is thrown -
shutdown
public void shutdown(ActorSystem<?> system, scala.concurrent.duration.Duration timeout, boolean throwIfShutdownFails) Shutdown the givenpekko.actor.typed.ActorSystemand block until it shuts down or thedurationhits. If the timeout hitsverifySystemShutdowndecides -
shutdown$default$3
public boolean shutdown$default$3() -
ApplicationTestConfig
public com.typesafe.config.Config ApplicationTestConfig()Config loaded fromapplication-test.conf, which is used if no specific config is given.
-