1
2
3
4
5
6
7
8
9
10
11 package org.mule.transport.jms.integration;
12
13 import org.mule.api.MuleMessage;
14 import org.mule.module.client.MuleClient;
15
16 import java.util.HashMap;
17 import java.util.Map;
18
19 import org.junit.Test;
20
21 import static org.junit.Assert.assertEquals;
22 import static org.junit.Assert.assertNotNull;
23 import static org.junit.Assert.assertTrue;
24
25 public class JmsReplyToPropertyTestCase extends AbstractJmsFunctionalTestCase
26 {
27
28 @Override
29 protected String getConfigResources()
30 {
31 return "integration/jms-replyto-property.xml";
32 }
33
34 @Test
35 public void testReplyTo() throws Exception
36 {
37 MuleClient client = new MuleClient(muleContext);
38 Map<String, String> props = new HashMap<String, String>();
39 props.put("JMSReplyTo", "middle");
40 client.dispatch("in", DEFAULT_INPUT_MESSAGE, props);
41
42
43 MuleMessage output = client.request("out", 2000);
44 assertNotNull(output);
45 final Object o = output.getOutboundProperty("JMSReplyTo");
46 assertTrue(o.toString().contains("middle"));
47
48
49 output = client.request("middle", 2000);
50 assertNotNull(output);
51 assertEquals(DEFAULT_OUTPUT_MESSAGE, output.getPayload());
52 }
53 }