Package akka.javasdk.testkit
Class ConsumerTestKit<C extends akka.javasdk.consumer.Consumer>
Object
akka.javasdk.testkit.ConsumerTestKit<C>
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.
Call a message handler with method(...).invoke(...).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionfinal classfinal class -
Method Summary
Modifier and TypeMethodDescriptionPass in a Consumer message handler method reference without parameters, e.g.<I> ConsumerTestKit<C>.MethodRef1<I> Pass in a Consumer message handler method reference with a single parameter, e.g.static <C extends akka.javasdk.consumer.Consumer>
ConsumerTestKit<C>
-
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
-