use of org.mule.runtime.api.notification.PipelineMessageNotification in project mule by mulesoft.
the class MessageProcessingFlowTraceManagerTestCase method buildPipelineNotification.
protected PipelineMessageNotification buildPipelineNotification(CoreEvent event, String name) {
Pipeline flowConstruct = mock(Pipeline.class, withSettings().extraInterfaces(Component.class));
when(flowConstruct.getName()).thenReturn(name);
return new PipelineMessageNotification(createInfo(event, null, flowConstruct), flowConstruct.getName(), PROCESS_START);
}
use of org.mule.runtime.api.notification.PipelineMessageNotification 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.api.notification.PipelineMessageNotification 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(""));
}
use of org.mule.runtime.api.notification.PipelineMessageNotification in project mule by mulesoft.
the class MessageProcessingFlowTraceManagerTestCase method newAnnotatedComponentCall.
@Test
public void newAnnotatedComponentCall() {
CoreEvent event = buildEvent("newAnnotatedComponentCall");
PipelineMessageNotification pipelineNotification = buildPipelineNotification(event, rootFlowConstruct.getName());
assertThat(getContextInfo(event, rootFlowConstruct), is(""));
manager.onPipelineNotificationStart(pipelineNotification);
assertThat(getContextInfo(event, rootFlowConstruct), is("at " + rootFlowConstruct.getName()));
Component annotatedMessageProcessor = (Component) createMockProcessor("/comp", true);
when(annotatedMessageProcessor.getAnnotation(docNameAttrName)).thenReturn("annotatedName");
manager.onMessageProcessorNotificationPreInvoke(buildProcessorNotification(event, (Processor) annotatedMessageProcessor));
assertThat(getContextInfo(event, rootFlowConstruct), is("at " + rootFlowConstruct.getName() + "(/comp @ " + APP_ID + ":muleApp.xml:10 (annotatedName))"));
manager.onPipelineNotificationComplete(pipelineNotification);
assertThat(getContextInfo(event, rootFlowConstruct), is(""));
}
use of org.mule.runtime.api.notification.PipelineMessageNotification in project mule by mulesoft.
the class MessageProcessingFlowTraceManagerTestCase method mixedEvents.
@Test
public void mixedEvents() {
CoreEvent event1 = buildEvent("mixedEvents_1");
CoreEvent event2 = buildEvent("mixedEvents_2");
PipelineMessageNotification pipelineNotification1 = buildPipelineNotification(event1, rootFlowConstruct.getName());
PipelineMessageNotification pipelineNotification2 = buildPipelineNotification(event2, rootFlowConstruct.getName());
assertThat(getContextInfo(event1, rootFlowConstruct), is(""));
assertThat(getContextInfo(event2, rootFlowConstruct), is(""));
manager.onPipelineNotificationStart(pipelineNotification1);
assertThat(getContextInfo(event1, rootFlowConstruct), is("at " + rootFlowConstruct.getName()));
assertThat(getContextInfo(event2, rootFlowConstruct), is(""));
manager.onPipelineNotificationStart(pipelineNotification2);
assertThat(getContextInfo(event1, rootFlowConstruct), is("at " + rootFlowConstruct.getName()));
assertThat(getContextInfo(event2, rootFlowConstruct), is("at " + rootFlowConstruct.getName()));
manager.onPipelineNotificationComplete(pipelineNotification1);
assertThat(getContextInfo(event1, rootFlowConstruct), is(""));
assertThat(getContextInfo(event2, rootFlowConstruct), is("at " + rootFlowConstruct.getName()));
manager.onPipelineNotificationComplete(pipelineNotification2);
assertThat(getContextInfo(event1, rootFlowConstruct), is(""));
assertThat(getContextInfo(event2, rootFlowConstruct), is(""));
}
Aggregations