Class ActorTestKitBase
- java.lang.Object
-
- org.apache.pekko.actor.testkit.typed.scaladsl.ActorTestKitBase
-
- Direct Known Subclasses:
ScalaTestWithActorTestKit
public abstract class ActorTestKitBase extends java.lang.ObjectA base class for theActorTestKit, 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
testKitwhen the test completes or fails by implementingafterAll().
-
-
Constructor Summary
Constructors Constructor Description ActorTestKitBase()ActorTestKitBase(com.typesafe.config.Config config)Use a custom config for the actor system.ActorTestKitBase(com.typesafe.config.Config config, TestKitSettings settings)Use a custom config for the actor system, and a custompekko.actor.testkit.typed.TestKitSettings.ActorTestKitBase(java.lang.String config)Use a custom config for the actor system.ActorTestKitBase(ActorTestKit testKit)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voidafterAll()To be implemented by "more" concrete class that can mixinBeforeAndAfterAllor similar, for exampleFlatSpecLike with BeforeAndAfterAll.TestProbe<DeadLetter>createDeadLetterProbe()See corresponding method onActorTestKitTestProbe<Dropped>createDroppedMessageProbe()See corresponding method onActorTestKit<M> TestProbe<M>createTestProbe()See corresponding method onActorTestKit<M> TestProbe<M>createTestProbe(java.lang.String name)See corresponding method onActorTestKitTestProbe<UnhandledMessage>createUnhandledMessageProbe()See corresponding method onActorTestKitSerializationTestKitserializationTestKit()Additional testing utilities for serialization.<T> ActorRef<T>spawn(Behavior<T> behavior)See corresponding method onActorTestKit<T> ActorRef<T>spawn(Behavior<T> behavior, java.lang.String name)See corresponding method onActorTestKit<T> ActorRef<T>spawn(Behavior<T> behavior, java.lang.String name, Props props)See corresponding method onActorTestKit<T> ActorRef<T>spawn(Behavior<T> behavior, Props props)See corresponding method onActorTestKitActorSystem<scala.runtime.Nothing$>system()See corresponding method onActorTestKitActorTestKittestKit()TestKitSettingstestKitSettings()See corresponding method onActorTestKitstatic java.lang.StringtestNameFromCallStack()Timeouttimeout()See corresponding method onActorTestKit
-
-
-
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.
-
ActorTestKitBase
public ActorTestKitBase(com.typesafe.config.Config config)
Use a custom config for the actor system.
-
ActorTestKitBase
public ActorTestKitBase(com.typesafe.config.Config config, TestKitSettings settings)Use a custom config for the actor system, and a custompekko.actor.testkit.typed.TestKitSettings.
-
-
Method Detail
-
testNameFromCallStack
public static java.lang.String testNameFromCallStack()
-
testKit
public ActorTestKit testKit()
-
system
public ActorSystem<scala.runtime.Nothing$> system()
See corresponding method onActorTestKit
-
testKitSettings
public TestKitSettings testKitSettings()
See corresponding method onActorTestKit
-
timeout
public Timeout timeout()
See corresponding method onActorTestKit
-
spawn
public <T> ActorRef<T> spawn(Behavior<T> behavior)
See corresponding method onActorTestKit
-
spawn
public <T> ActorRef<T> spawn(Behavior<T> behavior, java.lang.String name)
See corresponding method onActorTestKit
-
spawn
public <T> ActorRef<T> spawn(Behavior<T> behavior, Props props)
See corresponding method onActorTestKit
-
spawn
public <T> ActorRef<T> spawn(Behavior<T> behavior, java.lang.String name, Props props)
See corresponding method onActorTestKit
-
createTestProbe
public <M> TestProbe<M> createTestProbe()
See corresponding method onActorTestKit
-
createTestProbe
public <M> TestProbe<M> createTestProbe(java.lang.String name)
See corresponding method onActorTestKit
-
createDroppedMessageProbe
public TestProbe<Dropped> createDroppedMessageProbe()
See corresponding method onActorTestKit
-
createDeadLetterProbe
public TestProbe<DeadLetter> createDeadLetterProbe()
See corresponding method onActorTestKit
-
createUnhandledMessageProbe
public TestProbe<UnhandledMessage> createUnhandledMessageProbe()
See corresponding method onActorTestKit
-
serializationTestKit
public SerializationTestKit serializationTestKit()
Additional testing utilities for serialization.
-
afterAll
protected abstract void afterAll()
To be implemented by "more" concrete class that can mixinBeforeAndAfterAllor similar, for exampleFlatSpecLike with BeforeAndAfterAll. Implement by callingtestKit.shutdownTestKit().
-
-