Class ActorTestKit$
- java.lang.Object
-
- akka.actor.testkit.typed.javadsl.ActorTestKit$
-
public class ActorTestKit$ extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static ActorTestKit$MODULE$Static reference to the singleton instance of this Scala object.
-
Constructor Summary
Constructors Constructor Description ActorTestKit$()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.typesafe.config.ConfigapplicationTestConfig()Config loaded fromapplication-test.conf, which is used if no specific config is given.ActorTestKitcreate()Create a testkit named from the ActorTestKit class.ActorTestKitcreate(ActorSystem<?> system)Create a testkit from the provided actor system.ActorTestKitcreate(com.typesafe.config.Config customConfig)Create a testkit named from the ActorTestKit class, and use a custom config for the actor system.ActorTestKitcreate(java.lang.String name)Create a testkit using the provided name.ActorTestKitcreate(java.lang.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.ActorTestKitcreate(java.lang.String name, com.typesafe.config.Config customConfig, TestKitSettings settings)Create anActorSystemnamed based on the provided name, use the provided custom config for the actor system, and the testkit will use the provided setting.voidshutdown(ActorSystem<?> system)Shutdown the givenActorSystemand block until it shuts down, if more time thansystem-shutdown-defaultpasses an exception is thrown (can be configured withthrow-on-shutdown-timeout).voidshutdown(ActorSystem<?> system, java.time.Duration duration)Shutdown the givenActorSystemand block until it shuts down, if more time thansystem-shutdown-defaultpasses an exception is thrown (can be configured withthrow-on-shutdown-timeout).voidshutdown(ActorSystem<?> system, java.time.Duration duration, boolean throwIfShutdownTimesOut)Shutdown the given actor system and wait up todurationfor shutdown to complete.
-
-
-
Field Detail
-
MODULE$
public static final ActorTestKit$ MODULE$
Static reference to the singleton instance of this Scala object.
-
-
Method Detail
-
create
public ActorTestKit create()
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.
-
create
public ActorTestKit create(ActorSystem<?> system)
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.
-
create
public ActorTestKit create(java.lang.String name)
Create a testkit using the provided name.It will create an
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.
-
create
public ActorTestKit create(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
ActorSystemWhen the test has completed you should terminate the
ActorSystemand the testkit withActorTestKit.shutdownTestKit().
-
create
public ActorTestKit create(java.lang.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
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().
-
create
public ActorTestKit create(java.lang.String name, com.typesafe.config.Config customConfig, TestKitSettings settings)
Create anActorSystemnamed 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
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
public void shutdown(ActorSystem<?> system, java.time.Duration duration, boolean throwIfShutdownTimesOut)
Shutdown the given actor system and wait up todurationfor shutdown to complete.- Parameters:
throwIfShutdownTimesOut- Fail the test if the system fails to shut down, if false an error is printed to stdout when the system did not shutdown but no exception is thrown.
-
shutdown
public void shutdown(ActorSystem<?> system, java.time.Duration duration)
Shutdown the givenActorSystemand block until it shuts down, if more time thansystem-shutdown-defaultpasses an exception is thrown (can be configured withthrow-on-shutdown-timeout).
-
shutdown
public void shutdown(ActorSystem<?> system)
Shutdown the givenActorSystemand block until it shuts down, if more time thansystem-shutdown-defaultpasses an exception is thrown (can be configured withthrow-on-shutdown-timeout).
-
applicationTestConfig
public com.typesafe.config.Config applicationTestConfig()
Config loaded fromapplication-test.conf, which is used if no specific config is given.
-
-