View Javadoc
1   /*
2    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
3    * The software in this package is published under the terms of the CPAL v1.0
4    * license, a copy of which has been included with this distribution in the
5    * LICENSE.txt file.
6    */
7   package org.mule.test.integration.exceptions;
8   
9   import org.mule.DefaultMuleMessage;
10  import org.mule.api.MuleMessage;
11  import org.mule.module.client.MuleClient;
12  import org.mule.tck.junit4.FunctionalTestCase;
13  import org.mule.tck.junit4.rule.DynamicPort;
14  
15  import java.util.Map;
16  
17  import org.junit.Rule;
18  import org.junit.Test;
19  
20  import static org.junit.Assert.assertNotNull;
21  
22  public class AsyncExceptionHandlingTestCase extends FunctionalTestCase
23  {
24  
25      @Rule
26      public DynamicPort port1 = new DynamicPort("port1");
27      @Rule
28      public DynamicPort port2 = new DynamicPort("port2");
29  
30      @Override
31      protected String getConfigResources()
32      {
33          return "org/mule/test/integration/exceptions/async-exception-handling.xml";
34      }
35  
36      @Test
37      public void testAsyncExceptionHandlingTestCase() throws Exception
38      {
39          MuleClient client1 = new MuleClient(muleContext);
40          DefaultMuleMessage msg1 = new DefaultMuleMessage("Hello World", (Map) null, muleContext);
41          MuleMessage response1 = client1.send("search.inbound.endpoint", msg1, 300000);
42          assertNotNull(response1);
43      }
44  
45  }