R
- the runner class for a FlowConstruct
implementation.public abstract class FlowConstructRunner<R extends FlowConstructRunner> extends Object implements Disposable
Modifier and Type | Field and Description |
---|---|
protected TestEventBuilder |
eventBuilder |
protected Registry |
registry |
PHASE_NAME
Constructor and Description |
---|
FlowConstructRunner(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()
A lifecycle method where implementor should free up any resources.
|
protected FlowConstruct |
getFlowConstruct() |
abstract String |
getFlowConstructName() |
protected CoreEvent |
getOrBuildEvent() |
void |
reset()
Clears the last built requestEvent, allowing for reuse of this runner.
|
R |
spyObjects()
|
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(ItemSequenceInfo itemSequenceInfo)
Configures the product event to have the provided
itemSequenceInfo . |
R |
withMediaType(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,
DataType dataType)
Prepares a flow variable with the given key and value to be set in the
Message to the configured flow. |
protected Registry registry
protected TestEventBuilder eventBuilder
public FlowConstructRunner(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 messageFlowRunner
public R withMediaType(MediaType mediaType)
CoreEvent
to the configured flow.mediaType
- the mediaType to use in the messageFlowRunner
public 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 addFlowRunner
public R withSourceCorrelationId(String sourceCorrelationId)
sourceCorrelationId
. See Event.getCorrelationId()
.TestEventBuilder
public R withCorrelation(GroupCorrelation correlation)
withItemSequenceInfo(ItemSequenceInfo)
correlation
. See CoreEvent.getGroupCorrelation()
.TestEventBuilder
public R withItemSequenceInfo(ItemSequenceInfo itemSequenceInfo)
itemSequenceInfo
. See Event.getItemSequenceInfo()
.TestEventBuilder
public 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 putFlowRunner
public R withVariable(String key, Object value, 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 typeFlowRunner
public R spyObjects()
FlowRunner
protected CoreEvent getOrBuildEvent()
public CoreEvent buildEvent()
protected FlowConstruct getFlowConstruct()
public void reset()
public abstract String getFlowConstructName()
FlowConstruct
to use.public void dispose()
Disposable
dispose
in interface Disposable
Copyright © 2018. All rights reserved.