Using the headers() API to setup http headers

Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/29c2a521
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/29c2a521
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/29c2a521

Branch: refs/heads/master
Commit: 29c2a5211d646f4e30fb67ddce867f51b68c6645
Parents: e34047e
Author: Willem Jiang <willem.ji...@gmail.com>
Authored: Mon Jul 28 15:34:18 2014 +0800
Committer: Willem Jiang <willem.ji...@gmail.com>
Committed: Mon Jul 28 15:34:18 2014 +0800

----------------------------------------------------------------------
 .../netty/http/DefaultNettyHttpBinding.java     | 32 ++++++++++----------
 .../netty/http/NettyHttpConverter.java          |  2 +-
 .../component/netty/http/NettyHttpHelper.java   |  4 +--
 .../http/SecurityAuthenticatorSupport.java      |  2 +-
 .../http/handlers/HttpClientChannelHandler.java |  6 ++--
 .../http/handlers/HttpServerChannelHandler.java | 28 ++++++++---------
 .../HttpServerMultiplexChannelHandler.java      |  4 +--
 ...ttpAccessHttpRequestAndResponseBeanTest.java |  2 +-
 ...ponentConfigurationAndDocumentationTest.java |  1 -
 .../http/NettyHttpMapHeadersFalseTest.java      |  6 ++--
 .../netty/http/NettyUseRawHttpResponseTest.java |  2 +-
 11 files changed, 44 insertions(+), 45 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/29c2a521/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/DefaultNettyHttpBinding.java
----------------------------------------------------------------------
diff --git 
a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/DefaultNettyHttpBinding.java
 
b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/DefaultNettyHttpBinding.java
index 23cae6c..eed39b0 100644
--- 
a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/DefaultNettyHttpBinding.java
+++ 
b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/DefaultNettyHttpBinding.java
@@ -142,14 +142,14 @@ public class DefaultNettyHttpBinding implements 
NettyHttpBinding, Cloneable {
             LOG.trace("HTTP-Uri {}", request.getUri());
         }
 
