use of org.mule.runtime.core.api.construct.Flow in project mule by mulesoft.
the class ParameterInjectionSourceTestCase method injectMapParameters.
@Test
public void injectMapParameters() throws Exception {
Flow flow = (Flow) getFlowConstruct("source");
flow.start();
probe(TIMEOUT_MILLIS, POLL_DELAY_MILLIS, () -> HeisenbergSource.receivedDebtProperties != null && HeisenbergSource.receivedDebtProperties.containsKey("maxDebt") && HeisenbergSource.receivedUsableWeapons != null && HeisenbergSource.receivedUsableWeapons.containsKey("Ricin"));
}
use of org.mule.runtime.core.api.construct.Flow in project mule by mulesoft.
the class FunctionalTestCase method stopFlowConstruct.
protected void stopFlowConstruct(String flowName) throws Exception {
FlowConstruct flowConstruct = getFlowConstruct(flowName);
Flow flow = (Flow) flowConstruct;
flow.stop();
}
use of org.mule.runtime.core.api.construct.Flow in project mule by mulesoft.
the class FlowRunner method dispatch.
/**
* Dispatches to the specified flow with the provided event and configuration, and performs a {@link FlowAssert#verify(String))}
* afterwards.
* <p>
* If this is called multiple times, the <b>same</b> event will be sent. To force the creation of a new event, use
* {@link #reset()}.
* <p>
* Dispatch behaves differently to {@link FlowRunner#run()} in that it does not propagate any exceptions to the test case or
* return a result.
*/
public void dispatch() throws Exception {
Flow flow = (Flow) getFlowConstruct();
try {
txExecutionTemplate.execute(getFlowDispatchCallback(flow));
} catch (Exception e) {
// Ignore
}
FlowAssert.verify(flowName);
}
use of org.mule.runtime.core.api.construct.Flow in project mule by mulesoft.
the class FlowRunner method dispatchAsync.
/**
* Dispatches to the specified flow with the provided event and configuration in a new IO thread, and performs a
* {@link FlowAssert#verify(String))} afterwards.
* <p>
* If this is called multiple times, the <b>same</b> event will be sent. To force the creation of a new event, use
* {@link #reset()}.
* <p>
* Dispatch behaves differently to {@link FlowRunner#run()} in that it does not propagate any exceptions to the test case or
* return a result.
*/
public void dispatchAsync(Scheduler scheduler) throws Exception {
this.scheduler = scheduler;
Flow flow = (Flow) getFlowConstruct();
try {
scheduler.submit(() -> txExecutionTemplate.execute(getFlowDispatchCallback(flow)));
} catch (Exception e) {
// Ignore
}
FlowAssert.verify(flowName);
}
use of org.mule.runtime.core.api.construct.Flow in project mule by mulesoft.
the class TypedValueParameterOperationExecutionTestCase method typedValueForStringOnSourceOnSuccess.
@Test
public void typedValueForStringOnSourceOnSuccess() throws Exception {
Flow flow = (Flow) getFlowConstruct("typedValueForStringOnSourceOnSuccess");
flow.start();
new PollingProber(100000, 100).check(new JUnitLambdaProbe(() -> TypedValueSource.onSuccessValue != null));
assertTypedValue(TypedValueSource.onSuccessValue, STRING_VALUE, WILDCARD, null);
}
Aggregations