1
2
3
4
5
6
7
8
9
10
11 package org.mule.transport.http;
12
13 import org.mule.tck.DynamicPortTestCase;
14
15 import org.apache.commons.httpclient.HttpClient;
16 import org.apache.commons.httpclient.methods.GetMethod;
17
18 public class HttpsFlowTestCase extends DynamicPortTestCase
19 {
20 @Override
21 protected String getConfigResources()
22 {
23 return "https-flow-config.xml";
24 }
25
26 @Override
27 protected int getNumPortsToFind()
28 {
29 return 1;
30 }
31
32 public void testSecureFlow() throws Exception
33 {
34 String url = String.format("https://localhost:%1d/?message=Hello", getPorts().get(0));
35
36 GetMethod method = new GetMethod(url);
37 HttpClient client = new HttpClient();
38
39 int responseCode = client.executeMethod(method);
40 assertEquals(HttpConstants.SC_OK, responseCode);
41
42 String result = method.getResponseBodyAsString();
43 assertEquals("/?message=Hello received", result);
44 }
45 }
46
47