Class ConsumerTestKit<C extends akka.javasdk.consumer.Consumer>

Object
akka.javasdk.testkit.ConsumerTestKit<C>

public final class ConsumerTestKit<C extends akka.javasdk.consumer.Consumer> extends Object
Consumer Testkit for use in unit tests for Consumers.

To test a Consumer create a testkit instance by calling ConsumerTestKit.of. The returned testkit can be used as many times as you want. It doesn't preserve any state between invocations.

Use the method methods to interact with the testkit.

  • Method Details

    • of

      public static <C extends akka.javasdk.consumer.Consumer> ConsumerTestKit<C> of(Supplier<C> consumerFactory)
    • method

      public ConsumerTestKit<C>.MethodRef method(akka.japi.function.Function<C,akka.javasdk.consumer.Consumer.Effect> func)
      Pass in a Consumer message handler method reference without parameters, e.g. MyConsumer::onEvent
    • method

      public <I> ConsumerTestKit<C>.MethodRef1<I> method(akka.japi.function.Function2<C,I,akka.javasdk.consumer.Consumer.Effect> func)
      Pass in a Consumer message handler method reference with a single parameter, e.g. MyConsumer::onEvent