@Test
 public void testFlowRefHandlingException() throws Exception {
   LocalMuleClient client = muleContext.getClient();
   MuleMessage response =
       client.send("vm://inEnricherExceptionFlow", new DefaultMuleMessage("payload", muleContext));
   assertThat(ErrorProcessor.handled, not(nullValue()));
   assertThat(response.getExceptionPayload(), nullValue());
 }
  @Test
  public void testIssue() throws Exception {
    LocalMuleClient client = muleContext.getClient();
    client.dispatch(VM_TEST_INPUT, TEST_MESSAGE, null);
    client.dispatch(VM_TEST_INPUT, TEST_MESSAGE, null);

    assertOnlyOneThreadWaiting(messages, latch);
  }
  @Test
  public void mapsToHelloWorldException() throws Exception {
    LocalMuleClient client = muleContext.getClient();

    MuleMessage result =
        client.send(
            "http://localhost:" + port.getNumber() + "/helloworld/throwException",
            getTestMuleMessage(),
            getHttpOptions());

    assertEquals(
        (Integer) HttpConstants.SC_SERVICE_UNAVAILABLE,
        result.getInboundProperty(HttpConnector.HTTP_STATUS_PROPERTY, 0));
  }