Package akka.javasdk.testkit
Class TestNotificationPublisher<T>
Object
akka.javasdk.testkit.TestNotificationPublisher<T>
- Type Parameters:
T- the type of notification messages
- All Implemented Interfaces:
akka.javasdk.NotificationPublisher<T>
public final class TestNotificationPublisher<T>
extends Object
implements akka.javasdk.NotificationPublisher<T>
Test implementation of
NotificationPublisher that collects all published notifications
for later assertions.
Example usage:
var notificationPublisher = new TestNotificationPublisher<MyNotification>();
var testKit = EventSourcedTestKit.of(entityId, ctx -> new MyEntity(notificationPublisher));
-
Nested Class Summary
Nested classes/interfaces inherited from interface akka.javasdk.NotificationPublisher
akka.javasdk.NotificationPublisher.NotificationStream<T> -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface akka.javasdk.NotificationPublisher
publishSink, publishTokenStream, stream
-
Constructor Details
-
TestNotificationPublisher
public TestNotificationPublisher()
-
-
Method Details
-
publish
- Specified by:
publishin interfaceakka.javasdk.NotificationPublisher<T>
-
getNotifications
Returns a list of all notifications published so far, in order. -
clear
public void clear()Clears all collected notifications.
-