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.transport.jms.integration;
8   
9   import org.mule.api.MuleException;
10  import org.mule.api.MuleMessage;
11  import org.mule.module.client.MuleClient;
12  
13  import java.util.HashMap;
14  import java.util.Map;
15  
16  import org.junit.Test;
17  
18  import static org.junit.Assert.assertEquals;
19  
20  public class JmsCustomCorrelationIdTestCase extends AbstractJmsFunctionalTestCase
21  {
22  
23      @Override
24      protected String getConfigResources()
25      {
26          return "integration/jms-custom-correlation.xml";
27      }
28  
29      @Test
30      public void testExplicitReplyToAsyncSet() throws MuleException
31      {
32          MuleClient muleClient = new MuleClient(muleContext);
33          Map props = new HashMap();
34          props.put("customCorrelation", "abcdefghij");
35          MuleMessage response = muleClient.send("vm://in4", TEST_MESSAGE, props);
36          // We get the original message back, not the result from the remote component
37          assertEquals(TEST_MESSAGE + " TestService1", response.getPayload());
38  
39      }
40  }