Class ActorTestKitBase

  • Direct Known Subclasses:
    ScalaTestWithActorTestKit

    public abstract class ActorTestKitBase
    extends java.lang.Object
    A base class for the ActorTestKit, making it possible to have testing framework (e.g. ScalaTest) manage the lifecycle of the testkit.

    An implementation for ScalaTest is ScalaTestWithActorTestKit.

    Another abstract class that is testing framework specific should extend this class and automatically shut down the testKit when the test completes or fails by implementing afterAll().

    • Constructor Detail

      • ActorTestKitBase

        public ActorTestKitBase​(ActorTestKit testKit)
      • ActorTestKitBase

        public ActorTestKitBase()
      • ActorTestKitBase

        public ActorTestKitBase​(java.lang.String config)
        Use a custom config for the actor system.
        Parameters:
        config - (undocumented)
      • ActorTestKitBase

        public ActorTestKitBase​(com.typesafe.config.Config config)
        Use a custom config for the actor system.
        Parameters:
        config - (undocumented)
      • ActorTestKitBase

        public ActorTestKitBase​(com.typesafe.config.Config config,
                                TestKitSettings settings)
        Use a custom config for the actor system, and a custom TestKitSettings.
        Parameters:
        config - (undocumented)
        settings - (undocumented)
    • Method Detail

      • testNameFromCallStack

        public static java.lang.String testNameFromCallStack()
      • system

        public ActorSystem<scala.runtime.Nothing$> system()
        See corresponding method on ActorTestKit
        Returns:
        (undocumented)
      • timeout

        public Timeout timeout()
        See corresponding method on ActorTestKit
        Returns:
        (undocumented)
      • scheduler

        public Scheduler scheduler()
        See corresponding method on ActorTestKit
        Returns:
        (undocumented)
      • spawn

        public <T> ActorRef<T> spawn​(Behavior<T> behavior)
        See corresponding method on ActorTestKit
        Parameters:
        behavior - (undocumented)
        Returns:
        (undocumented)
      • spawn

        public <T> ActorRef<T> spawn​(Behavior<T> behavior,
                                     java.lang.String name)
        See corresponding method on ActorTestKit
        Parameters:
        behavior - (undocumented)
        name - (undocumented)
        Returns:
        (undocumented)
      • spawn

        public <T> ActorRef<T> spawn​(Behavior<T> behavior,
                                     Props props)
        See corresponding method on ActorTestKit
        Parameters:
        behavior - (undocumented)
        props - (undocumented)
        Returns:
        (undocumented)
      • spawn

        public <T> ActorRef<T> spawn​(Behavior<T> behavior,
                                     java.lang.String name,
                                     Props props)
        See corresponding method on ActorTestKit
        Parameters:
        behavior - (undocumented)
        name - (undocumented)
        props - (undocumented)
        Returns:
        (undocumented)
      • createTestProbe

        public <M> TestProbe<M> createTestProbe()
        See corresponding method on ActorTestKit
        Returns:
        (undocumented)
      • createTestProbe

        public <M> TestProbe<M> createTestProbe​(java.lang.String name)
        See corresponding method on ActorTestKit
        Parameters:
        name - (undocumented)
        Returns:
        (undocumented)
      • afterAll

        protected abstract void afterAll()
        To be implemented by "more" concrete class that can mixin BeforeAndAfterAll or similar, for example FlatSpecLike with BeforeAndAfterAll. Implement by calling testKit.shutdownTestKit().