1
2
3
4
5
6
7
8
9
10
11 package org.mule.transport.ssl.issues;
12
13 import org.mule.api.MuleMessage;
14 import org.mule.module.client.MuleClient;
15 import org.mule.tck.junit4.FunctionalTestCase;
16 import org.mule.tck.junit4.rule.DynamicPort;
17
18 import org.junit.Rule;
19 import org.junit.Test;
20
21 import static org.junit.Assert.assertEquals;
22 import static org.junit.Assert.assertNotNull;
23
24 public class AsynchronousSslMule1854TestCase extends FunctionalTestCase
25 {
26
27 @Rule
28 public DynamicPort dynamicPort1 = new DynamicPort("port1");
29
30 @Rule
31 public DynamicPort dynamicPort2 = new DynamicPort("port2");
32
33 @Rule
34 public DynamicPort dynamicPort3 = new DynamicPort("port3");
35
36 @Override
37 protected String getConfigResources()
38 {
39 return "ssl-functional-test.xml";
40 }
41
42 @Test
43 public void testAsynchronous() throws Exception
44 {
45 MuleClient client = new MuleClient(muleContext);
46 client.dispatch("asyncEndpoint", TEST_MESSAGE, null);
47
48 Thread.sleep(100);
49 MuleMessage response = client.request("asyncEndpoint", 5000);
50 assertNotNull("Response is null", response);
51 assertEquals(TEST_MESSAGE + " Received Async", response.getPayloadAsString());
52 }
53
54 }