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.servlet.jetty;
8   
9   import org.mule.api.MuleMessage;
10  import org.mule.api.client.LocalMuleClient;
11  import org.mule.transport.http.HttpConstants;
12  import org.mule.transport.http.functional.HttpFunctionalTestCase;
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  
21  public class JettyHttpFunctionalTestCase extends HttpFunctionalTestCase
22  {
23  
24      @Override
25      protected String getConfigResources()
26      {
27          return "jetty-http-functional-test.xml";
28      }
29  
30      @Test
31      public void testNonRootUrls() throws Exception
32      {
33          LocalMuleClient client = muleContext.getClient();
34          Map props = new HashMap();
35          props.put(HttpConstants.HEADER_CONTENT_TYPE, "text/plain;charset=UTF-8");
36          MuleMessage result = client.send("anotherClientEndpoint", TEST_MESSAGE, props);
37          assertEquals(TEST_MESSAGE + " Received", result.getPayloadAsString());
38      }
39  
40  }