public class FlowRunner extends FlowConstructRunner<FlowRunner>
eventBuilder, muleContext| Constructor and Description |
|---|
FlowRunner(MuleContext muleContext,
String flowName)
Initializes this flow runner.
|
| Modifier and Type | Method and Description |
|---|---|
void |
dispatch()
Dispatchs to the specified flow with the provided event and configuration, and performs a
FlowAssert#verify(String))
afterwards. |
void |
dispatchAsync()
Dispatchs to the specified flow with the provided event and configuration in a new IO thread, and performs a
FlowAssert#verify(String)) afterwards. |
String |
getFlowConstructName() |
FlowRunner |
nonBlocking()
Configures this runner's flow to be run non-blocking.
|
Event |
run()
Runs the specified flow with the provided event and configuration, and performs a
FlowAssert#verify(String))
afterwards. |
Event |
runAndVerify(String... flowNamesToVerify)
Runs the specified flow with the provided event and configuration, and performs a
FlowAssert#verify(String)) for each
flowNamesToVerify afterwards. |
MessagingException |
runExpectingException()
Runs the specified flow with the provided event and configuration expecting a failure.
|
Event |
runNoVerify()
Runs the specified flow with the provided event and configuration.
|
FlowRunner |
transactionally(TransactionConfigEnum action,
TransactionFactory factory)
Configures the flow to run inside a transaction.
|
buildEvent, getFlowConstruct, getOrBuildEvent, reset, spyObjects, withAttributes, withCorrelation, withExchangePattern, withInboundAttachment, withInboundProperties, withInboundProperty, withMediaType, withOutboundAttachment, withOutboundAttachment, withOutboundProperty, withPayload, withSessionProperty, withSourceCorrelationId, withVariablepublic FlowRunner(MuleContext muleContext, String flowName)
muleContext - the context of the mule applicationflowName - the name of the flow to run events throughpublic FlowRunner transactionally(TransactionConfigEnum action, TransactionFactory factory)
action - The action to do at the start of the transactional block. See TransactionConfig constants.factory - See MuleTransactionConfig.setFactory(TransactionFactory).FlowRunnerpublic FlowRunner nonBlocking()
FlowRunnerpublic Event run() throws Exception
FlowAssert#verify(String))
afterwards.
If this is called multiple times, the same event will be sent. To force the creation of a new event, use
FlowConstructRunner.reset().MuleEventExceptionpublic Event runNoVerify() throws Exception
FlowConstructRunner.reset().MuleEventExceptionpublic Event runAndVerify(String... flowNamesToVerify) throws Exception
FlowAssert#verify(String)) for each
flowNamesToVerify afterwards.
If this is called multiple times, the same event will be sent. To force the creation of a new event, use
FlowConstructRunner.reset().flowNamesToVerify - the names of the flows to FlowAssert#verify(String)) afterwards.MuleEventExceptionpublic void dispatch()
throws Exception
FlowAssert#verify(String))
afterwards.
If this is called multiple times, the same event will be sent. To force the creation of a new event, use
FlowConstructRunner.reset().
Dispatch behaves differently to run() in that it does not propagate any exceptions to the test case or
return a result.Exceptionpublic void dispatchAsync()
throws Exception
FlowAssert#verify(String)) afterwards.
If this is called multiple times, the same event will be sent. To force the creation of a new event, use
FlowConstructRunner.reset().
Dispatch behaves differently to run() in that it does not propagate any exceptions to the test case or
return a result.Exceptionpublic MessagingException runExpectingException() throws Exception
Exceptionpublic String getFlowConstructName()
getFlowConstructName in class FlowConstructRunner<FlowRunner>FlowConstruct to use.Copyright © 2003–2016 MuleSoft, Inc.. All rights reserved.