Search in sources :

Example 1 with MuleFatalException

use of org.mule.runtime.api.exception.MuleFatalException in project mule by mulesoft.

the class MessagingExceptionResolverTestCase method resolveTopExceptionWithSameError.

@Test
public void resolveTopExceptionWithSameError() {
    Optional<Error> surfaceError = mockError(TRANSFORMER, TRANSFORMER_EXCEPTION);
    when(event.getError()).thenReturn(surfaceError);
    Exception cause = new MuleFatalException(createStaticMessage(EXPECTED_MESSAGE), new LinkageError("!"));
    MessagingException me = newMessagingException(cause, event, processor);
    MessagingException resolved = resolver.resolve(me, context);
    assertExceptionErrorType(resolved, FATAL);
    assertExceptionMessage(resolved.getMessage(), EXPECTED_MESSAGE);
}
Also used : MuleFatalException(org.mule.runtime.api.exception.MuleFatalException) MessagingException(org.mule.runtime.core.internal.exception.MessagingException) Error(org.mule.runtime.api.message.Error) MuleFatalException(org.mule.runtime.api.exception.MuleFatalException) MuleException(org.mule.runtime.api.exception.MuleException) MessagingException(org.mule.runtime.core.internal.exception.MessagingException) TransformerException(org.mule.runtime.core.api.transformer.TransformerException) ConnectionException(org.mule.runtime.api.connection.ConnectionException) SmallTest(org.mule.tck.size.SmallTest) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 ConnectionException (org.mule.runtime.api.connection.ConnectionException)1 MuleException (org.mule.runtime.api.exception.MuleException)1 MuleFatalException (org.mule.runtime.api.exception.MuleFatalException)1 Error (org.mule.runtime.api.message.Error)1 TransformerException (org.mule.runtime.core.api.transformer.TransformerException)1 MessagingException (org.mule.runtime.core.internal.exception.MessagingException)1 SmallTest (org.mule.tck.size.SmallTest)1