Class TimedActionTestkit<A extends akka.javasdk.timedaction.TimedAction>

Object
akka.javasdk.testkit.TimedActionTestkit<A>

public class TimedActionTestkit<A extends akka.javasdk.timedaction.TimedAction> extends Object
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 Classes
    Modifier and Type
    Class
    Description
    final class 
     
    final class 
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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()" instead
    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()" instead
    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.
    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.
    static <A extends akka.javasdk.timedaction.TimedAction>
    TimedActionTestkit<A>
    of(Supplier<A> actionFactory)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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()" instead
      The call 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

      @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()" instead
      The call 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
      metadata - 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