-        for (String name : request.getHeaderNames()) {
+        for (String name : request.headers().names()) {
             // mapping the content-type
             if (name.toLowerCase(Locale.US).equals("content-type")) {
                 name = Exchange.CONTENT_TYPE;
             }
 
             if (name.toLowerCase(Locale.US).equals("authorization")) {
-                String value = request.getHeader(name);
+                String value = request.headers().get(name);
                 // store a special header that this request was authenticated 
using HTTP Basic
                 if (value != null && value.trim().startsWith("Basic")) {
                     if (headerFilterStrategy != null
@@ -160,7 +160,7 @@ public class DefaultNettyHttpBinding implements 
NettyHttpBinding, Cloneable {
             }
 
             // add the headers one by one, and use the header filter strategy
-            List<String> values = request.getHeaders(name);
+            List<String> values = request.headers().getAll(name);
             Iterator<?> it = ObjectHelper.createIterator(values);
             while (it.hasNext()) {
                 Object extracted = it.next();
@@ -196,8 +196,8 @@ public class DefaultNettyHttpBinding implements 
NettyHttpBinding, Cloneable {
 
         // if body is application/x-www-form-urlencoded then extract the body 
as query string and append as headers
         // if it is a bridgeEndpoint we need to skip this part of work
-        if (request.getMethod().getName().equals("POST") && 
request.getHeader(Exchange.CONTENT_TYPE) != null
-                && 
request.getHeader(Exchange.CONTENT_TYPE).startsWith(NettyHttpConstants.CONTENT_TYPE_WWW_FORM_URLENCODED)
+        if (request.getMethod().getName().equals("POST") && 
request.headers().get(Exchange.CONTENT_TYPE) != null
+                && 
request.headers().get(Exchange.CONTENT_TYPE).startsWith(NettyHttpConstants.CONTENT_TYPE_WWW_FORM_URLENCODED)
                 && !configuration.isBridgeEndpoint()) {
 
             String charset = "UTF-8";
@@ -266,13 +266,13 @@ public class DefaultNettyHttpBinding implements 
NettyHttpBinding, Cloneable {
         headers.put(Exchange.HTTP_RESPONSE_CODE, 
response.getStatus().getCode());
         headers.put(NettyHttpConstants.HTTP_RESPONSE_TEXT, 
response.getStatus().getReasonPhrase());
 
-        for (String name : response.getHeaderNames()) {
+        for (String name : response.headers().names()) {
             // mapping the content-type
             if (name.toLowerCase().equals("content-type")) {
                 name = Exchange.CONTENT_TYPE;
             }
             // add the headers one by one, and use the header filter strategy
-            List<String> values = response.getHeaders(name);
+            List<String> values = response.headers().getAll(name);
             Iterator<?> it = ObjectHelper.createIterator(values);
             while (it.hasNext()) {
                 Object extracted = it.next();
@@ -316,7 +316,7 @@ public class DefaultNettyHttpBinding implements 
NettyHttpBinding, Cloneable {
                 if (headerValue != null && headerFilterStrategy != null
                         && 
!headerFilterStrategy.applyFilterToCamelHeaders(key, headerValue, 
message.getExchange())) {
                     LOG.trace("HTTP-Header: {}={}", key, headerValue);
-                    response.addHeader(key, headerValue);
+                    response.headers().add(key, headerValue);
                 }
             }
         }
@@ -387,7 +387,7 @@ public class DefaultNettyHttpBinding implements 
NettyHttpBinding, Cloneable {
             // TODO How to enable the chunk transport 
             int len = buffer.readableBytes();
             // set content-length
-            response.setHeader(HttpHeaders.Names.CONTENT_LENGTH, len);
+            response.headers().set(HttpHeaders.Names.CONTENT_LENGTH, len);
             LOG.trace("Content-Length: {}", len);
         }
 
@@ -395,7 +395,7 @@ public class DefaultNettyHttpBinding implements 
NettyHttpBinding, Cloneable {
         String contentType = MessageHelper.getContentType(message);
         if (contentType != null) {
             // set content-type
-            response.setHeader(HttpHeaders.Names.CONTENT_TYPE, contentType);
+            response.headers().set(HttpHeaders.Names.CONTENT_TYPE, 
contentType);
             LOG.trace("Content-Type: {}", contentType);
         }
 
@@ -410,7 +410,7 @@ public class DefaultNettyHttpBinding implements 
NettyHttpBinding, Cloneable {
                 connection = HttpHeaders.Values.CLOSE;
             }
         }
-        response.setHeader(HttpHeaders.Names.CONNECTION, connection);
+        response.headers().set(HttpHeaders.Names.CONNECTION, connection);
         LOG.trace("Connection: {}", connection);
 
         return response;
@@ -462,7 +462,7 @@ public class DefaultNettyHttpBinding implements 
NettyHttpBinding, Cloneable {
                 if (headerValue != null && headerFilterStrategy != null
                         && 
!headerFilterStrategy.applyFilterToCamelHeaders(key, headerValue, 
message.getExchange())) {
                     LOG.trace("HTTP-Header: {}={}", key, headerValue);
-                    request.addHeader(key, headerValue);
+                    request.headers().add(key, headerValue);
                 }
             }
         }
@@ -486,7 +486,7 @@ public class DefaultNettyHttpBinding implements 
NettyHttpBinding, Cloneable {
                 request.setContent(buffer);
                 int len = buffer.readableBytes();
                 // set content-length
-                request.setHeader(HttpHeaders.Names.CONTENT_LENGTH, len);
+                request.headers().set(HttpHeaders.Names.CONTENT_LENGTH, len);
                 LOG.trace("Content-Length: {}", len);
             } else {
                 // we do not support this kind of body
@@ -502,7 +502,7 @@ public class DefaultNettyHttpBinding implements 
NettyHttpBinding, Cloneable {
         String contentType = MessageHelper.getContentType(message);
         if (contentType != null) {
             // set content-type
-            request.setHeader(HttpHeaders.Names.CONTENT_TYPE, contentType);
+            request.headers().set(HttpHeaders.Names.CONTENT_TYPE, contentType);
             LOG.trace("Content-Type: {}", contentType);
         }
 
@@ -510,7 +510,7 @@ public class DefaultNettyHttpBinding implements 
NettyHttpBinding, Cloneable {
         // use URI as its faster than URL (no DNS lookup)
         URI u = new URI(uri);
         String host = u.getHost();
-        request.setHeader(HttpHeaders.Names.HOST, host);
+        request.headers().set(HttpHeaders.Names.HOST, host);
         LOG.trace("Host: {}", host);
 
         // configure connection to accordingly to keep alive configuration
@@ -524,7 +524,7 @@ public class DefaultNettyHttpBinding implements 
NettyHttpBinding, Cloneable {
                 connection = HttpHeaders.Values.CLOSE;
             }
         }
-        request.setHeader(HttpHeaders.Names.CONNECTION, connection);
+        request.headers().set(HttpHeaders.Names.CONNECTION, connection);
         LOG.trace("Connection: {}", connection);
 
         return request;

http://git-wip-us.apache.org/repos/asf/camel/blob/29c2a521/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpConverter.java
----------------------------------------------------------------------
diff --git 
a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpConverter.java
 
b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpConverter.java
index 0722651..9457d50 100644
--- 
a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpConverter.java
+++ 
b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpConverter.java
@@ -88,7 +88,7 @@ public final class NettyHttpConverter {
 
     @Converter
     public static String toString(HttpResponse response, Exchange exchange) {
-        String contentType = response.getHeader(Exchange.CONTENT_TYPE);
+        String contentType = response.headers().get(Exchange.CONTENT_TYPE);
         String charset = 
NettyHttpHelper.getCharsetFromContentType(contentType);
         if (charset == null && exchange != null) {
             charset = exchange.getProperty(Exchange.CHARSET_NAME, 
String.class);

http://git-wip-us.apache.org/repos/asf/camel/blob/29c2a521/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpHelper.java
----------------------------------------------------------------------
diff --git 
a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpHelper.java
 
b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpHelper.java
index 07bd8b6..376ec27 100644
--- 
a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpHelper.java
+++ 
b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpHelper.java
@@ -127,7 +127,7 @@ public final class NettyHttpHelper {
         String statusText = response.getStatus().getReasonPhrase();
 
         if (responseCode >= 300 && responseCode < 400) {
-            String redirectLocation = response.getHeader("location");
+            String redirectLocation = response.headers().get("location");
             if (redirectLocation != null) {
                 return new NettyHttpOperationFailedException(uri, 
responseCode, statusText, redirectLocation, response);
             } else {
@@ -137,7 +137,7 @@ public final class NettyHttpHelper {
         }
 
         if (transferException) {
-            String contentType = response.getHeader(Exchange.CONTENT_TYPE);
+            String contentType = response.headers().get(Exchange.CONTENT_TYPE);
             if 
(NettyHttpConstants.CONTENT_TYPE_JAVA_SERIALIZED_OBJECT.equals(contentType)) {
                 // if the response was a serialized exception then use that
                 InputStream is = 
exchange.getContext().getTypeConverter().convertTo(InputStream.class, response);

http://git-wip-us.apache.org/repos/asf/camel/blob/29c2a521/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/SecurityAuthenticatorSupport.java
----------------------------------------------------------------------
diff --git 
a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/SecurityAuthenticatorSupport.java
 
b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/SecurityAuthenticatorSupport.java
index 212736c..048ac00 100644
--- 
a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/SecurityAuthenticatorSupport.java
+++ 
b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/SecurityAuthenticatorSupport.java
@@ -67,7 +67,7 @@ public abstract class SecurityAuthenticatorSupport implements 
SecurityAuthentica
         }
 
         // check each role class name if they match the principal class name
-        Iterator it = ObjectHelper.createIterator(roleClassNames);
+        Iterator<Object> it = ObjectHelper.createIterator(roleClassNames);
         while (it.hasNext()) {
             String name = it.next().toString().trim();
             if (principal.getClass().getName().equals(name)) {

http://git-wip-us.apache.org/repos/asf/camel/blob/29c2a521/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpClientChannelHandler.java
----------------------------------------------------------------------
diff --git 
a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpClientChannelHandler.java
 
b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpClientChannelHandler.java
index 0f3a7a9..d463260 100644
--- 
a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpClientChannelHandler.java
+++ 
b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpClientChannelHandler.java
@@ -35,7 +35,7 @@ import org.slf4j.LoggerFactory;
 
 /**
  * Netty HTTP {@link 
org.apache.camel.component.netty.handlers.ClientChannelHandler} that handles 
the response combing
- * back from thhe HTTP server, called by this client.
+ * back from the HTTP server, called by this client.
  *
  */
 public class HttpClientChannelHandler extends ClientChannelHandler {
@@ -66,11 +66,11 @@ public class HttpClientChannelHandler extends 
ClientChannelHandler {
             if (msg instanceof HttpChunkTrailer) {
                 // chunk trailer only has headers
                 HttpChunkTrailer trailer = (HttpChunkTrailer) msg;
-                for (Map.Entry<String, String> entry : trailer.getHeaders()) {
+                for (Map.Entry<String, String> entry : 
trailer.trailingHeaders()) {
                     if (LOG.isTraceEnabled()) {
                         LOG.trace("Adding trailing header {}={}", 
entry.getKey(), entry.getValue());
                     }
-                    response.addHeader(entry.getKey(), entry.getValue());
+                    response.headers().add(entry.getKey(), entry.getValue());
                 }
             } else {
                 // append chunked content

http://git-wip-us.apache.org/repos/asf/camel/blob/29c2a521/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpServerChannelHandler.java
----------------------------------------------------------------------
diff --git 
a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpServerChannelHandler.java
 
b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpServerChannelHandler.java
index 24d4943..47a4bbe 100644
--- 
a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpServerChannelHandler.java
+++ 
b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpServerChannelHandler.java
@@ -85,8 +85,8 @@ public class HttpServerChannelHandler extends 
ServerChannelHandler {
             LOG.debug("Consumer suspended, cannot service request {}", 
request);
             HttpResponse response = new DefaultHttpResponse(HTTP_1_1, 
SERVICE_UNAVAILABLE);
             response.setChunked(false);
-            response.setHeader(Exchange.CONTENT_TYPE, "text/plain");
-            response.setHeader(Exchange.CONTENT_LENGTH, 0);
+            response.headers().set(Exchange.CONTENT_TYPE, "text/plain");
+            response.headers().set(Exchange.CONTENT_LENGTH, 0);
             response.setContent(ChannelBuffers.copiedBuffer(new byte[]{}));
             messageEvent.getChannel().write(response);
             return;
@@ -95,8 +95,8 @@ public class HttpServerChannelHandler extends 
ServerChannelHandler {
                 && 
!consumer.getEndpoint().getHttpMethodRestrict().contains(request.getMethod().getName()))
 {
             HttpResponse response = new DefaultHttpResponse(HTTP_1_1, 
METHOD_NOT_ALLOWED);
             response.setChunked(false);
-            response.setHeader(Exchange.CONTENT_TYPE, "text/plain");
-            response.setHeader(Exchange.CONTENT_LENGTH, 0);
+            response.headers().set(Exchange.CONTENT_TYPE, "text/plain");
+            response.headers().set(Exchange.CONTENT_LENGTH, 0);
             response.setContent(ChannelBuffers.copiedBuffer(new byte[]{}));
             messageEvent.getChannel().write(response);
             return;
@@ -104,18 +104,18 @@ public class HttpServerChannelHandler extends 
ServerChannelHandler {
         if ("TRACE".equals(request.getMethod().getName()) && 
!consumer.getEndpoint().isTraceEnabled()) {
             HttpResponse response = new DefaultHttpResponse(HTTP_1_1, 
METHOD_NOT_ALLOWED);
             response.setChunked(false);
-            response.setHeader(Exchange.CONTENT_TYPE, "text/plain");
-            response.setHeader(Exchange.CONTENT_LENGTH, 0);
+            response.headers().set(Exchange.CONTENT_TYPE, "text/plain");
+            response.headers().set(Exchange.CONTENT_LENGTH, 0);
             response.setContent(ChannelBuffers.copiedBuffer(new byte[]{}));
             messageEvent.getChannel().write(response);
             return;
         }
         // must include HOST header as required by HTTP 1.1
-        if (!request.getHeaderNames().contains(HttpHeaders.Names.HOST)) {
+        if (!request.headers().names().contains(HttpHeaders.Names.HOST)) {
             HttpResponse response = new DefaultHttpResponse(HTTP_1_1, 
BAD_REQUEST);
             response.setChunked(false);
-            response.setHeader(Exchange.CONTENT_TYPE, "text/plain");
-            response.setHeader(Exchange.CONTENT_LENGTH, 0);
+            response.headers().set(Exchange.CONTENT_TYPE, "text/plain");
+            response.headers().set(Exchange.CONTENT_LENGTH, 0);
             response.setContent(ChannelBuffers.copiedBuffer(new byte[]{}));
             messageEvent.getChannel().write(response);
             return;
@@ -175,9 +175,9 @@ public class HttpServerChannelHandler extends 
ServerChannelHandler {
                     }
                     // restricted resource, so send back 401 to require valid 
username/password
                     HttpResponse response = new DefaultHttpResponse(HTTP_1_1, 
UNAUTHORIZED);
-                    response.setHeader("WWW-Authenticate", "Basic realm=\"" + 
security.getRealm() + "\"");
-                    response.setHeader(Exchange.CONTENT_TYPE, "text/plain");
-                    response.setHeader(Exchange.CONTENT_LENGTH, 0);
+                    response.headers().set("WWW-Authenticate", "Basic 
realm=\"" + security.getRealm() + "\"");
+                    response.headers().set(Exchange.CONTENT_TYPE, 
"text/plain");
+                    response.headers().set(Exchange.CONTENT_LENGTH, 0);
                     response.setContent(ChannelBuffers.copiedBuffer(new 
byte[]{}));
                     messageEvent.getChannel().write(response);
                     return;
@@ -198,7 +198,7 @@ public class HttpServerChannelHandler extends 
ServerChannelHandler {
         }
 
         // see if any of the user roles is contained in the roles list
-        Iterator it = ObjectHelper.createIterator(userRoles);
+        Iterator<Object> it = ObjectHelper.createIterator(userRoles);
         while (it.hasNext()) {
             String userRole = it.next().toString();
             if (roles.contains(userRole)) {
@@ -218,7 +218,7 @@ public class HttpServerChannelHandler extends 
ServerChannelHandler {
      * @return {@link HttpPrincipal} with username and password details, or 
<tt>null</tt> if not possible to extract
      */
     protected static HttpPrincipal extractBasicAuthSubject(HttpRequest 
request) {
-        String auth = request.getHeader("Authorization");
+        String auth = request.headers().get("Authorization");
         if (auth != null) {
             String constraint = ObjectHelper.before(auth, " ");
             if (constraint != null) {

http://git-wip-us.apache.org/repos/asf/camel/blob/29c2a521/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpServerMultiplexChannelHandler.java
----------------------------------------------------------------------
diff --git 
a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpServerMultiplexChannelHandler.java
 
b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpServerMultiplexChannelHandler.java
index e00abd4..acc8641 100644
--- 
a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpServerMultiplexChannelHandler.java
+++ 
b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpServerMultiplexChannelHandler.java
@@ -104,8 +104,8 @@ public class HttpServerMultiplexChannelHandler extends 
SimpleChannelUpstreamHand
         } else {
             // this resource is not found, so send empty response back
             HttpResponse response = new DefaultHttpResponse(HTTP_1_1, 
NOT_FOUND);
-            response.setHeader(Exchange.CONTENT_TYPE, "text/plain");
-            response.setHeader(Exchange.CONTENT_LENGTH, 0);
+            response.headers().set(Exchange.CONTENT_TYPE, "text/plain");
+            response.headers().set(Exchange.CONTENT_LENGTH, 0);
             response.setContent(ChannelBuffers.copiedBuffer(new byte[]{}));
             messageEvent.getChannel().write(response);
         }

http://git-wip-us.apache.org/repos/asf/camel/blob/29c2a521/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpAccessHttpRequestAndResponseBeanTest.java
----------------------------------------------------------------------
diff --git 
a/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpAccessHttpRequestAndResponseBeanTest.java
 
b/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpAccessHttpRequestAndResponseBeanTest.java
index f645c6d..8f69791 100644
--- 
a/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpAccessHttpRequestAndResponseBeanTest.java
+++ 
b/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpAccessHttpRequestAndResponseBeanTest.java
@@ -64,7 +64,7 @@ public class NettyHttpAccessHttpRequestAndResponseBeanTest 
extends BaseNettyTest
 
         HttpResponse response = new DefaultHttpResponse(HttpVersion.HTTP_1_1, 
HttpResponseStatus.OK);
         response.setContent(ChannelBuffers.copiedBuffer(reply.getBytes()));
-        response.setHeader(HttpHeaders.Names.CONTENT_LENGTH, reply.length());
+        response.headers().set(HttpHeaders.Names.CONTENT_LENGTH, 
reply.length());
 
         return response;
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/29c2a521/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpComponentConfigurationAndDocumentationTest.java
----------------------------------------------------------------------
diff --git 
a/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpComponentConfigurationAndDocumentationTest.java
 
b/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpComponentConfigurationAndDocumentationTest.java
index acb7a95..5fa2593 100644
--- 
a/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpComponentConfigurationAndDocumentationTest.java
+++ 
b/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpComponentConfigurationAndDocumentationTest.java
@@ -19,7 +19,6 @@ package org.apache.camel.component.netty.http;
 import org.apache.camel.CamelContext;
 import org.apache.camel.ComponentConfiguration;
 import org.apache.camel.EndpointConfiguration;
-import org.apache.camel.component.netty.NettyComponent;
 import org.apache.camel.impl.DefaultCamelContext;
 import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;

http://git-wip-us.apache.org/repos/asf/camel/blob/29c2a521/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpMapHeadersFalseTest.java
----------------------------------------------------------------------
diff --git 
a/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpMapHeadersFalseTest.java
 
b/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpMapHeadersFalseTest.java
index 28498e9..36f86ab 100644
--- 
a/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpMapHeadersFalseTest.java
+++ 
b/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpMapHeadersFalseTest.java
@@ -54,9 +54,9 @@ public class NettyHttpMapHeadersFalseTest extends 
BaseNettyTest {
                         assertNull(exchange.getIn().getHeader("beer"));
 
                         // but we can find them in the http request from netty
-                        assertEquals("fooBAR", 
exchange.getIn(NettyHttpMessage.class).getHttpRequest().getHeader("clientHeader"));
-                        assertEquals("123", 
exchange.getIn(NettyHttpMessage.class).getHttpRequest().getHeader("OTHER"));
-                        assertEquals("Carlsberg", 
exchange.getIn(NettyHttpMessage.class).getHttpRequest().getHeader("beer"));
+                        assertEquals("fooBAR", 
exchange.getIn(NettyHttpMessage.class).getHttpRequest().headers().get("clientHeader"));
+                        assertEquals("123", 
exchange.getIn(NettyHttpMessage.class).getHttpRequest().headers().get("OTHER"));
+                        assertEquals("Carlsberg", 
exchange.getIn(NettyHttpMessage.class).getHttpRequest().headers().get("beer"));
 
                         exchange.getOut().setBody("Bye World");
                         exchange.getOut().setHeader("MyCaseHeader", "aBc123");

http://git-wip-us.apache.org/repos/asf/camel/blob/29c2a521/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyUseRawHttpResponseTest.java
----------------------------------------------------------------------
diff --git 
a/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyUseRawHttpResponseTest.java
 
b/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyUseRawHttpResponseTest.java
index de6b6ad..f47ecd6 100644
--- 
a/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyUseRawHttpResponseTest.java
+++ 
b/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyUseRawHttpResponseTest.java
@@ -51,7 +51,7 @@ public class NettyUseRawHttpResponseTest extends 
BaseNettyTest {
                         public void process(Exchange exchange) throws 
Exception {
                             HttpResponse response = new 
DefaultHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.OK);
                             
response.setContent(ChannelBuffers.copiedBuffer("Bye World".getBytes()));
-                            
response.setHeader(HttpHeaders.Names.CONTENT_LENGTH, 9);
+                            
response.headers().set(HttpHeaders.Names.CONTENT_LENGTH, 9);
 
                             exchange.getOut().setBody(response);
                         }

Reply via email to