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.routing;
8   
9   import org.mule.api.FutureMessageResult;
10  import org.mule.api.MuleMessage;
11  import org.mule.module.client.MuleClient;
12  import org.mule.tck.junit4.FunctionalTestCase;
13  
14  import org.junit.Test;
15  
16  import static org.junit.Assert.assertEquals;
17  import static org.junit.Assert.assertNotNull;
18  
19  // MULE-5162
20  // FIXME: refactor since it's a copy of DynamicEndpointRoutingTestCase with a jms outbound endpoint 
21  public class DynamicJmsEndpointRoutingTestCase  extends FunctionalTestCase
22  {
23  
24      @Override
25      protected String getConfigResources()
26      {
27          return "dynamic-endpoint-routing-test.xml";
28      }
29  
30      @Test
31      public void testDynamicEndpoint() throws Exception
32      {
33          MuleClient client = new MuleClient(muleContext);
34          FutureMessageResult result = client.sendAsync("vm://inBound", "Hello,world", null, 5000);
35          MuleMessage response = result.getMessage(5000);
36          assertNotNull(response);
37          assertNotNull(response.getPayload());
38          assertEquals("step2Service", response.getPayloadAsString());
39      }
40  }