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.transport.http.HttpConstants;
17
18 public class HttpHeadersTestCase extends DynamicPortTestCase
19 {
20
21 @Override
22 protected String getConfigResources()
23 {
24 return "http-headers-config.xml";
25 }
26
27 public void testJettyHeaders() throws Exception
28 {
29 MuleClient client = new MuleClient(muleContext);
30 MuleMessage result = client.send("clientEndpoint", null, null);
31
32 String contentTypeProperty = result.getInboundProperty(HttpConstants.HEADER_CONTENT_TYPE);
33 assertNotNull(contentTypeProperty);
34 assertEquals("application/x-download", contentTypeProperty);
35
36 String contentDispositionProperty = result.getInboundProperty(HttpConstants.HEADER_CONTENT_DISPOSITION);
37 assertNotNull(contentDispositionProperty);
38 assertEquals("attachment; filename=foo.zip", contentDispositionProperty);
39 }
40
41 @Override
42 protected int getNumPortsToFind()
43 {
44 return 2;
45 }
46
47 }