Package akka.javasdk.testkit
Class TimedActionTestkit<A extends akka.javasdk.timedaction.TimedAction>
Object
akka.javasdk.testkit.TimedActionTestkit<A>
TimedAction Testkit for use in unit tests for TimedActions.
To test a TimedAction create a testkit instance by calling one of the available
TimedActionTestkit.of methods. The returned testkit can be used as many times as you want. It
doesn't preserve any state between invocations.
Use the call or stream methods to interact with the testkit.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionfinal classfinal class -
Method Summary
Modifier and TypeMethodDescriptionDeprecated, for removal: This API element is subject to removal in a future version.Use "method(MyTimedAction::myCommandHandler).invoke()" insteadcall(akka.japi.function.Function<A, akka.javasdk.timedaction.TimedAction.Effect> func, akka.javasdk.Metadata metadata) Deprecated, for removal: This API element is subject to removal in a future version.Use "method(MyTimedAction::myCommandHandler).withMetadata(metadata).invoke()" insteadPass in a Timed Action command handler method reference without parameters, e.g.<I> TimedActionTestkit<A>.MethodRef1<I> Pass in a Timed Action command handler method reference with a single parameter, e.g.static <A extends akka.javasdk.timedaction.TimedAction>
TimedActionTestkit<A>
-
Method Details
-
of
public static <A extends akka.javasdk.timedaction.TimedAction> TimedActionTestkit<A> of(Supplier<A> actionFactory) -
call
@Deprecated(since="3.5.5", forRemoval=true) public TimedActionResult call(akka.japi.function.Function<A, akka.javasdk.timedaction.TimedAction.Effect> func) Deprecated, for removal: This API element is subject to removal in a future version.Use "method(MyTimedAction::myCommandHandler).invoke()" insteadThecallmethod can be used to simulate a unary call to the Action. The passed java lambda should return an Action.Effect. The Effect is interpreted into an ActionResult that can be used in test assertions.- Parameters:
func- A function from Action to Action.Effect- Returns:
- an ActionResult
-
call
@Deprecated(since="3.5.5", forRemoval=true) public TimedActionResult call(akka.japi.function.Function<A, akka.javasdk.timedaction.TimedAction.Effect> func, akka.javasdk.Metadata metadata) Deprecated, for removal: This API element is subject to removal in a future version.Use "method(MyTimedAction::myCommandHandler).withMetadata(metadata).invoke()" insteadThecallmethod can be used to simulate a unary call to the Action. The passed java lambda should return an Action.Effect. The Effect is interpreted into an ActionResult that can be used in test assertions.- Parameters:
func- A function from Action to Action.Effectmetadata- A metadata passed as a call context- Returns:
- an ActionResult
-
method
public TimedActionTestkit<A>.MethodRef method(akka.japi.function.Function<A, akka.javasdk.timedaction.TimedAction.Effect> func) Pass in a Timed Action command handler method reference without parameters, e.g.MyTimedAction::myCommandHandler -
method
public <I> TimedActionTestkit<A>.MethodRef1<I> method(akka.japi.function.Function2<A, I, akka.javasdk.timedaction.TimedAction.Effect> func) Pass in a Timed Action command handler method reference with a single parameter, e.g.MyTimedAction::myCommandHandler
-