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.
-
Method Summary
Modifier and TypeMethodDescriptionThecall
method can be used to simulate a unary call to the Action.Thecall
method can be used to simulate a unary call to the Action.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
Thecall
method 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
public TimedActionResult call(Function<A, akka.javasdk.timedaction.TimedAction.Effect> func, akka.javasdk.Metadata metadata) Thecall
method 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
-