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.module.scripting;
8   
9   import org.mule.api.MuleMessage;
10  import org.mule.module.client.MuleClient;
11  import org.mule.tck.junit4.FunctionalTestCase;
12  
13  import org.junit.Test;
14  
15  import static org.junit.Assert.assertEquals;
16  import static org.junit.Assert.assertNotNull;
17  
18  
19  public class GroovyBindingFunctionalTestCase extends FunctionalTestCase
20  {
21  
22      @Override
23      protected String getConfigResources()
24      {
25          return "groovy-binding-config.xml";
26      }
27  
28      @Test
29      public void testBindingCallout() throws Exception
30      {
31          MuleClient client = new MuleClient(muleContext);
32          client.dispatch("client_request", "Important Message", null);
33          MuleMessage response = client.request("client_response", 2000);
34          assertNotNull(response);
35          assertEquals("Important Message Received by Callout1 Received by Callout2", response.getPayloadAsString());
36      }
37  
38  }