R - the runner class for a FlowConstruct implementation.public abstract class FlowConstructRunner<R extends FlowConstructRunner> extends Object implements org.mule.runtime.api.lifecycle.Disposable
| Modifier and Type | Field and Description |
|---|---|
protected TestEventBuilder |
eventBuilder |
protected org.mule.runtime.api.artifact.Registry |
registry |
| Constructor and Description |
|---|
FlowConstructRunner(org.mule.runtime.api.artifact.Registry registry)
Initializes this runner with a mule context.
|
| Modifier and Type | Method and Description |
|---|---|
CoreEvent |
buildEvent()
Builds a new event based on this runner's config.
|
void |
dispose() |
protected FlowConstruct |
getFlowConstruct() |
abstract String |
getFlowConstructName() |
protected CoreEvent |
getOrBuildEvent() |
void |
reset()
Clears the last built requestEvent, allowing for reuse of this runner.
|
R |
spyObjects()
Will spy the built
Message and CoreEvent. |
R |
withAttributes(Object attributes)
Prepares the given data to be sent as the attributes of the
CoreEvent to the configured flow. |
R |
withCorrelation(GroupCorrelation correlation)
Deprecated.
|
R |
withInboundAttachment(String key,
DataHandler value)
Deprecated.
Transport infrastructure is deprecated.
|
R |
withInboundProperties(Map<String,Serializable> properties)
Deprecated.
Transport infrastructure is deprecated. Use
Message.getAttributes() instead. |
R |
withInboundProperty(String key,
Serializable value)
Deprecated.
Transport infrastructure is deprecated. Use
Message.getAttributes() instead. |
R |
withItemSequenceInfo(org.mule.runtime.api.message.ItemSequenceInfo itemSequenceInfo)
Configures the product event to have the provided
itemSequenceInfo. |
R |
withMediaType(org.mule.runtime.api.metadata.MediaType mediaType)
Prepares the given data to be sent as the mediaType of the payload of the
CoreEvent to the configured flow. |
R |
withOutboundProperty(String key,
Serializable value)
Deprecated.
Transport infrastructure is deprecated. Use
Message.getAttributes() instead. |
R |
withPayload(Object payload)
Prepares the given data to be sent as the payload of the
CoreEvent to the configured flow. |
R |
withSessionProperty(String key,
Object value)
Deprecated.
Transport infrastructure is deprecated.
|
R |
withSourceCorrelationId(String sourceCorrelationId)
Configures the product event to have the provided
sourceCorrelationId. |
R |
withVariable(String key,
Object value)
Prepares a flow variable with the given key and value to be set in the
Message to the configured flow. |
R |
withVariable(String key,
Object value,
org.mule.runtime.api.metadata.DataType dataType)
Prepares a flow variable with the given key and value to be set in the
Message to the configured flow. |
protected org.mule.runtime.api.artifact.Registry registry
protected TestEventBuilder eventBuilder
public FlowConstructRunner(org.mule.runtime.api.artifact.Registry registry)
registry - the registry for the currently running testpublic R withPayload(Object payload)
CoreEvent to the configured flow.payload - the payload to use in the messageFlowRunnerpublic R withMediaType(org.mule.runtime.api.metadata.MediaType mediaType)
CoreEvent to the configured flow.mediaType - the mediaType to use in the messageFlowRunnerpublic R withAttributes(Object attributes)
CoreEvent to the configured flow.attributes - the message attributesFlowRunner@Deprecated public R withInboundProperty(String key, Serializable value)
Message.getAttributes() instead.Message to the configured
flow.key - the key of the inbound property to addvalue - the value of the inbound property to addFlowRunner@Deprecated public R withInboundProperties(Map<String,Serializable> properties)
Message.getAttributes() instead.Message to the configured flow.properties - the inbound properties to addFlowRunner@Deprecated public R withOutboundProperty(String key, Serializable value)
Message.getAttributes() instead.Message to the configured
flow.key - the key of the outbound property to addvalue - the value of the outbound property to addFlowRunner@Deprecated public R withInboundAttachment(String key, DataHandler value)
Message to the configured flow.key - the key of the attachment to addvalue - the DataHandler for the attachment to addFlowRunner@Deprecated public R withSessionProperty(String key, Object value)
Message to the configured
flow.key - the key of the session property to addvalue - the value of the session property to addFlowRunnerpublic R withSourceCorrelationId(String sourceCorrelationId)
sourceCorrelationId. See Event.getCorrelationId().TestEventBuilderpublic R withCorrelation(GroupCorrelation correlation)
withItemSequenceInfo(ItemSequenceInfo)correlation. See CoreEvent.getGroupCorrelation().TestEventBuilderpublic R withItemSequenceInfo(org.mule.runtime.api.message.ItemSequenceInfo itemSequenceInfo)
itemSequenceInfo. See Event.getItemSequenceInfo().TestEventBuilderpublic R withVariable(String key, Object value)
Message to the configured flow.key - the key of the flow variable to putvalue - the value of the flow variable to putFlowRunnerpublic R withVariable(String key, Object value, org.mule.runtime.api.metadata.DataType dataType)
Message to the configured flow.key - the key of the flow variable to putvalue - the value of the flow variable to putdataType - the value data typeFlowRunnerpublic R spyObjects()
FlowRunnerprotected CoreEvent getOrBuildEvent()
public CoreEvent buildEvent()
protected FlowConstruct getFlowConstruct()
public void reset()
public abstract String getFlowConstructName()
FlowConstruct to use.public void dispose()
dispose in interface org.mule.runtime.api.lifecycle.DisposableCopyright © 2003–2018 MuleSoft, Inc.. All rights reserved.