use of org.mule.runtime.core.privileged.processor.AnnotatedProcessor in project mule by mulesoft.
the class MessagingExceptionTestCase method withAnnotatedFailingProcessorNoPathResolver.
@Test
public void withAnnotatedFailingProcessorNoPathResolver() {
AnnotatedProcessor mockProcessor = mock(AnnotatedProcessor.class);
when(mockProcessor.getAnnotation(eq(docNameAttrName))).thenReturn("Mock Component");
configureProcessorLocation(mockProcessor);
MessagingException exception = new MessagingException(createStaticMessage(""), testEvent, mockProcessor);
exception.getInfo().putAll(locationProvider.getContextInfo(createInfo(testEvent, exception, mockProcessor), mockProcessor));
assertThat(exception.getInfo().get(INFO_LOCATION_KEY).toString(), is("Mock@1 @ MessagingExceptionTestCase:muleApp.xml:10 (Mock Component)"));
}
use of org.mule.runtime.core.privileged.processor.AnnotatedProcessor in project mule by mulesoft.
the class MessagingExceptionTestCase method withAnnotatedFailingProcessorNotPathResolver.
@Test
public void withAnnotatedFailingProcessorNotPathResolver() {
AnnotatedProcessor mockProcessor = mock(AnnotatedProcessor.class);
when(mockProcessor.getAnnotation(eq(docNameAttrName))).thenReturn("Mock Component");
configureProcessorLocation(mockProcessor);
MessagingException exception = new MessagingException(createStaticMessage(""), testEvent, mockProcessor);
exception.getInfo().putAll(locationProvider.getContextInfo(createInfo(testEvent, exception, mockProcessor), mockProcessor));
assertThat(exception.getInfo().get(INFO_LOCATION_KEY).toString(), is("Mock@1 @ MessagingExceptionTestCase:muleApp.xml:10 (Mock Component)"));
}
use of org.mule.runtime.core.privileged.processor.AnnotatedProcessor in project mule by mulesoft.
the class MessagingExceptionTestCase method withAnnotatedFailingProcessorPathResolver.
@Test
public void withAnnotatedFailingProcessorPathResolver() {
AnnotatedProcessor mockProcessor = mock(AnnotatedProcessor.class);
when(mockProcessor.getAnnotation(eq(docNameAttrName))).thenReturn("Mock Component");
configureProcessorLocation(mockProcessor);
when(mockComponentLocation.getLocation()).thenReturn("flow/processor");
MessagingException exception = new MessagingException(createStaticMessage(""), testEvent, mockProcessor);
exception.getInfo().putAll(locationProvider.getContextInfo(createInfo(testEvent, exception, mockProcessor), mockProcessor));
assertThat(exception.getInfo().get(INFO_LOCATION_KEY).toString(), is("flow/processor @ MessagingExceptionTestCase:muleApp.xml:10 (Mock Component)"));
}
use of org.mule.runtime.core.privileged.processor.AnnotatedProcessor in project mule by mulesoft.
the class MessagingExceptionTestCase method withFailingProcessorNotPathResolver.
@Test
public void withFailingProcessorNotPathResolver() {
AnnotatedProcessor mockProcessor = mock(AnnotatedProcessor.class);
when(mockProcessor.getLocation()).thenReturn(fromSingleComponent("Mock@1"));
when(mockProcessor.toString()).thenReturn("Mock@1");
MessagingException exception = new MessagingException(createStaticMessage(""), testEvent, mockProcessor);
exception.getInfo().putAll(locationProvider.getContextInfo(createInfo(testEvent, exception, mockProcessor), mockProcessor));
assertThat(exception.getInfo().get(INFO_LOCATION_KEY).toString(), is("Mock@1 @ MessagingExceptionTestCase:unknown:-1"));
}
use of org.mule.runtime.core.privileged.processor.AnnotatedProcessor in project mule by mulesoft.
the class MessagingExceptionTestCase method withFailingProcessorPathResolver.
@Test
public void withFailingProcessorPathResolver() {
AnnotatedProcessor mockProcessor = mock(AnnotatedProcessor.class);
configureProcessorLocation(mockProcessor);
when(mockComponentLocation.getLocation()).thenReturn("flow/processor");
MessagingException exception = new MessagingException(createStaticMessage(""), testEvent, mockProcessor);
exception.getInfo().putAll(locationProvider.getContextInfo(createInfo(testEvent, exception, mockProcessor), mockProcessor));
assertThat(exception.getInfo().get(INFO_LOCATION_KEY).toString(), is("flow/processor @ MessagingExceptionTestCase:muleApp.xml:10"));
}
Aggregations