use of org.mule.runtime.core.api.event.CoreEvent in project mule by mulesoft.
the class ExtendedExpressionLanguageAdapterTestCase method enrichObjectCompatibility.
@Test
@Description("Verifies that enrichment using an Object only works for MVEL.")
public void enrichObjectCompatibility() throws MuleException {
CoreEvent event = testEvent();
CoreEvent.Builder builder = builder(event);
String myPayload = "myPayload";
String expression = "payload";
expressionLanguageAdapter.enrich(melify(expression), event, builder, TEST_CONNECTOR_LOCATION, myPayload);
assertThat(builder.build().getMessage().getPayload().getValue(), is(myPayload));
expectedException.expect(UnsupportedOperationException.class);
expressionLanguageAdapter.enrich(expression, event, builder, TEST_CONNECTOR_LOCATION, myPayload);
}
use of org.mule.runtime.core.api.event.CoreEvent in project mule by mulesoft.
the class DefaultFlowTestCase method testProcessRequestResponseEndpoint.
@Test
public void testProcessRequestResponseEndpoint() throws Exception {
flow.initialise();
flow.start();
CoreEvent response = triggerFunction.apply(directInboundMessageSource.getListener(), testEvent());
assertSucessfulProcessing((PrivilegedEvent) response);
}
use of org.mule.runtime.core.api.event.CoreEvent in project mule by mulesoft.
the class DefaultFlowTestCase method restartWithBlockingProcessingStrategy.
@Test
public void restartWithBlockingProcessingStrategy() throws Exception {
after();
flow = (DefaultFlow) Flow.builder(FLOW_NAME, muleContext).source(flow.getSource()).processors(flow.getProcessors()).processingStrategyFactory(new BlockingProcessingStrategyFactory()).build();
flow.initialise();
flow.start();
flow.stop();
flow.start();
CoreEvent response = triggerFunction.apply(directInboundMessageSource.getListener(), testEvent());
assertThat(response, not(nullValue()));
}
use of org.mule.runtime.core.api.event.CoreEvent in project mule by mulesoft.
the class MessageProcessingFlowTraceManagerTestCase method newComponentCall.
@Test
public void newComponentCall() {
CoreEvent event = buildEvent("newComponentCall");
PipelineMessageNotification pipelineNotification = buildPipelineNotification(event, rootFlowConstruct.getName());
assertThat(getContextInfo(event, rootFlowConstruct), is(""));
manager.onPipelineNotificationStart(pipelineNotification);
assertThat(getContextInfo(event, rootFlowConstruct), is("at " + ROOT_FLOW_NAME));
manager.onMessageProcessorNotificationPreInvoke(buildProcessorNotification(event, createMockProcessor("/comp", false)));
assertThat(getContextInfo(event, rootFlowConstruct), is("at " + ROOT_FLOW_NAME + "(/comp @ " + APP_ID + ":unknown:-1)"));
manager.onPipelineNotificationComplete(pipelineNotification);
assertThat(getContextInfo(event, rootFlowConstruct), is(""));
}
use of org.mule.runtime.core.api.event.CoreEvent in project mule by mulesoft.
the class MessageProcessingFlowTraceManagerTestCase method newFlowInvocation.
@Test
public void newFlowInvocation() {
CoreEvent event = buildEvent("newFlowInvocation");
PipelineMessageNotification pipelineNotification = buildPipelineNotification(event, rootFlowConstruct.getName());
assertThat(getContextInfo(event, rootFlowConstruct), is(""));
manager.onPipelineNotificationStart(pipelineNotification);
assertThat(getContextInfo(event, rootFlowConstruct), is("at " + rootFlowConstruct.getName()));
manager.onPipelineNotificationComplete(pipelineNotification);
assertThat(getContextInfo(event, rootFlowConstruct), is(""));
}
Aggregations