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.routing.replyto;
8   
9   import org.mule.api.MuleMessage;
10  import org.mule.api.config.MuleProperties;
11  import org.mule.module.client.MuleClient;
12  import org.mule.tck.junit4.FunctionalTestCase;
13  
14  import java.util.HashMap;
15  import java.util.Map;
16  
17  import org.junit.Test;
18  
19  import static org.junit.Assert.assertEquals;
20  import static org.junit.Assert.assertNotNull;
21  
22  public class ReplyToChainIntegration1TestCase extends FunctionalTestCase
23  {
24  
25      @Override
26      protected String getConfigResources()
27      {
28          return "org/mule/test/integration/routing/replyto/replyto-chain-integration-test-1.xml";
29      }
30  
31      @Test
32      public void testReplyToChain() throws Exception
33      {
34          String message = "test";
35  
36          MuleClient client = new MuleClient(muleContext);
37          Map props = new HashMap();
38          props.put(MuleProperties.MULE_REMOTE_SYNC_PROPERTY, "false");
39          MuleMessage result = client.send("vm://pojo1", message, props);
40          assertNotNull(result);
41          assertEquals("Received: " + message, result.getPayloadAsString());
42      }
43      
44      @Test
45      public void testReplyToChainWithoutProps() throws Exception
46      {
47          String message = "test";
48  
49          MuleClient client = new MuleClient(muleContext);
50          MuleMessage result = client.send("vm://pojo1", message, null);
51          assertNotNull(result);
52          assertEquals("Received: " + message, result.getPayloadAsString());
53      }
54  
55  }