You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "Croway (via GitHub)" <gi...@apache.org> on 2023/11/27 08:41:15 UTC

[PR] CAMEL-19991: Jetty and SB upgrades [camel]

Croway opened a new pull request, #12208:
URL: https://github.com/apache/camel/pull/12208

   Upgrade to jetty 12 and spring-boot 3.2.0 alignments


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-19991: Jetty and SB upgrades [camel]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #12208:
URL: https://github.com/apache/camel/pull/12208#issuecomment-1827372832

   :star2: Thank you for your contribution to the Apache Camel project! :star2: 
   
   :robot: CI automation will test this PR automatically.
   
   :camel: Apache Camel Committers, please review the following items:
   
   * First-time contributors **require MANUAL approval** for the GitHub Actions to run
   
   * You can use the command `/component-test (camel-)component-name1 (camel-)component-name2..` to request a test from the test bot.
   
   * You can label PRs using `build-all`, `build-dependents`, `skip-tests` and `test-dependents` to fine-tune the checks executed by this PR.
   
   * Build and test logs are available in the Summary page. **Only** [Apache Camel committers](https://camel.apache.org/community/team/#committers) have access to the summary. 
   
   * :warning: Be careful when sharing logs. Review their contents before sharing them publicly.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-19991: Jetty and SB upgrades [camel]

Posted by "Croway (via GitHub)" <gi...@apache.org>.
Croway commented on code in PR #12208:
URL: https://github.com/apache/camel/pull/12208#discussion_r1410502409


##########
components/camel-jetty/src/main/java/org/apache/camel/component/jetty11/CamelInputStreamContentProvider.java:
##########
@@ -18,9 +18,9 @@
 
 import java.io.InputStream;
 
-import org.eclipse.jetty.client.util.InputStreamContentProvider;
+import org.eclipse.jetty.io.content.InputStreamContentSource;
 
-public class CamelInputStreamContentProvider extends InputStreamContentProvider {
+public class CamelInputStreamContentProvider extends InputStreamContentSource {

Review Comment:
   I just noticed that the package is jetty11 and some class are named jett11 as well, can I update them to Jetty12?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-19991: Jetty and SB upgrades [camel]

Posted by "Croway (via GitHub)" <gi...@apache.org>.
Croway commented on PR #12208:
URL: https://github.com/apache/camel/pull/12208#issuecomment-1839066285

   @davsclaus finally, tests are green


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-19991: Jetty and SB upgrades [camel]

Posted by "Croway (via GitHub)" <gi...@apache.org>.
Croway commented on PR #12208:
URL: https://github.com/apache/camel/pull/12208#issuecomment-1838964664

   > org.apache.camel.component.jetty.MultiPartFormBigFileTest.testSendMultiPartFormWithBigFile 	10.39s 	FAILURE
   
   On it already, seems like that jetty 12 does not flush the multipart file in the tmp folder


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-19991: Jetty and SB upgrades [camel]

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on PR #12208:
URL: https://github.com/apache/camel/pull/12208#issuecomment-1835482773

   okay there are some test faulures that is worth to look at first and also the merge conflict now
   
   
   rg.apache.camel.component.http.HttpProducerSessionTest.testExchangeSession | 180.4s | ERROR
   -- | -- | --
   org.apache.camel.component.http.HttpProducerSessionTest.testNoSession | 180.2s | ERROR
   org.apache.camel.component.http.HttpProducerSessionTest.testInstanceSession | 180.3s | ERROR
   org.apache.camel.component.http.HttpNoConnectionRedeliveryTest.httpConnectionNotOk | 180.1s | FAILURE
   org.apache.camel.component.salesforce.RawPayloadTest.testRestApi | 0.687s | ERROR
   org.apache.camel.component.salesforce.RawPayloadTest.testRestApi | 0.119s | ERROR
   org.apache.camel.component.salesforce.RawPayloadTest.testRestApi | 0.104s | ERROR
   org.apache.camel.component.salesforce.RawPayloadTest.testRestApi | 0.098s | ERROR
   org.apache.camel.component.salesforce.RawPayloadTest.testRestApi | 0.094s | ERROR
   org.apache.camel.component.salesforce.RawPayloadTest.testRestApi | 0.084s | ERROR
   org.apache.camel.component.salesforce.RawPayloadTest.testRestApi | 0.093s | ERROR
   org.apache.camel.component.salesforce.RawPayloadTest.testRestApi | 0.089s | ERROR
   org.apache.camel.component.salesforce.RawPayloadTest.testRestApi | 0.086s | ERROR
   org.apache.camel.component.salesforce.RawPayloadTest.testRestApi | 0.097s | ERROR
   org.apache.camel.component.salesforce.RawPayloadTest.testRestApi | 0.085s | ERROR
   org.apache.camel.component.salesforce.RawPayloadTest.testRestApi | 0.082s | ERROR
   org.apache.camel.component.salesforce.RawPayloadTest.testRestApi | 0.089s | ERROR
   org.apache.camel.component.salesforce.RawPayloadTest.testRestApi | 0.077s | ERROR
   org.apache.camel.component.salesforce.RawPayloadTest.testRestApi | 0.082s | ERROR
   org.apache.camel.component.salesforce.RawPayloadTest.testRestApi | 0.090s | ERROR
   org.apache.camel.component.salesforce.RawPayloadTest.testRestApi | 0.076s | ERROR
   org.apache.camel.component.salesforce.RawPayloadTest.testRestApi | 0.078s | ERROR
   org.apache.camel.component.salesforce.RawPayloadTest.testRestApi | 0.082s | ERROR
   org.apache.camel.component.salesforce.RawPayloadTest.testRestApi | 0.081s | ERROR
   org.apache.camel.component.salesforce.RawPayloadTest.testRestApi | 0.078s | ERROR
   org.apache.camel.component.salesforce.RawPayloadTest.testRestApi | 0.079s | ERROR
   org.apache.camel.component.salesforce.RawPayloadTest.testRestApi | 0.082s | ERROR
   org.apache.camel.component.salesforce.RawPayloadTest.testRestApi | 0.077s | ERROR
   org.apache.camel.component.salesforce.RawPayloadTest.testRestApi | 0.075s | ERROR
   org.apache.camel.component.salesforce.RawPayloadTest.testRestApi | 0.073s | ERROR
   org.apache.camel.component.salesforce.RawPayloadTest.testRestApi | 0.090s | ERROR
   org.apache.camel.component.salesforce.RawPayloadTest.testRestApi | 0.079s | ERROR
   org.apache.camel.component.salesforce.RawPayloadTest.testRestApi | 0.074s | ERROR
   org.apache.camel.component.salesforce.RawPayloadTest.testRestApi | 0.074s | ERROR
   org.apache.camel.component.salesforce.RawPayloadTest.testRestApi | 0.066s | ERROR
   org.apache.camel.component.salesforce.RawPayloadTest.testRestApi | 0.070s | ERROR
   org.apache.camel.component.salesforce.RawPayloadTest.testRestApi | 0.070s | ERROR
   org.apache.camel.component.salesforce.RawPayloadTest.testRestApi | 0.066s | ERROR
   org.apache.camel.component.salesforce.RawPayloadTest.testRestApi | 0.074s | ERROR
   org.apache.camel.component.salesforce.RawPayloadTest.testRestApi | 0.074s | ERROR
   org.apache.camel.component.salesforce.RawPayloadTest.testRestApi | 0.070s | ERROR
   org.apache.camel.component.salesforce.RawPayloadTest.testRestApi | 0.066s | ERROR
   org.apache.camel.component.salesforce.RawPayloadTest.testRestApi | 0.074s | ERROR
   org.apache.camel.component.salesforce.PubSubApiTest.testReconnectOnErrorAfterReplayIdNonNull | 3.055s | FAILURE
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-19991: Jetty and SB upgrades [camel]

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on PR #12208:
URL: https://github.com/apache/camel/pull/12208#issuecomment-1839137884

   Awesome, so lets merge this


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-19991: Jetty and SB upgrades [camel]

Posted by "Croway (via GitHub)" <gi...@apache.org>.
Croway commented on PR #12208:
URL: https://github.com/apache/camel/pull/12208#issuecomment-1832056413

   The build is successful, though there are some tests that are failing. But, if possible, I'd merge this PR


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-19991: Jetty and SB upgrades [camel]

Posted by "Croway (via GitHub)" <gi...@apache.org>.
Croway commented on code in PR #12208:
URL: https://github.com/apache/camel/pull/12208#discussion_r1410472437


##########
components/camel-cxf/camel-cxf-rest/pom.xml:
##########
@@ -126,43 +126,30 @@
 
         <dependency>
             <groupId>org.apache.cxf</groupId>
-            <artifactId>cxf-rt-transports-http-jetty</artifactId>
+            <artifactId>cxf-rt-transports-http-undertow</artifactId>

Review Comment:
   in CXF, `cxf-rt-transports-http-jetty` is used for testing, and `cxf-rt-transports-http-jetty` is still using Jetty 11, therefore, during runtime, due to the exclusion and the usage of camel-jetty (that is using jetty 12) I had some ClassNotFound/MethodNotFound.
   
   This is why I replaced (for testing purposes) jetty with undertow, I totally understand the risk, once merged, I'll execute some camel spring boot and camel quarkus test and examples to be sure that it is working as expected, as you can see by the camel test report, there are no test failures in cxf.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-19991: Jetty and SB upgrades [camel]

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on PR #12208:
URL: https://github.com/apache/camel/pull/12208#issuecomment-1838920322

   
   org.apache.camel.component.jetty.MultiPartFormBigFileTest.testSendMultiPartFormWithBigFile | 10.39s | FAILURE
   -- | -- | --
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-19991: Jetty and SB upgrades [camel]

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus merged PR #12208:
URL: https://github.com/apache/camel/pull/12208


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-19991: Jetty and SB upgrades [camel]

Posted by "Croway (via GitHub)" <gi...@apache.org>.
Croway commented on code in PR #12208:
URL: https://github.com/apache/camel/pull/12208#discussion_r1410386345


##########
components/camel-cxf/camel-cxf-rest/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducer.java:
##########
@@ -24,11 +24,7 @@
 import java.net.CookieStore;
 import java.net.HttpCookie;
 import java.net.URLDecoder;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;

Review Comment:
   yeah, the IDE thinks he's smart, I'll review them and update the PR



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-19991: Jetty and SB upgrades [camel]

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on PR #12208:
URL: https://github.com/apache/camel/pull/12208#issuecomment-1834124632

   lets get this merged so we can be ready for SB 3.2


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-19991: Jetty and SB upgrades [camel]

Posted by "Croway (via GitHub)" <gi...@apache.org>.
Croway commented on PR #12208:
URL: https://github.com/apache/camel/pull/12208#issuecomment-1838628107

   Hi @orpiske , I tried to disable this failing test https://github.com/apache/camel/actions/runs/7086870354 since it is failing on CI only, but seems like that [this is not enough](https://github.com/apache/camel/pull/12208/commits/0aea38b7b575e060922271278353d321b548a716)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-19991: Jetty and SB upgrades [camel]

Posted by "Croway (via GitHub)" <gi...@apache.org>.
Croway commented on code in PR #12208:
URL: https://github.com/apache/camel/pull/12208#discussion_r1410500341


##########
components/camel-platform-http/src/test/java/org/apache/camel/component/platform/http/JettyCustomPlatformHttpConsumer.java:
##########
@@ -63,51 +64,64 @@ protected void doStart() throws Exception {
     private ContextHandler createHandler(PlatformHttpEndpoint endpoint, String path) {
         ContextHandler contextHandler = new ContextHandler();
         contextHandler.setContextPath(path);
-        contextHandler.setResourceBase(".");
+        contextHandler.setBaseResourceAsString(".");
         contextHandler.setClassLoader(Thread.currentThread().getContextClassLoader());
-        contextHandler.setAllowNullPathInfo(true);
-        contextHandler.setHandler(new AbstractHandler() {
+        contextHandler.setAllowNullPathInContext(true);
+
+        contextHandler.setHandler(new Handler.Abstract() {
             @Override
-            public void handle(
-                    String s, Request request, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {
+            public boolean handle(Request request, Response response, Callback callback) throws Exception {
                 Exchange exchg = null;
                 try {
-                    BufferedReader reader = httpServletRequest.getReader();
                     String bodyRequest = "";
-                    String strCurrentLine;
-                    while ((strCurrentLine = reader.readLine()) != null) {
-                        bodyRequest += strCurrentLine;
+                    while (true) {
+                        Content.Chunk chunk = request.read();
+                        if (chunk.isLast()) {
+                            break;
+                        }
+
+                        byte[] bytes = new byte[chunk.getByteBuffer().remaining()];

Review Comment:
   I tried to, but seems like that jetty is messing a bit with the ByteBuffer, and the .array() is null



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-19991: Jetty and SB upgrades [camel]

Posted by "Croway (via GitHub)" <gi...@apache.org>.
Croway commented on code in PR #12208:
URL: https://github.com/apache/camel/pull/12208#discussion_r1410513839


##########
components/camel-openstack/src/test/java/org/apache/camel/component/openstack/it/OpenstackWiremockTestSupport.java:
##########
@@ -32,7 +31,6 @@ public class OpenstackWiremockTestSupport extends CamelTestSupport {
     @BeforeAll
     public static void startServer() {
         WireMockConfiguration configuration = options().dynamicPort();
-        configuration.extensions(new ResponseTemplateTransformer(false));

Review Comment:
   WireMock is not clear about it, I could not find any migration/upgrade guide or discussion about it on github



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-19991: Jetty and SB upgrades [camel]

Posted by "orpiske (via GitHub)" <gi...@apache.org>.
orpiske commented on PR #12208:
URL: https://github.com/apache/camel/pull/12208#issuecomment-1838930486

   > Hi @orpiske , I tried to disable this failing test https://github.com/apache/camel/actions/runs/7086870354 since it is failing on CI only, but seems like that [this is not enough](https://github.com/apache/camel/pull/12208/commits/0aea38b7b575e060922271278353d321b548a716)
   
   I'm hoping this one will do the trick: https://github.com/apache/camel/pull/12308. Just rebase once that one is merged. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-19991: Jetty and SB upgrades [camel]

Posted by "essobedo (via GitHub)" <gi...@apache.org>.
essobedo commented on code in PR #12208:
URL: https://github.com/apache/camel/pull/12208#discussion_r1410378457


##########
components/camel-cxf/camel-cxf-rest/pom.xml:
##########
@@ -126,43 +126,30 @@
 
         <dependency>
             <groupId>org.apache.cxf</groupId>
-            <artifactId>cxf-rt-transports-http-jetty</artifactId>
+            <artifactId>cxf-rt-transports-http-undertow</artifactId>

Review Comment:
   Why replace jetty with undertow? CXF is a component highly used, we really need very good reasons to do such change.



##########
components/camel-cxf/camel-cxf-rest/src/main/java/org/apache/camel/component/cxf/jaxrs/DefaultCxfRsBinding.java:
##########
@@ -18,12 +18,7 @@
 
 import java.lang.reflect.Method;
 import java.nio.charset.StandardCharsets;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-import java.util.TreeMap;
+import java.util.*;

Review Comment:
   ditto



##########
components/camel-cxf/camel-cxf-rest/src/main/java/org/apache/camel/component/cxf/jaxrs/DefaultCxfRsBinding.java:
##########
@@ -212,13 +207,15 @@ public Object bindCamelMessageBodyToRequestBody(Message camelMessage, Exchange c
             throws Exception {
 
         Object request = camelMessage.getBody(MessageContentsList.class);
-        if (request != null) {
+        if (request != null && request instanceof MessageContentsList) {

Review Comment:
   If `request instanceof MessageContentsList` is true, it means that request is != null so it could simply be `request instanceof MessageContentsList mcl`



##########
components/camel-jetty-common/src/main/java/org/apache/camel/component/jetty/JettyHttpComponent.java:
##########
@@ -70,22 +65,17 @@
 import org.apache.camel.util.StringHelper;
 import org.apache.camel.util.URISupport;
 import org.apache.camel.util.UnsafeUriCharactersEncoder;
+import org.eclipse.jetty.ee10.servlet.FilterHolder;
+import org.eclipse.jetty.ee10.servlet.ServletContextHandler;
+import org.eclipse.jetty.ee10.servlet.ServletHolder;
+import org.eclipse.jetty.ee10.servlet.SessionHandler;
+import org.eclipse.jetty.ee10.servlets.CrossOriginFilter;
 import org.eclipse.jetty.http.HttpStatus;
 import org.eclipse.jetty.jmx.MBeanContainer;
-import org.eclipse.jetty.server.AbstractConnector;
-import org.eclipse.jetty.server.Connector;
-import org.eclipse.jetty.server.Handler;
-import org.eclipse.jetty.server.Request;
-import org.eclipse.jetty.server.Server;
+import org.eclipse.jetty.server.*;

Review Comment:
   ditto



##########
components/camel-jetty/src/main/java/org/apache/camel/component/jetty11/CamelInputStreamContentProvider.java:
##########
@@ -18,9 +18,9 @@
 
 import java.io.InputStream;
 
-import org.eclipse.jetty.client.util.InputStreamContentProvider;
+import org.eclipse.jetty.io.content.InputStreamContentSource;
 
-public class CamelInputStreamContentProvider extends InputStreamContentProvider {
+public class CamelInputStreamContentProvider extends InputStreamContentSource {

Review Comment:
   I would rename the class too otherwise it is missleading



##########
components/camel-platform-http/src/test/java/org/apache/camel/component/platform/http/JettyCustomPlatformHttpConsumer.java:
##########
@@ -63,51 +64,64 @@ protected void doStart() throws Exception {
     private ContextHandler createHandler(PlatformHttpEndpoint endpoint, String path) {
         ContextHandler contextHandler = new ContextHandler();
         contextHandler.setContextPath(path);
-        contextHandler.setResourceBase(".");
+        contextHandler.setBaseResourceAsString(".");
         contextHandler.setClassLoader(Thread.currentThread().getContextClassLoader());
-        contextHandler.setAllowNullPathInfo(true);
-        contextHandler.setHandler(new AbstractHandler() {
+        contextHandler.setAllowNullPathInContext(true);
+
+        contextHandler.setHandler(new Handler.Abstract() {
             @Override
-            public void handle(
-                    String s, Request request, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {
+            public boolean handle(Request request, Response response, Callback callback) throws Exception {
                 Exchange exchg = null;
                 try {
-                    BufferedReader reader = httpServletRequest.getReader();
                     String bodyRequest = "";
-                    String strCurrentLine;
-                    while ((strCurrentLine = reader.readLine()) != null) {
-                        bodyRequest += strCurrentLine;
+                    while (true) {
+                        Content.Chunk chunk = request.read();
+                        if (chunk.isLast()) {
+                            break;
+                        }
+
+                        byte[] bytes = new byte[chunk.getByteBuffer().remaining()];

Review Comment:
   Maybe you can simply call `chunk.getByteBuffer().array()` to get the byte array that backs the buffer



##########
components/camel-jetty/src/test/java/org/apache/camel/component/jetty/MultiPartFormTest.java:
##########
@@ -98,7 +98,8 @@ public void process(Exchange exchange) throws Exception {
                         // "text/plain", data.getContentType());
                         assertEquals("log4j2.properties", data.getName(), "Got the wrong name");
 
-                        assertTrue(data.getDataSource().getInputStream().available() > 0,
+                        String fileContent = new String(data.getDataSource().getInputStream().readAllBytes());
+                        assertTrue(fileContent.length() > 0,

Review Comment:
   Another way to do the same thing (checking if the stream is empty if I got it right), could be to check if `data.getDataSource().getInputStream().read() != -1`



##########
components/camel-openstack/src/test/java/org/apache/camel/component/openstack/it/OpenstackWiremockTestSupport.java:
##########
@@ -32,7 +31,6 @@ public class OpenstackWiremockTestSupport extends CamelTestSupport {
     @BeforeAll
     public static void startServer() {
         WireMockConfiguration configuration = options().dynamicPort();
-        configuration.extensions(new ResponseTemplateTransformer(false));

Review Comment:
   Is-it by default now?



##########
components/camel-platform-http/src/test/java/org/apache/camel/component/platform/http/JettyCustomPlatformHttpConsumer.java:
##########
@@ -63,51 +64,64 @@ protected void doStart() throws Exception {
     private ContextHandler createHandler(PlatformHttpEndpoint endpoint, String path) {
         ContextHandler contextHandler = new ContextHandler();
         contextHandler.setContextPath(path);
-        contextHandler.setResourceBase(".");
+        contextHandler.setBaseResourceAsString(".");
         contextHandler.setClassLoader(Thread.currentThread().getContextClassLoader());
-        contextHandler.setAllowNullPathInfo(true);
-        contextHandler.setHandler(new AbstractHandler() {
+        contextHandler.setAllowNullPathInContext(true);
+
+        contextHandler.setHandler(new Handler.Abstract() {
             @Override
-            public void handle(
-                    String s, Request request, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {
+            public boolean handle(Request request, Response response, Callback callback) throws Exception {
                 Exchange exchg = null;
                 try {
-                    BufferedReader reader = httpServletRequest.getReader();
                     String bodyRequest = "";
-                    String strCurrentLine;
-                    while ((strCurrentLine = reader.readLine()) != null) {
-                        bodyRequest += strCurrentLine;
+                    while (true) {
+                        Content.Chunk chunk = request.read();
+                        if (chunk.isLast()) {
+                            break;
+                        }
+
+                        byte[] bytes = new byte[chunk.getByteBuffer().remaining()];
+                        chunk.getByteBuffer().get(bytes);
+                        String chunkString = new String(bytes, StandardCharsets.UTF_8);
+                        bodyRequest += chunkString;

Review Comment:
   Maybe we can use a StringBuilder instead?



##########
components/camel-rest-openapi/src/test/java/org/apache/camel/component/rest/openapi/WireMockJettyServerFactory.java:
##########
@@ -16,30 +16,67 @@
  */
 package org.apache.camel.component.rest.openapi;
 
+import com.github.tomakehurst.wiremock.common.HttpsSettings;
+import com.github.tomakehurst.wiremock.common.JettySettings;
 import com.github.tomakehurst.wiremock.core.Options;
 import com.github.tomakehurst.wiremock.http.AdminRequestHandler;
 import com.github.tomakehurst.wiremock.http.HttpServer;
 import com.github.tomakehurst.wiremock.http.StubRequestHandler;
-import com.github.tomakehurst.wiremock.jetty.JettyHttpServer;
 import com.github.tomakehurst.wiremock.jetty.JettyHttpServerFactory;
+import com.github.tomakehurst.wiremock.jetty11.Jetty11HttpServer;
+import com.github.tomakehurst.wiremock.jetty11.SslContexts;
+import org.eclipse.jetty.io.NetworkTrafficListener;
+import org.eclipse.jetty.server.*;

Review Comment:
   ditto



##########
components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceComponent.java:
##########
@@ -49,13 +49,7 @@
 import org.apache.camel.support.service.ServiceHelper;
 import org.apache.camel.util.ObjectHelper;
 import org.apache.camel.util.StringHelper;
-import org.eclipse.jetty.client.HttpProxy;
-import org.eclipse.jetty.client.Origin;
-import org.eclipse.jetty.client.ProxyConfiguration;
-import org.eclipse.jetty.client.Socks4Proxy;
-import org.eclipse.jetty.client.api.Authentication;
-import org.eclipse.jetty.client.util.BasicAuthentication;
-import org.eclipse.jetty.client.util.DigestAuthentication;
+import org.eclipse.jetty.client.*;

Review Comment:
   ditto



##########
components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/AbstractClientBase.java:
##########
@@ -49,356 +30,368 @@
 import org.apache.camel.component.salesforce.internal.SalesforceSession;
 import org.apache.camel.support.service.ServiceSupport;
 import org.apache.commons.io.IOUtils;
-import org.eclipse.jetty.client.HttpClient;
-import org.eclipse.jetty.client.HttpContentResponse;
-import org.eclipse.jetty.client.api.ContentProvider;
-import org.eclipse.jetty.client.api.ContentResponse;
-import org.eclipse.jetty.client.api.Request;
-import org.eclipse.jetty.client.api.Response;
-import org.eclipse.jetty.client.api.Result;
-import org.eclipse.jetty.client.util.BufferingResponseListener;
-import org.eclipse.jetty.client.util.ByteBufferContentProvider;
-import org.eclipse.jetty.client.util.InputStreamContentProvider;
+import org.eclipse.jetty.client.*;
+import org.eclipse.jetty.client.internal.HttpContentResponse;
 import org.eclipse.jetty.http.HttpField;
 import org.eclipse.jetty.http.HttpFields;
 import org.eclipse.jetty.http.HttpMethod;
 import org.eclipse.jetty.http.HttpStatus;
+import org.eclipse.jetty.io.Content;
+import org.eclipse.jetty.io.content.ByteBufferContentSource;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.ByteBuffer;
+import java.nio.charset.StandardCharsets;
+import java.util.*;

Review Comment:
   ditto



##########
components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/HttpProxyIntegrationTest.java:
##########
@@ -50,146 +49,146 @@
 @Parameterized
 public class HttpProxyIntegrationTest extends AbstractSalesforceTestBase {
 
-    private static final Logger LOG = LoggerFactory.getLogger(HttpProxyIntegrationTest.class);
-    private static final String HTTP_PROXY_HOST = "localhost";
-    private static final String HTTP_PROXY_USER_NAME = "camel-user";
-    private static final String HTTP_PROXY_PASSWORD = "camel-user-password";
-    private static final String HTTP_PROXY_REALM = "proxy-realm";
-
-    private static Server server;
-    private static int httpProxyPort;
-
-    private static final AtomicBoolean WENT_THROUGH_PROXY = new AtomicBoolean();
-
-    @Parameter
-    private Consumer<SalesforceComponent> configurationMethod;
-
-    @Parameters
-    public static Iterable<Consumer<SalesforceComponent>> methods() {
-        return Arrays.asList(HttpProxyIntegrationTest::configureProxyViaComponentProperties,
-                HttpProxyIntegrationTest::configureProxyViaClientPropertiesMap);
-    }
-
-    @Test
-    public void testGetVersions() throws Exception {
-        doTestGetVersions("");
-        doTestGetVersions("Xml");
-
-        assertTrue(WENT_THROUGH_PROXY.get(), "Should have gone through the test proxy");
-    }
-
-    @SuppressWarnings("unchecked")
-    private void doTestGetVersions(String suffix) throws Exception {
-        // test getVersions doesn't need a body
-        // assert expected result
-        Object o = template().requestBody("direct:getVersions" + suffix, (Object) null);
-        List<Version> versions = null;
-        if (o instanceof Versions) {
-            versions = ((Versions) o).getVersions();
-        } else {
-            versions = (List<Version>) o;
-        }
-        assertNotNull(versions);
-        LOG.debug("Versions: {}", versions);
-    }
-
-    @BeforeAll
-    public static void setupServer() throws Exception {
-        // start a local HTTP proxy using Jetty server
-        server = new Server();
-
-        ServerConnector connector = new ServerConnector(server);
-
-        connector.setHost(HTTP_PROXY_HOST);
-        server.addConnector(connector);
-
-        final String authenticationString
-                = "Basic " + Base64.getEncoder().encodeToString(
-                        (HTTP_PROXY_USER_NAME + ":" + HTTP_PROXY_PASSWORD).getBytes(StandardCharsets.ISO_8859_1));
-
-        ConnectHandler connectHandler = new ConnectHandler() {
-            @Override
-            protected boolean handleAuthentication(HttpServletRequest request, HttpServletResponse response, String address) {
-                // validate proxy-authentication header
-                final String header = request.getHeader(PROXY_AUTHORIZATION.toString());
-                if (!authenticationString.equals(header)) {
-                    LOG.warn("Missing header {}", PROXY_AUTHORIZATION);
-                    // ask for authentication header
-                    response.setHeader(PROXY_AUTHENTICATE.toString(), String.format("Basic realm=\"%s\"", HTTP_PROXY_REALM));
-                    return false;
-                }
-                LOG.info("Request contains required header {}", PROXY_AUTHORIZATION);
-                WENT_THROUGH_PROXY.set(true);
-                return true;
-            }
-        };
-        server.setHandler(connectHandler);
-
-        LOG.info("Starting proxy server...");
-        server.start();
-
-        httpProxyPort = connector.getLocalPort();
-        LOG.info("Started proxy server on port {}", httpProxyPort);
-    }
-
-    @Override
-    protected void createComponent() throws Exception {
-
-        super.createComponent();
-        final SalesforceComponent salesforce = (SalesforceComponent) context().getComponent("salesforce");
-
-        // set HTTP client properties
-        final HashMap<String, Object> properties = new HashMap<>();
-        properties.put("timeout", "60000");
-        properties.put("removeIdleDestinations", "true");
-        salesforce.setHttpClientProperties(properties);
-
-        configurationMethod.accept(salesforce);
-    }
-
-    @AfterAll
-    public static void cleanup() throws Exception {
-        // stop the proxy server after component
-        LOG.info("Stopping proxy server...");
-        server.stop();
-        LOG.info("Stopped proxy server");
-    }
-
-    @Override
-    protected RouteBuilder doCreateRouteBuilder() throws Exception {
-        return new RouteBuilder() {
-            @Override
-            public void configure() throws Exception {
-
-                // testGetVersion
-                from("direct:getVersions").to("salesforce:getVersions");
-
-                // allow overriding format per endpoint
-                from("direct:getVersionsXml").to("salesforce:getVersions?format=XML");
-
-            }
-        };
-    }
-
-    private static void configureProxyViaComponentProperties(final SalesforceComponent salesforce) {
-        salesforce.setHttpProxyHost(HTTP_PROXY_HOST);
-        salesforce.setHttpProxyPort(httpProxyPort);
-        salesforce.setHttpProxySecure(false);
-        salesforce.setHttpProxyUsername(HTTP_PROXY_USER_NAME);
-        salesforce.setHttpProxyPassword(HTTP_PROXY_PASSWORD);
-        salesforce.setHttpProxyAuthUri(String.format("http://%s:%s", HTTP_PROXY_HOST, httpProxyPort));
-        salesforce.setHttpProxyRealm(HTTP_PROXY_REALM);
-    }
-
-    private static void configureProxyViaClientPropertiesMap(final SalesforceComponent salesforce) {
-        final Map<String, Object> properties = salesforce.getHttpClientProperties();
-        properties.put(SalesforceComponent.HTTP_PROXY_HOST, HTTP_PROXY_HOST);
-        properties.put(SalesforceComponent.HTTP_PROXY_PORT, httpProxyPort);
-        properties.put(SalesforceComponent.HTTP_PROXY_IS_SECURE, false);
-        properties.put(SalesforceComponent.HTTP_PROXY_USERNAME, HTTP_PROXY_USER_NAME);
-        properties.put(SalesforceComponent.HTTP_PROXY_PASSWORD, HTTP_PROXY_PASSWORD);
-        properties.put(SalesforceComponent.HTTP_PROXY_AUTH_URI, String.format("http://%s:%s", HTTP_PROXY_HOST, httpProxyPort));
-        properties.put(SalesforceComponent.HTTP_PROXY_REALM, HTTP_PROXY_REALM);
-    }
+	private static final Logger LOG = LoggerFactory.getLogger(HttpProxyIntegrationTest.class);

Review Comment:
   It looks like you used the wrong indent so it is very hard to review



##########
components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/SalesforceSecurityHandler.java:
##########
@@ -55,7 +49,8 @@ public class SalesforceSecurityHandler implements ProtocolHandler {
     private final SalesforceSession session;
     private final int maxAuthenticationRetries;
     private final int maxContentLength;
-    private final ResponseNotifier notifier;
+//    TODO
+//    private final ResponseNotifier notifier;

Review Comment:
   For all TODO added, don't forget to create a dedicated ticket for it



##########
components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/AbstractClientBase.java:
##########
@@ -49,356 +30,368 @@
 import org.apache.camel.component.salesforce.internal.SalesforceSession;
 import org.apache.camel.support.service.ServiceSupport;
 import org.apache.commons.io.IOUtils;
-import org.eclipse.jetty.client.HttpClient;
-import org.eclipse.jetty.client.HttpContentResponse;
-import org.eclipse.jetty.client.api.ContentProvider;
-import org.eclipse.jetty.client.api.ContentResponse;
-import org.eclipse.jetty.client.api.Request;
-import org.eclipse.jetty.client.api.Response;
-import org.eclipse.jetty.client.api.Result;
-import org.eclipse.jetty.client.util.BufferingResponseListener;
-import org.eclipse.jetty.client.util.ByteBufferContentProvider;
-import org.eclipse.jetty.client.util.InputStreamContentProvider;
+import org.eclipse.jetty.client.*;

Review Comment:
   ditto



##########
components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/RestApiIntegrationTest.java:
##########
@@ -74,884 +44,885 @@
 import org.junit.jupiter.api.Tag;
 import org.junit.jupiter.api.Test;
 
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertFalse;
-import static org.junit.jupiter.api.Assertions.assertNotNull;
-import static org.junit.jupiter.api.Assertions.assertNull;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-import static org.junit.jupiter.api.Assertions.fail;
+import java.io.InputStream;
+import java.nio.charset.StandardCharsets;
+import java.time.ZoneId;
+import java.time.ZonedDateTime;
+import java.util.*;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import static org.junit.jupiter.api.Assertions.*;
 
 @Tag("standalone")
 public class RestApiIntegrationTest extends AbstractSalesforceTestBase {
 
-    /**
-     * Request DTO for Salesforce APEX REST calls. See
-     * https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_rest_methods.htm.
-     */
-    public static class MerchandiseRequest extends AbstractDTOBase {
-        private Merchandise__c merchandise;
-
-        public MerchandiseRequest(final Merchandise__c merchandise) {
-            this.merchandise = merchandise;
-        }
-
-        public Merchandise__c getMerchandise() {
-            return merchandise;
-        }
-
-        public void setMerchandise(final Merchandise__c merchandise) {
-            this.merchandise = merchandise;
-        }
-    }
-
-    /**
-     * Response DTO for Salesforce APEX REST calls. See
-     * https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_rest_methods.htm.
-     */
-    public static class MerchandiseResponse extends Merchandise__c {
-        // XML response contains a type string with the SObject type name
-        private String type;
-
-        public String getType() {
-            return type;
-        }
-
-        public void setType(final String type) {
-            this.type = type;
-        }
-    }
-
-    private static final AtomicInteger NEW_LINE_ITEM_ID = new AtomicInteger(100);
-
-    private static final String TEST_DOCUMENT_ID = "Test Document";
-
-    private static final AtomicInteger TEST_LINE_ITEM_ID = new AtomicInteger(1);
-
-    private String merchandiseId;
-    private String accountId;
-    private String contactId;
-
-    @AfterEach
-    public void removeData() {
-        template.request("salesforce:deleteSObject?sObjectName=Merchandise__c&sObjectId=" + merchandiseId, (Processor) e -> {
-            // NOOP
-        });
-        template.requestBody("direct:deleteLineItems", "");
-    }
-
-    @BeforeEach
-    public void setupData() {
-        final Merchandise__c merchandise = new Merchandise__c();
-        merchandise.setName("Test Merchandise");
-        merchandise.setPrice__c(10.0);
-        merchandise.setTotal_Inventory__c(100.0);
-        merchandise.setDescription__c("Test Merchandise!");
-        final CreateSObjectResult merchandiseResult
-                = template().requestBody("salesforce:createSObject", merchandise, CreateSObjectResult.class);
-
-        merchandiseId = merchandiseResult.getId();
-    }
-
-    private void createLineItem() {
-        Line_Item__c lineItem = new Line_Item__c();
-        final String lineItemId = String.valueOf(TEST_LINE_ITEM_ID.incrementAndGet());
-        lineItem.setName(lineItemId);
-        CreateSObjectResult result = template().requestBody("direct:createLineItem", lineItem, CreateSObjectResult.class);
-    }
-
-    private void createLineItems(int count) {
-        List<Line_Item__c> lineItems = new ArrayList<>();
-        for (int i = 0; i < count; i++) {
-            Line_Item__c lineItem = new Line_Item__c();
-            final String lineItemId = String.valueOf(TEST_LINE_ITEM_ID.incrementAndGet());
-            lineItem.setName(lineItemId);
-            lineItems.add(lineItem);
-        }
-        template().requestBody("direct:createLineItems", lineItems);
-    }
-
-    private void createAccountAndContact() {
-        final Account account = new Account();
-        account.setName("Child Test");
-        String accountExternalId = UUID.randomUUID().toString();
-        account.setExternal_Id__c(accountExternalId);
-        CreateSObjectResult accountResult
-                = template().requestBody("salesforce:createSObject", account, CreateSObjectResult.class);
-        accountId = accountResult.getId();
-
-        final Account accountRef = new Account();
-        accountRef.setExternal_Id__c(accountExternalId);
-        final Contact contact = new Contact();
-        contact.setAccount(accountRef);
-        contact.setLastName("RelationshipTest");
-        CreateSObjectResult contactResult
-                = template().requestBody("salesforce:createSObject", contact, CreateSObjectResult.class);
-        contactId = contactResult.getId();
-    }
-
-    private void deleteAccountAndContact() {
-        if (accountId != null) {
-            template.request("salesforce:deleteSObject?sObjectName=Account&sObjectId=" + accountId, (Processor) e -> {
-                // NOOP
-            });
-        }
-        if (contactId != null) {
-            template.request("salesforce:deleteSObject?sObjectName=Contact&sObjectId=" + contactId, (Processor) e -> {
-                // NOOP
-            });
-        }
-    }
-
-    @Test
-    public void testApexCall() throws Exception {
-        // request merchandise with id in URI template
-        Merchandise__c merchandise
-                = template().requestBodyAndHeader("direct:apexCallGet", null, "id", merchandiseId, Merchandise__c.class);
-        assertNotNull(merchandise);
-
-        // request merchandise with id as query param
-        merchandise = template().requestBodyAndHeader("direct:apexCallGetWithId", null,
-                SalesforceEndpointConfig.APEX_QUERY_PARAM_PREFIX + "id", merchandiseId,
-                Merchandise__c.class);
-        assertNotNull(merchandise);
-
-        // patch merchandise
-        // clear fields that won't be modified
-        merchandise.clearBaseFields();
-        merchandise.setId(merchandiseId);
-        merchandise.setPrice__c(null);
-        merchandise.setTotal_Inventory__c(null);
-
-        merchandise = template().requestBody("direct:apexCallPatch", new MerchandiseRequest(merchandise), Merchandise__c.class);
-        assertNotNull(merchandise);
-
-        Exchange exchange = new DefaultExchange(context);
-        template.send("direct:apexCallPostCustomError", exchange);
-        SalesforceException exception = exchange.getException(SalesforceException.class);
-        assertNotNull(exception);
-        assertEquals("test response", IOUtils.toString(exception.getResponseContent(), StandardCharsets.UTF_8));
-    }
-
-    @Test
-    public void testApexCallDetectResponseType() throws Exception {
-        // request merchandise with id in URI template
-        Merchandise__c merchandise
-                = template().requestBodyAndHeader("direct:apexCallGetDetectResponseType", null, "id", merchandiseId,
-                        Merchandise__c.class);
-        assertNotNull(merchandise);
-    }
-
-    @Test
-    public void returnsHttpResponseStatusAndText() {
-        Exchange exchange = new DefaultExchange(context);
-        template().send("direct:query", exchange);
-        assertEquals("200", exchange.getMessage().getHeader(Exchange.HTTP_RESPONSE_CODE));
-        assertNotNull(exchange.getMessage().getHeader(Exchange.HTTP_RESPONSE_TEXT));
-    }
-
-    @Test
-    public void testCreateUpdateDelete() throws Exception {
-        final Merchandise__c merchandise = new Merchandise__c();
-        merchandise.setName("Wee Wee Wee Plane");
-        merchandise.setDescription__c("Microlite plane");
-        merchandise.setPrice__c(2000.0);
-        merchandise.setTotal_Inventory__c(50.0);
-        final CreateSObjectResult result
-                = template().requestBody("salesforce:createSObject", merchandise, CreateSObjectResult.class);
-        assertNotNull(result);
-        assertTrue(result.getSuccess(), "Create success");
-
-        // test JSON update
-        // make the plane cheaper
-        merchandise.setPrice__c(1500.0);
-        // change inventory to half
-        merchandise.setTotal_Inventory__c(25.0);
-        // also need to set the Id
-        merchandise.setId(result.getId());
-
-        assertNotNull(
-                template().requestBodyAndHeader("salesforce:updateSObject", merchandise, SalesforceEndpointConfig.SOBJECT_ID,
-                        result.getId()));
-
-        // delete the newly created SObject
-        assertNotNull(template().requestBody("salesforce:deleteSObject?sObjectName=Merchandise__c", result.getId()));
-    }
-
-    @Test
-    public void testRelationshipCreateDelete() throws Exception {
-        final Account account = new Account();
-        account.setName("Account 1");
-        String accountExternalId = UUID.randomUUID().toString();
-        account.setExternal_Id__c(accountExternalId);
-        final CreateSObjectResult accountResult
-                = template().requestBody("salesforce:createSObject", account, CreateSObjectResult.class);
-        assertNotNull(accountResult);
-        assertTrue(accountResult.getSuccess(), "Create success");
-
-        final Account accountRef = new Account();
-        accountRef.setExternal_Id__c(accountExternalId);
-        final Contact contact = new Contact();
-        contact.setAccount(accountRef);
-        contact.setLastName("RelationshipTest");
-        final CreateSObjectResult contactResult
-                = template().requestBody("salesforce:createSObject", contact, CreateSObjectResult.class);
-        assertNotNull(contactResult);
-        assertTrue(contactResult.getSuccess(), "Create success");
-
-        // delete the Contact
-        template().requestBodyAndHeader("salesforce:deleteSObject", contactResult.getId(), "sObjectName", "Contact");
-
-        // delete the Account
-        template().requestBodyAndHeader("salesforce:deleteSObject", accountResult.getId(), "sObjectName", "Account");
-    }
-
-    @Test
-    public void testFieldsToNull() throws Exception {
-        final Account account = new Account();
-        account.setName("Account 1");
-        account.setSite("test site");
-        final CreateSObjectResult accountResult
-                = template().requestBody("salesforce:createSObject", account, CreateSObjectResult.class);
-        assertNotNull(accountResult);
-        assertTrue(accountResult.getSuccess(), "Create success");
-
-        account.setId(accountResult.getId());
-        account.setSite(null);
-        account.getFieldsToNull().add("Site");
-
-        final Object updateAccountResult = template().requestBodyAndHeader("salesforce:updateSObject", account,
-                SalesforceEndpointConfig.SOBJECT_ID, account.getId());
-        assertNotNull(updateAccountResult);
-
-        Account updatedAccount = (Account) template().requestBodyAndHeader("salesforce:getSObject?sObjectFields=Id,Name,Site",
-                account.getId(), "sObjectName", "Account");
-        assertNull(updatedAccount.getSite());
-
-        // delete the Account
-        template().requestBodyAndHeader("salesforce:deleteSObject", accountResult.getId(), "sObjectName", "Account");
-    }
-
-    @Test
-    public void testRelationshipUpdate() throws Exception {
-        final Contact contact = new Contact();
-        contact.setLastName("RelationshipTest");
-        final CreateSObjectResult contactResult
-                = template().requestBody("salesforce:createSObject", contact, CreateSObjectResult.class);
-        assertNotNull(contactResult);
-        assertTrue(contactResult.getSuccess(), "Create success");
-
-        final Account account = new Account();
-        account.setName("Account 1");
-        String accountExternalId = UUID.randomUUID().toString();
-        account.setExternal_Id__c(accountExternalId);
-        final CreateSObjectResult accountResult
-                = template().requestBody("salesforce:createSObject", account, CreateSObjectResult.class);
-        assertNotNull(accountResult);
-        assertTrue(accountResult.getSuccess(), "Create success");
-
-        final Account accountRef = new Account();
-        accountRef.setExternal_Id__c(accountExternalId);
-        contact.setAccount(accountRef);
-        contact.setId(contactResult.getId());
-
-        final Object updateContactResult = template().requestBodyAndHeader("salesforce:updateSObject", contact,
-                SalesforceEndpointConfig.SOBJECT_ID, contact.getId());
-        assertNotNull(updateContactResult);
-
-        // delete the Contact
-        template().requestBodyAndHeader("salesforce:deleteSObject", contactResult.getId(), "sObjectName", "Contact");
-
-        // delete the Account
-        template().requestBodyAndHeader("salesforce:deleteSObject", accountResult.getId(), "sObjectName", "Account");
-    }
-
-    @Test
-    public void testCreateUpdateDeleteTasks() throws Exception {
-        final Task taken = new Task();
-        taken.setDescription("Task1");
-        taken.setActivityDate(ZonedDateTime.of(1700, 1, 2, 3, 4, 5, 6, ZoneId.systemDefault()));
-        final CreateSObjectResult result = template().requestBody("salesforce:createSObject", taken, CreateSObjectResult.class);
-        assertNotNull(result);
-        assertTrue(result.getSuccess(), "Create success");
-
-        // test JSON update
-        // make the plane cheaper
-        taken.setId(result.getId());
-        taken.setActivityDate(ZonedDateTime.of(1991, 1, 2, 3, 4, 5, 6, ZoneId.systemDefault()));
-
-        assertNotNull(template().requestBodyAndHeader("salesforce:updateSObject", taken, SalesforceEndpointConfig.SOBJECT_ID,
-                result.getId()));
-
-        // delete the newly created SObject
-        assertNotNull(template().requestBody("salesforce:deleteSObject?sObjectName=Task", result.getId()));
-    }
-
-    @Test
-    public void testCreateUpdateDeleteWithId() throws Exception {
-        Line_Item__c lineItem = new Line_Item__c();
-        final String lineItemId = String.valueOf(TEST_LINE_ITEM_ID.incrementAndGet());
-        lineItem.setName(lineItemId);
-        CreateSObjectResult result = template().requestBody("direct:createLineItem", lineItem, CreateSObjectResult.class);
-        assertNotNull(result);
-        assertTrue(result.getSuccess());
-
-        // get line item with Name 1
-        lineItem = template().requestBody("salesforce:getSObjectWithId?sObjectIdName=Name&sObjectName=Line_Item__c",
-                lineItemId, Line_Item__c.class);
-        assertNotNull(lineItem);
-
-        // test insert with id
-        // set the unit price and sold
-        lineItem.setUnit_Price__c(1000.0);
-        lineItem.setUnits_Sold__c(50.0);
-        // update line item with Name NEW_LINE_ITEM_ID
-        final String newLineItemId = String.valueOf(NEW_LINE_ITEM_ID.incrementAndGet());
-        lineItem.setName(newLineItemId);
-
-        UpsertSObjectResult upsertResult = template().requestBodyAndHeader("direct:upsertSObject", lineItem,
-                SalesforceEndpointConfig.SOBJECT_EXT_ID_VALUE, newLineItemId, UpsertSObjectResult.class);
-        assertNotNull(upsertResult);
-        assertTrue(upsertResult.getSuccess());
-
-        // clear read only parent type fields
-        lineItem.setMerchandise__c(null);
-        // change the units sold
-        lineItem.setUnits_Sold__c(25.0);
-
-        // update line item with Name NEW_LINE_ITEM_ID
-        upsertResult = template().requestBodyAndHeader("direct:upsertSObject", lineItem,
-                SalesforceEndpointConfig.SOBJECT_EXT_ID_VALUE, newLineItemId, UpsertSObjectResult.class);
-        assertNotNull(upsertResult);
-
-        // delete the SObject with Name NEW_LINE_ITEM_ID
-        assertNotNull(template().requestBody("direct:deleteSObjectWithId", newLineItemId));
-    }
-
-    @Test
-    public void testUpsert() throws Exception {
-        Line_Item__c lineItem = new Line_Item__c();
-        final String lineItemId = String.valueOf(TEST_LINE_ITEM_ID.incrementAndGet());
-        lineItem.setName(lineItemId);
-        UpsertSObjectResult result = template().requestBody("direct:upsertSObject", lineItem, UpsertSObjectResult.class);
-        assertNotNull(result);
-        assertNotNull(lineItem.getName());
-        assertTrue(result.getSuccess());
-        assertTrue(result.getCreated());
-    }
-
-    @Test
-    public void testGetBasicInfo() throws Exception {
-        final SObjectBasicInfo objectBasicInfo = template().requestBody("direct:getBasicInfo", null, SObjectBasicInfo.class);
-        assertNotNull(objectBasicInfo);
-
-        // set test Id for testGetSObject
-        assertFalse(objectBasicInfo.getRecentItems().isEmpty(), "RecentItems is empty");
-        merchandiseId = objectBasicInfo.getRecentItems().get(0).getId();
-    }
-
-    @Test
-    public void testGetBlobField() throws Exception {
-        // get document with Name "Test Document"
-        final HashMap<String, Object> headers = new HashMap<>();
-        headers.put(SalesforceEndpointConfig.SOBJECT_NAME, "Document");
-        headers.put(SalesforceEndpointConfig.SOBJECT_EXT_ID_NAME, "Name");
-        final Document document
-                = template().requestBodyAndHeaders("salesforce:getSObjectWithId", TEST_DOCUMENT_ID, headers, Document.class);
-        assertNotNull(document);
-
-        // get Body field for this document
-        try (final InputStream body = template().requestBody("direct:getBlobField", document, InputStream.class)) {
-            assertNotNull(body);
-            assertTrue(body.available() > 0);
-        }
-    }
-
-    @Test
-    public void testUploadBlob() throws Exception {
-        final InputStream inputStream = this.getClass().getResourceAsStream("/camel-test-doc.pdf");
-        final byte[] bytes = inputStream.readAllBytes();
-        ObjectMapper mapper = new ObjectMapper();
-        String enc = mapper.convertValue(bytes, String.class);
-        ContentVersion cv = new ContentVersion();
-        cv.setVersionDataUrl(enc);
-        cv.setPathOnClient("camel-test-doc.pdf");
-        cv.setTitle("Camel Test Doc");
-        final CreateSObjectResult result =
-                template.requestBody("salesforce:createSObject", cv, CreateSObjectResult.class);
-        assertNotNull(result.getId());
-    }
-
-    @Test
-    public void testGetDescription() throws Exception {
-        final SObjectDescription sObjectDescription
-                = template().requestBody("direct:getDescription", null, SObjectDescription.class);
-        assertNotNull(sObjectDescription);
-    }
-
-    @Test
-    public void testGetGlobalObjects() throws Exception {
-        final GlobalObjects globalObjects = template().requestBody("direct:getGlobalObjects", null, GlobalObjects.class);
-        assertNotNull(globalObjects);
-    }
-
-    @Test
-    public void testGetResources() throws Exception {
-        @SuppressWarnings("unchecked")
-        final Map<String, String> resources = (Map<String, String>) template().requestBody("direct:getResources", "");
-        assertNotNull(resources);
-        assertTrue(resources.containsKey("metadata"));
-    }
-
-    @Test
-    public void testGetSObject() throws Exception {
-        final Merchandise__c merchandise = template().requestBody("direct:getSObject", merchandiseId, Merchandise__c.class);
-        assertNotNull(merchandise);
-
-        assertNull(merchandise.getTotal_Inventory__c());
-        assertNotNull(merchandise.getPrice__c());
-    }
-
-    @Test
-    public void testGetVersions() throws Exception {
-        // test getVersions doesn't need a body
-        // assert expected result
-        final Object o = template().requestBody("direct:getVersions", (Object) null);
-        List<Version> versions = null;
-        if (o instanceof Versions) {
-            versions = ((Versions) o).getVersions();
-        } else {
-            @SuppressWarnings("unchecked")
-            final List<Version> tmp = (List<Version>) o;
-            versions = tmp;
-        }
-        assertNotNull(versions);
-    }
-
-    @Test
-    public void testQuery() throws Exception {
-        createLineItem();
-        final QueryRecordsLine_Item__c queryRecords
-                = template().requestBody("direct:query", null, QueryRecordsLine_Item__c.class);
-        assertNotNull(queryRecords);
-        // verify polymorphic query resulted in the correct type
-        assertEquals(User.class, queryRecords.getRecords().get(0).getOwner().getClass());
-        final Line_Item__c lineItem = queryRecords.getRecords().get(0);
-        User user = (User) queryRecords.getRecords().get(0).getOwner();
-        assertNotNull(user.getUsername());
-        assertNotNull(lineItem.getRecordType());
-    }
-
-    @Test
-    public void testQueryDetectResponseClass() throws Exception {
-        createLineItem();
-        final QueryRecordsLine_Item__c queryRecords
-                = template().requestBody("direct:queryDetectResponseClass", null, QueryRecordsLine_Item__c.class);
-        assertNotNull(queryRecords);
-    }
-
-    @Test
-    public void testQueryWithSObjectName() throws Exception {
-        createLineItem();
-        final QueryRecordsLine_Item__c queryRecords
-                = template().requestBody("direct:queryWithSObjectName", null, QueryRecordsLine_Item__c.class);
-        assertNotNull(queryRecords);
-        // verify polymorphic query resulted in the correct type
-        assertEquals(User.class, queryRecords.getRecords().get(0).getOwner().getClass());
-        final Line_Item__c lineItem = queryRecords.getRecords().get(0);
-        User user = (User) queryRecords.getRecords().get(0).getOwner();
-        assertNotNull(user.getUsername());
-        assertNotNull(lineItem.getRecordType());
-    }
-
-    @Test
-    public void testQueryStreamResults() throws Exception {
-        final int createCount = 300;
-        createLineItems(createCount);
-        Exchange exchange = new DefaultExchange(context);
-        template().send("direct:queryStreamResult", exchange);
-        Iterator<?> queryRecords = exchange.getMessage(Iterator.class);
-        assertNotNull(exchange.getMessage().getHeader("CamelSalesforceQueryResultTotalSize"));
-        int count = 0;
-        while (queryRecords.hasNext()) {
-            count = count + 1;
-            queryRecords.next();
-        }
-        assertTrue(count >= createCount);
-    }
-
-    @Test
-    public void querySyncAsyncDoesntTimeout() throws Exception {
-        final Object result = template.requestBody("direct:querySyncAsync", "");
-        assertNotNull(result);
-    }
-
-    @Test
-    public void testParentRelationshipQuery() throws Exception {
-        try {
-            createAccountAndContact();
-            final QueryRecordsContact queryRecords
-                    = template().requestBody("direct:parentRelationshipQuery", null, QueryRecordsContact.class);
-            Account account = queryRecords.getRecords().get(0).getAccount();
-            assertNotNull(account, "Account was null");
-        } finally {
-            deleteAccountAndContact();
-        }
-    }
-
-    @Test
-    public void testChildRelationshipQuery() throws Exception {
-        try {
-            createAccountAndContact();
-            final QueryRecordsAccount queryRecords
-                    = template().requestBody("direct:childRelationshipQuery", null, QueryRecordsAccount.class);
-
-            assertFalse(queryRecords.getRecords().isEmpty());
-            Account account1 = queryRecords.getRecords().get(0);
-            assertFalse(account1.getContacts().getRecords().isEmpty());
-        } finally {
-            deleteAccountAndContact();
-        }
-    }
-
-    @Test
-    public void testQueryAll() throws Exception {
-        final QueryRecordsLine_Item__c queryRecords
-                = template().requestBody("direct:queryAll", null, QueryRecordsLine_Item__c.class);
-        assertNotNull(queryRecords);
-    }
-
-    @Test
-    public void testQueryAllStreamResults() throws Exception {
-        final int createCount = 300;
-        createLineItems(createCount);
-        final Iterator<Line_Item__c> queryRecords
-                = template().requestBody("direct:queryAllStreamResult", "", Iterator.class);
-        int count = 0;
-        while (queryRecords.hasNext()) {
-            count = count + 1;
-            queryRecords.next();
-        }
-        assertTrue(count >= createCount);
-    }
-
-    @Test
-    public void testRetry() throws Exception {
-        final SalesforceComponent sf = context().getComponent("salesforce", SalesforceComponent.class);
-        final String accessToken = sf.getSession().getAccessToken();
-
-        final SslContextFactory.Client sslContextFactory = new SslContextFactory.Client();
-        sslContextFactory.setSslContext(new SSLContextParameters().createSSLContext(context));
-        final ClientConnector connector = new ClientConnector();
-        connector.setSslContextFactory(sslContextFactory);
-        final HttpClientTransport transport = new HttpClientTransportOverHTTP(connector);
-        final HttpClient httpClient = new HttpClient(transport);
-        httpClient.setConnectTimeout(60000);
-        httpClient.start();
-
-        final String uri = sf.getLoginConfig().getLoginUrl() + "/services/oauth2/revoke?token=" + accessToken;
-        final Request logoutGet = httpClient.newRequest(uri).method(HttpMethod.GET).timeout(1, TimeUnit.MINUTES);
-
-        final ContentResponse response = logoutGet.send();
-        assertEquals(HttpStatus.OK_200, response.getStatus());
-
-        testGetGlobalObjects();
-    }
-
-    @Test
-    public void testRetryFailure() throws Exception {
-        final SalesforceComponent sf = context().getComponent("salesforce", SalesforceComponent.class);
-        final String accessToken = sf.getSession().getAccessToken();
-
-        final SslContextFactory.Client sslContextFactory = new SslContextFactory.Client();
-        sslContextFactory.setSslContext(new SSLContextParameters().createSSLContext(context));
-        final ClientConnector connector = new ClientConnector();
-        connector.setSslContextFactory(sslContextFactory);
-        final HttpClientTransport transport = new HttpClientTransportOverHTTP(connector);
-        final HttpClient httpClient = new HttpClient(transport);
-        httpClient.setConnectTimeout(60000);
-        httpClient.start();
-
-        final String uri = sf.getLoginConfig().getLoginUrl() + "/services/oauth2/revoke?token=" + accessToken;
-        final Request logoutGet = httpClient.newRequest(uri).method(HttpMethod.GET).timeout(1, TimeUnit.MINUTES);
-
-        final ContentResponse response = logoutGet.send();
-        assertEquals(HttpStatus.OK_200, response.getStatus());
-
-        // set component config to bad password to cause relogin attempts to
-        // fail
-        final String password = sf.getLoginConfig().getPassword();
-        sf.getLoginConfig().setPassword("bad_password");
-
-        try {
-            testGetGlobalObjects();
-            fail("Expected CamelExecutionException!");
-        } catch (final CamelExecutionException e) {
-            if (e.getCause() instanceof SalesforceException) {
-                final SalesforceException cause = (SalesforceException) e.getCause();
-                assertEquals(HttpStatus.BAD_REQUEST_400, cause.getStatusCode(), "Expected 400 on authentication retry failure");
-            } else {
-                fail("Expected SalesforceException!");
-            }
-        } finally {
-            // reset password and retries to allow other tests to pass
-            sf.getLoginConfig().setPassword(password);
-        }
-    }
-
-    @Test
-    public void testSearch() throws Exception {
-
-        final Object obj = template().requestBody("direct:search", (Object) null);
-        assertNotNull(obj);
-    }
-
-    @Test
-    public void testStatus300() throws Exception {
-        // get test merchandise
-        // note that the header value overrides sObjectFields in endpoint
-        final Merchandise__c merchandise = template().requestBodyAndHeader("direct:getSObject", merchandiseId, "sObjectFields",
-                "Name,Description__c,Price__c,Total_Inventory__c",
-                Merchandise__c.class);
-        assertNotNull(merchandise);
-        assertNotNull(merchandise.getName());
-        assertNotNull(merchandise.getPrice__c());
-        assertNotNull(merchandise.getTotal_Inventory__c());
-
-        CreateSObjectResult result = null;
-        try {
-            merchandise.clearBaseFields();
-            result = template().requestBody("salesforce:createSObject", merchandise, CreateSObjectResult.class);
-            assertNotNull(result);
-            assertNotNull(result.getId());
-
-            // look by external Id to cause 300 error
-            // note that the request SObject overrides settings on the endpoint
-            // for LineItem__c
-            try {
-                template().requestBody("salesforce:getSObjectWithId?sObjectIdName=Name", merchandise, Merchandise__c.class);
-                fail("Expected SalesforceException with statusCode 300");
-            } catch (final CamelExecutionException e) {
-                final Throwable cause = e.getCause();
-                assertTrue(cause instanceof SalesforceMultipleChoicesException);
-                final SalesforceMultipleChoicesException multipleChoices = (SalesforceMultipleChoicesException) cause;
-                assertEquals(300, multipleChoices.getStatusCode());
-                final List<String> choices = multipleChoices.getChoices();
-                assertNotNull(choices);
-                assertFalse(choices.isEmpty());
-            }
-        } finally {
-            // delete the test clone
-            if (result != null) {
-                template().requestBody("salesforce:deleteSObject?sObjectName=Merchandise__c", result.getId());
-            }
-        }
-    }
-
-    @Test
-    public void testStatus400() throws Exception {
-        // get test merchandise
-        // note that the header value overrides sObjectFields in endpoint
-        final Merchandise__c merchandise = template().requestBodyAndHeader("direct:getSObject", merchandiseId, "sObjectFields",
-                "Description__c,Price__c", Merchandise__c.class);
-        assertNotNull(merchandise);
-        assertNotNull(merchandise.getPrice__c());
-        assertNull(merchandise.getTotal_Inventory__c());
-
-        merchandise.clearBaseFields();
-        // required field Total_Inventory__c is missing
-        CreateSObjectResult result = null;
-        try {
-            result = template().requestBody("salesforce:createSObject", merchandise, CreateSObjectResult.class);
-            fail("Expected SalesforceException with statusCode 400");
-        } catch (final CamelExecutionException e) {
-            final Throwable cause = e.getCause();
-            assertTrue(cause instanceof SalesforceException);
-            final SalesforceException badRequest = (SalesforceException) cause;
-            assertEquals(400, badRequest.getStatusCode());
-            assertEquals(1, badRequest.getErrors().size());
-            assertEquals("[Total_Inventory__c]", badRequest.getErrors().get(0).getFields().toString());
-        } finally {
-            // delete the clone if created
-            if (result != null) {
-                template().requestBody("salesforce:deleteSObject", result.getId());
-            }
-        }
-    }
-
-    @Test
-    public void testStatus404() throws Exception {
-        // try to get a non existent SObject
-        try {
-            template().requestBody("direct:getSObject", "ILLEGAL_ID", Merchandise__c.class);
-            fail("Expected SalesforceException");
-        } catch (final CamelExecutionException e) {
-            final Throwable cause = e.getCause();
-            assertTrue(cause instanceof NoSuchSObjectException);
-            final NoSuchSObjectException noSuchObject = (NoSuchSObjectException) cause;
-            assertEquals(404, noSuchObject.getStatusCode());
-            assertEquals(1, noSuchObject.getErrors().size());
-        }
-    }
-
-    @Test
-    public void testFetchingGlobalObjects() throws Exception {
-        final GlobalObjects globalObjects = template().requestBody("salesforce:getGlobalObjects", null, GlobalObjects.class);
-
-        assertNotNull(globalObjects);
-        assertFalse(globalObjects.getSobjects().isEmpty());
-    }
-
-    @Test
-    public void testBodyIsPreservedAfterError() throws Exception {
-        Contact contact = new Contact();
-
-        final Object result = template.requestBody("direct:createSObjectContinueOnException", contact);
-        assertNotNull(result);
-        assertEquals(contact, result);
-    }
-
-    @Override
-    protected RouteBuilder doCreateRouteBuilder() throws Exception {
-
-        // create test route
-        return new RouteBuilder() {
-            @Override
-            public void configure() {
-
-                // testGetVersion
-                from("direct:getVersions").to("salesforce:getVersions");
-
-                // testGetResources
-                from("direct:getResources").to("salesforce:getResources");
-
-                // testGetGlobalObjects
-                from("direct:getGlobalObjects").to("salesforce:getGlobalObjects");
-
-                // testGetBasicInfo
-                from("direct:getBasicInfo").to("salesforce:getBasicInfo?sObjectName=Merchandise__c");
-
-                // testGetDescription
-                from("direct:getDescription").to("salesforce:getDescription?sObjectName=Merchandise__c");
-
-                // testGetSObject
-                from("direct:getSObject")
-                        .to("salesforce:getSObject?sObjectName=Merchandise__c&sObjectFields=Description__c,Price__c");
-
-                from("direct:deleteLineItems")
-                        .to("salesforce:query?sObjectQuery=SELECT Id FROM Line_Item__C&sObjectClass="
-                            + QueryRecordsLine_Item__c.class.getName())
-                        .filter(simple("${body.records.size} > 0"))
-                        .split(simple("${body.records}"),
-                                AggregationStrategies.flexible().accumulateInCollection(ArrayList.class))
-                            .transform(simple("${body.id}"))
-                        .end()
-                        .split(simple("${collate(200)}"))
-                            .to("salesforce:compositeDeleteSObjectCollections")
-                        .end();
-
-                from("direct:createLineItem").to("salesforce:createSObject?sObjectName=Line_Item__c");
-
-                from("direct:createLineItems")
-                        .split(simple("${collate(200)}"))
-                        .to("salesforce:compositeCreateSObjectCollections");
-
-                from("direct:upsertSObject")
-                        .to("salesforce:upsertSObject?sObjectName=Line_Item__c&sObjectIdName=Name");
-
-                // testDeleteSObjectWithId
-                from("direct:deleteSObjectWithId")
-                        .to("salesforce:deleteSObjectWithId?sObjectName=Line_Item__c&sObjectIdName=Name");
-
-                // testGetBlobField
-                from("direct:getBlobField")
-                        .to("salesforce:getBlobField?sObjectName=Document&sObjectBlobFieldName=Body");
-
-                // testQuery
-                from("direct:queryDetectResponseClass")
-                        .to("salesforce:query?sObjectQuery=SELECT Id, name, Typeof Owner WHEN User Then Username End, recordTypeId, RecordType.Name "
-                            + "from Line_Item__c "
-                            + "ORDER BY CreatedDate DESC "
-                            + "LIMIT 1");
-
-                // testQuery
-                from("direct:query")
-                        .to("salesforce:query?sObjectQuery=SELECT Id, name, Typeof Owner WHEN User Then Username End, recordTypeId, RecordType.Name "
-                            + "from Line_Item__c "
-                            + "ORDER BY CreatedDate DESC "
-                            + "LIMIT 1"
-                            + "&sObjectClass=" + QueryRecordsLine_Item__c.class.getName());
-
-                // testQuery
-                from("direct:queryWithSObjectName")
-                        .to("salesforce:query?sObjectQuery=SELECT Id, name, Typeof Owner WHEN User Then Username End, recordTypeId, RecordType.Name from Line_Item__c"
-                            + "&sObjectName=QueryRecordsLine_Item__c");
-
-                // testQuery
-                from("direct:queryStreamResult")
-                        .setHeader("sObjectClass", constant(QueryRecordsLine_Item__c.class.getName()))
-                        .setHeader("Sforce-Query-Options", constant("batchSize=200"))
-                        .to("salesforce:query?sObjectQuery=SELECT Id, name, Typeof Owner WHEN User Then Username End, recordTypeId, RecordType.Name from Line_Item__c Order By Name"
-                            + "&streamQueryResult=true");
-
-                // testQuery
-                from("direct:queryAllStreamResult")
-                        .setHeader("sObjectClass", constant(QueryRecordsLine_Item__c.class.getName()))
-                        .setHeader("Sforce-Query-Options", constant("batchSize=200"))
-                        .to("salesforce:queryAll?sObjectQuery=SELECT Id, name, Typeof Owner WHEN User Then Username End, recordTypeId, RecordType.Name from Line_Item__c Order By Name"
-                            + "&streamQueryResult=true");
-
-                // testParentRelationshipQuery
-                from("direct:parentRelationshipQuery")
-                        .process(exchange -> exchange.getIn()
-                                .setBody("SELECT LastName, Account.Name FROM Contact WHERE Id = '" + contactId + "'"))
-                        .to("salesforce:query?sObjectClass=" + QueryRecordsContact.class.getName() + "");
-
-                // testChildRelationshipQuery
-                from("direct:childRelationshipQuery")
-                        .process(exchange -> exchange.getIn()
-                                .setBody("SELECT Id, Name, (SELECT Id, LastName FROM Contacts)" + " FROM Account WHERE Id = '"
-                                         + accountId + "'"))
-                        .to("salesforce:query?sObjectClass=" + QueryRecordsAccount.class.getName() + "");
-
-                // testQueryAll
-                from("direct:queryAll")
-                        .to("salesforce:queryAll?sObjectQuery=SELECT name from Line_Item__c&sObjectClass="
-                            + QueryRecordsLine_Item__c.class.getName() + "");
-
-                from("direct:querySyncAsync")
-                        .to("direct:querySync")
-                        .to("direct:queryAsync");
-
-                from("direct:querySync?synchronous=false").routeId("r.querySync")
-                        .to("salesforce:query?rawPayload=true&sObjectQuery=Select Id From Contact Where Name = 'Sync'");
-
-                from("direct:queryAsync?synchronous=true").routeId("r.queryAsync")
-                        .to("salesforce:query?rawPayload=true&sObjectQuery=Select Id From Contact  Where Name = 'Sync'");
-
-                // testSearch
-                from("direct:search").to("salesforce:search?sObjectSearch=FIND {Wee}");
-
-                // testApexCall
-                from("direct:apexCallGet")
-                        .to("salesforce:apexCall?apexMethod=GET&apexUrl=Merchandise/{id}&sObjectName=Merchandise__c");
-
-                // testApexCall
-                from("direct:apexCallGetDetectResponseType")
-                        .to("salesforce:apexCall?apexMethod=GET&apexUrl=Merchandise/{id}");
-
-                from("direct:apexCallGetWithId")
-                        .to("salesforce:apexCall/Merchandise/?apexMethod=GET&id=dummyId" + "&sObjectClass="
-                            + Merchandise__c.class.getName());
-
-                from("direct:apexCallPatch").to("salesforce:apexCall/Merchandise/"
-                                                + "?apexMethod=PATCH&sObjectClass=" + MerchandiseResponse.class.getName());
-
-                from("direct:apexCallPostCustomError").to("salesforce:apexCall/Merchandise/"
-                                                          + "?apexMethod=POST&sObjectClass=java.lang.String");
-
-                from("direct:createSObjectContinueOnException").onException(Exception.class).continued(true).end()
-                        .to("salesforce:createSObject");
-            }
-        };
-    }
+	/**

Review Comment:
   Wrong indent too



##########
test-infra/camel-test-infra-jetty/src/test/java/org/apache/camel/test/infra/jetty/services/JettyConfiguration.java:
##########
@@ -251,13 +251,15 @@ private SecurityHandler basicAuth(List<KeyValueHolder<String, String>> userInfoL
             l.setName(realm);
             l.setUserStore(us);
 
-            Constraint constraint = new Constraint();
-            constraint.setName(Constraint.__BASIC_AUTH);
-            constraint.setRoles(new String[] { "user" });
-            constraint.setAuthenticate(true);
+            Constraint.Builder constraintBuilder = new Constraint.Builder();
+            constraintBuilder.name("Basic Auth");
+            constraintBuilder.roles("user");
+            //            constraint.setName(Constraint.__BASIC_AUTH);
+            //            constraint.setRoles(new String[] { "user" });
+            //            constraint.setAuthenticate(true);

Review Comment:
   Can be removed



##########
components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceHttpClient.java:
##########
@@ -97,15 +97,14 @@ private static ClientConnector newConnector(SslContextFactory.Client sslContextF
         return connector;
     }
 
-    @Override
     public HttpRequest newHttpRequest(HttpConversation conversation, URI uri) {
         final SalesforceHttpRequest request = new SalesforceHttpRequest(this, conversation, uri);
         request.timeout(timeout, TimeUnit.MILLISECONDS);
         return request;
     }
 
     @Override
-    public Request copyRequest(HttpRequest oldRequest, URI newURI) {
+    public  Request copyRequest(Request oldRequest, URI newURI) {

Review Comment:
   Please remove the useless extra space added



##########
components/camel-salesforce/camel-salesforce-codegen/src/main/java/org/apache/camel/component/salesforce/codegen/AbstractSalesforceExecution.java:
##########
@@ -37,13 +37,7 @@
 import org.apache.camel.support.jsse.SSLContextParameters;
 import org.apache.camel.support.service.ServiceHelper;
 import org.apache.camel.util.StringHelper;
-import org.eclipse.jetty.client.HttpProxy;
-import org.eclipse.jetty.client.Origin;
-import org.eclipse.jetty.client.ProxyConfiguration;
-import org.eclipse.jetty.client.Socks4Proxy;
-import org.eclipse.jetty.client.api.Authentication;
-import org.eclipse.jetty.client.util.BasicAuthentication;
-import org.eclipse.jetty.client.util.DigestAuthentication;
+import org.eclipse.jetty.client.*;

Review Comment:
   ditto



##########
components/camel-platform-http/src/test/java/org/apache/camel/component/platform/http/JettyCustomPlatformHttpConsumer.java:
##########
@@ -16,14 +16,12 @@
  */
 package org.apache.camel.component.platform.http;
 
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
+import java.io.*;

Review Comment:
   ditto



##########
components/camel-cxf/camel-cxf-rest/src/main/java/org/apache/camel/component/cxf/jaxrs/DefaultCxfRsBinding.java:
##########
@@ -212,13 +207,15 @@ public Object bindCamelMessageBodyToRequestBody(Message camelMessage, Exchange c
             throws Exception {
 
         Object request = camelMessage.getBody(MessageContentsList.class);
-        if (request != null) {
+        if (request != null && request instanceof MessageContentsList) {
             return ((MessageContentsList) request).get(0);
         }
 
         request = camelMessage.getBody();
         if (request instanceof List) {
             request = ((List<?>) request).get(0);
+        } else if (request != null && request instanceof byte[]) {

Review Comment:
   ditto



##########
components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/internal/client/AbstractClientBaseTest.java:
##########
@@ -31,175 +26,175 @@
 import org.apache.camel.impl.DefaultCamelContext;
 import org.apache.camel.support.DefaultExchange;
 import org.apache.camel.support.DefaultMessage;
-import org.eclipse.jetty.client.HttpConversation;
-import org.eclipse.jetty.client.api.Request;
-import org.eclipse.jetty.client.api.Response;
-import org.eclipse.jetty.client.api.Response.CompleteListener;
-import org.eclipse.jetty.client.api.Result;
+import org.eclipse.jetty.client.Request;
+import org.eclipse.jetty.client.Response;
+import org.eclipse.jetty.client.Result;
+import org.eclipse.jetty.client.transport.HttpConversation;
 import org.eclipse.jetty.http.HttpFields;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 import org.mockito.ArgumentCaptor;
 
+import java.io.InputStream;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ExecutorService;
+
 import static java.util.Arrays.asList;
 import static java.util.Collections.singletonList;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.entry;
 import static org.junit.jupiter.api.Assertions.assertTrue;
-import static org.mockito.Mockito.doNothing;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.never;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
+import static org.mockito.Mockito.*;
 
 public class AbstractClientBaseTest {
-    static class Client extends AbstractClientBase {
-        Client(final SalesforceSession session, final SalesforceLoginConfig loginConfig) throws SalesforceException {
-            super(null, session, mock(SalesforceHttpClient.class), loginConfig,
-                  1 /* 1 second termination timeout */);
-        }
-
-        @Override
-        protected SalesforceException createRestException(final Response response, final InputStream responseContent) {
-            return null;
-        }
+	static class Client extends AbstractClientBase {

Review Comment:
   ditto



##########
components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/internal/SalesforceSessionTest.java:
##########
@@ -16,101 +16,99 @@
  */
 package org.apache.camel.component.salesforce.internal;
 
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.TimeoutException;
-
 import org.apache.camel.component.salesforce.SalesforceHttpClient;
 import org.apache.camel.component.salesforce.SalesforceLoginConfig;
 import org.apache.camel.component.salesforce.api.SalesforceException;
 import org.apache.camel.impl.DefaultCamelContext;
 import org.apache.camel.support.jsse.KeyStoreParameters;
-import org.eclipse.jetty.client.api.ContentResponse;
-import org.eclipse.jetty.client.api.Request;
+import org.eclipse.jetty.client.ContentResponse;
+import org.eclipse.jetty.client.Request;
 import org.eclipse.jetty.http.HttpStatus;
 import org.junit.jupiter.api.Test;
 
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.TimeoutException;
+
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertNotNull;
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.ArgumentMatchers.anyLong;
-import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.ArgumentMatchers.*;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
 public class SalesforceSessionTest {
 
-    private static final int TIMEOUT = 1;
+	private static final int TIMEOUT = 1;
 
-    private final KeyStoreParameters parameters;
+	private final KeyStoreParameters parameters;

Review Comment:
   ditto



##########
components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/SalesforceSecurityHandler.java:
##########
@@ -26,15 +26,9 @@
 import org.apache.camel.component.salesforce.api.SalesforceException;
 import org.apache.camel.component.salesforce.api.dto.RestError;
 import org.apache.camel.component.salesforce.internal.SalesforceSession;
-import org.eclipse.jetty.client.HttpContentResponse;
-import org.eclipse.jetty.client.HttpConversation;
-import org.eclipse.jetty.client.ProtocolHandler;
-import org.eclipse.jetty.client.ResponseNotifier;
-import org.eclipse.jetty.client.api.ContentResponse;
-import org.eclipse.jetty.client.api.Request;
-import org.eclipse.jetty.client.api.Response;
-import org.eclipse.jetty.client.api.Result;
-import org.eclipse.jetty.client.util.BufferingResponseListener;
+import org.eclipse.jetty.client.*;

Review Comment:
   ditto



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-19991: Jetty and SB upgrades [camel]

Posted by "essobedo (via GitHub)" <gi...@apache.org>.
essobedo commented on code in PR #12208:
URL: https://github.com/apache/camel/pull/12208#discussion_r1410377989


##########
components/camel-cxf/camel-cxf-rest/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducer.java:
##########
@@ -24,11 +24,7 @@
 import java.net.CookieStore;
 import java.net.HttpCookie;
 import java.net.URLDecoder;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;

Review Comment:
   Please avoid wildcard import 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-19991: Jetty and SB upgrades [camel]

Posted by "Croway (via GitHub)" <gi...@apache.org>.
Croway commented on code in PR #12208:
URL: https://github.com/apache/camel/pull/12208#discussion_r1410509475


##########
components/camel-jetty/src/test/java/org/apache/camel/component/jetty/MultiPartFormTest.java:
##########
@@ -98,7 +98,8 @@ public void process(Exchange exchange) throws Exception {
                         // "text/plain", data.getContentType());
                         assertEquals("log4j2.properties", data.getName(), "Got the wrong name");
 
-                        assertTrue(data.getDataSource().getInputStream().available() > 0,
+                        String fileContent = new String(data.getDataSource().getInputStream().readAllBytes());
+                        assertTrue(fileContent.length() > 0,

Review Comment:
   oh yeah, nice, this way the whole stream won't loaded in memory, thanks



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-19991: Jetty and SB upgrades [camel]

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on code in PR #12208:
URL: https://github.com/apache/camel/pull/12208#discussion_r1410511605


##########
components/camel-jetty/src/main/java/org/apache/camel/component/jetty11/CamelInputStreamContentProvider.java:
##########
@@ -18,9 +18,9 @@
 
 import java.io.InputStream;
 
-import org.eclipse.jetty.client.util.InputStreamContentProvider;
+import org.eclipse.jetty.io.content.InputStreamContentSource;
 
-public class CamelInputStreamContentProvider extends InputStreamContentProvider {
+public class CamelInputStreamContentProvider extends InputStreamContentSource {

Review Comment:
   Yes it makes sense to rename package from 11 to 12 wherever



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org