public class TestEventBuilder extends Object
| Constructor and Description |
|---|
TestEventBuilder() |
| Modifier and Type | Method and Description |
|---|---|
Event |
build(MuleContext muleContext,
FlowConstruct flow)
Produces an event with the specified configuration.
|
TestEventBuilder |
spyObjects()
Will spy the built
Message and Event. |
TestEventBuilder |
withAttributes(org.mule.runtime.api.message.Attributes attributes)
Sets the
Message.getAttributes() value of the produced message |
TestEventBuilder |
withCorrelation(GroupCorrelation correlation)
Configures the product event to have the provided
correlation. |
TestEventBuilder |
withInboundAttachment(String key,
DataHandler value)
Deprecated.
Transport infrastructure is deprecated. Use
DefaultMultiPartPayload instead. |
TestEventBuilder |
withInboundProperties(Map<String,Serializable> properties)
Deprecated.
Transport infrastructure is deprecated. Use
Attributes instead. |
TestEventBuilder |
withInboundProperty(String key,
Serializable value)
Deprecated.
Transport infrastructure is deprecated. Use
Attributes instead. |
TestEventBuilder |
withMediaType(org.mule.runtime.api.metadata.MediaType mediaType)
Prepares the given data to be sent as the mediaType of the payload of the
Event to the configured flow. |
TestEventBuilder |
withOutboundAttachment(String key,
DataHandler value)
Deprecated.
Transport infrastructure is deprecated. Use
DefaultMultiPartPayload instead. |
TestEventBuilder |
withOutboundAttachment(String key,
Object object,
org.mule.runtime.api.metadata.MediaType contentType)
Deprecated.
Transport infrastructure is deprecated. Use
DefaultMultiPartPayload instead. |
TestEventBuilder |
withOutboundProperty(String key,
Serializable value)
Deprecated.
Transport infrastructure is deprecated. Use
Attributes instead. |
TestEventBuilder |
withPayload(Object payload)
Prepares the given data to be sent as the payload of the product.
|
TestEventBuilder |
withReplyToHandler(ReplyToHandler replyToHandler)
Deprecated.
TODO MULE-10739 Move ReplyToHandler to compatibility module.
|
TestEventBuilder |
withSessionProperty(String key,
Object value)
Deprecated.
Transport infrastructure is deprecated.
|
TestEventBuilder |
withSourceCorrelationId(String sourceCorrelationId)
Configures the product event to have the provided
sourceCorrelationId. |
TestEventBuilder |
withVariable(String key,
Object value)
Prepares a flow variable with the given key and value to be set in the product.
|
public TestEventBuilder withPayload(Object payload)
payload - the payload to use in the messageTestEventBuilderpublic TestEventBuilder withMediaType(org.mule.runtime.api.metadata.MediaType mediaType)
Event to the configured flow.mediaType - the mediaType to use in the messageFlowRunnerpublic TestEventBuilder withAttributes(org.mule.runtime.api.message.Attributes attributes)
Message.getAttributes() value of the produced messageattributes - the attributes object for the produced MessageTestEventBuilder@Deprecated public TestEventBuilder withInboundProperty(String key, Serializable value)
Attributes instead.key - the key of the inbound property to addvalue - the value of the inbound property to addTestEventBuilder@Deprecated public TestEventBuilder withInboundProperties(Map<String,Serializable> properties)
Attributes instead.properties - the inbound properties to addTestEventBuilder@Deprecated public TestEventBuilder withOutboundProperty(String key, Serializable value)
Attributes instead.key - the key of the outbound property to addvalue - the value of the outbound property to addTestEventBuilder@Deprecated public TestEventBuilder withOutboundAttachment(String key, DataHandler value)
DefaultMultiPartPayload instead.key - the key of the attachment to addvalue - the DataHandler for the attachment to addTestEventBuilder@Deprecated public TestEventBuilder withOutboundAttachment(String key, Object object, org.mule.runtime.api.metadata.MediaType contentType)
DefaultMultiPartPayload instead.key - the key of the attachment to addobject - the content of the attachment to addcontentType - the content type of the attachment to add. Note that the charset attribute can be specifed too i.e.
text/plain;charset=UTF-8TestEventBuilder@Deprecated public TestEventBuilder withInboundAttachment(String key, DataHandler value)
DefaultMultiPartPayload instead.key - the key of the attachment to addvalue - the DataHandler for the attachment to addTestEventBuilder@Deprecated public TestEventBuilder withSessionProperty(String key, Object value)
key - the key of the session property to addvalue - the value of the session property to addTestEventBuilderpublic TestEventBuilder withSourceCorrelationId(String sourceCorrelationId)
sourceCorrelationId. See Event.getCorrelationId().TestEventBuilderpublic TestEventBuilder withCorrelation(GroupCorrelation correlation)
correlation. See Event.getGroupCorrelation().TestEventBuilderpublic TestEventBuilder withVariable(String key, Object value)
key - the key of the flow variable to putvalue - the value of the flow variable to putTestEventBuilder@Deprecated public TestEventBuilder withReplyToHandler(ReplyToHandler replyToHandler)
ReplyToHandler.TestEventBuilderpublic TestEventBuilder spyObjects()
TestEventBuilderpublic Event build(MuleContext muleContext, FlowConstruct flow)
muleContext - the context of the mule applicationflow - the recipient for the event to be built.Copyright © 2003–2017 MuleSoft, Inc.. All rights reserved.