Package akka.javasdk.testkit
Class EventingTestKit.MessageBuilder
Object
akka.javasdk.testkit.EventingTestKit.MessageBuilder
- Enclosing interface:
EventingTestKit
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionakka.javasdk.Metadata
defaultMetadata
(Object payload, String subject) Create a default metadata a given payload and subject.<T> EventingTestKit.Message
<T> of
(T payload, akka.javasdk.Metadata metadata) Create a message object from a payload plus metadata.<T> EventingTestKit.Message
<T> Create a message from a payload plus a subject (that is, the entity id).
-
Constructor Details
-
MessageBuilder
public MessageBuilder(akka.javasdk.impl.serialization.JsonSerializer serializer)
-
-
Method Details
-
of
Create a message from a payload plus a subject (that is, the entity id). Automatically adds required default metadata for a CloudEvent.- Type Parameters:
T
-- Parameters:
payload
- the message payloadsubject
- the entity id of which the message is concerned about- Returns:
- a Message object to be used in the context of the Testkit
-
defaultMetadata
Create a default metadata a given payload and subject.- Parameters:
payload
- the message payloadsubject
- the entity id to associate with the payload- Returns:
-
of
Create a message object from a payload plus metadata.- Type Parameters:
T
-- Parameters:
payload
- the message payloadmetadata
- the metadata associated with the message- Returns:
- a Message object to be used in the context of the Testkit
-