1
2
3
4
5
6
7
8
9
10
11 package org.mule.transport.http.functional;
12
13 import org.mule.api.MuleMessage;
14 import org.mule.module.client.MuleClient;
15 import org.mule.tck.DynamicPortTestCase;
16 import org.mule.tck.FunctionalTestCase;
17 import org.mule.transport.http.HttpConstants;
18
19 public class HttpHeadersTestCase extends DynamicPortTestCase
20 {
21
22 @Override
23 protected String getConfigResources()
24 {
25 return "http-headers-config.xml";
26 }
27
28 public void testJettyHeaders() throws Exception
29 {
30 MuleClient client = new MuleClient(muleContext);
31 MuleMessage result = client.send("clientEndpoint", null, null);
32
33 String contentTypeProperty = result.getInboundProperty(HttpConstants.HEADER_CONTENT_TYPE);
34 assertNotNull(contentTypeProperty);
35 assertEquals("application/x-download", contentTypeProperty);
36
37 String contentDispositionProperty = result.getInboundProperty(HttpConstants.HEADER_CONTENT_DISPOSITION);
38 assertNotNull(contentDispositionProperty);
39 assertEquals("attachment; filename=foo.zip", contentDispositionProperty);
40 }
41
42 @Override
43 protected int getNumPortsToFind()
44 {
45 return 2;
46 }
47
48 }