You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2023/08/23 15:00:16 UTC

[camel] branch fixes created (now 00f0c1f0659)

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a change to branch fixes
in repository https://gitbox.apache.org/repos/asf/camel.git


      at 00f0c1f0659 CAMEL-19785: camel-yaml-dsl - Order of beans should not matter

This branch includes the following new commits:

     new 1c1586dce9e CAMEL-19784: camel-core - PropertyBindingSupport - mandatory reference should fail if cannot resolve bean
     new fd39feea779 Regen
     new 00f0c1f0659 CAMEL-19785: camel-yaml-dsl - Order of beans should not matter

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[camel] 03/03: CAMEL-19785: camel-yaml-dsl - Order of beans should not matter

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch fixes
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 00f0c1f0659188b2a26a377fd10261db8fd6207d
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Wed Aug 23 16:51:39 2023 +0200

    CAMEL-19785: camel-yaml-dsl - Order of beans should not matter
---
 .../dsl/yaml/deserializers/BeansDeserializer.java  | 73 +++++++++++++++-------
 1 file changed, 51 insertions(+), 22 deletions(-)

diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/main/java/org/apache/camel/dsl/yaml/deserializers/BeansDeserializer.java b/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/main/java/org/apache/camel/dsl/yaml/deserializers/BeansDeserializer.java
index 4be1c650219..63f4e81fb37 100644
--- a/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/main/java/org/apache/camel/dsl/yaml/deserializers/BeansDeserializer.java
+++ b/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/main/java/org/apache/camel/dsl/yaml/deserializers/BeansDeserializer.java
@@ -23,7 +23,6 @@ import org.apache.camel.CamelContext;
 import org.apache.camel.dsl.yaml.common.YamlDeserializationContext;
 import org.apache.camel.dsl.yaml.common.YamlDeserializerResolver;
 import org.apache.camel.dsl.yaml.common.YamlDeserializerSupport;
-import org.apache.camel.dsl.yaml.common.YamlSupport;
 import org.apache.camel.model.Model;
 import org.apache.camel.model.app.RegistryBeanDefinition;
 import org.apache.camel.spi.CamelContextCustomizer;
@@ -47,6 +46,7 @@ import org.snakeyaml.engine.v2.nodes.SequenceNode;
 public class BeansDeserializer extends YamlDeserializerSupport implements ConstructNode {
     @Override
     public Object construct(Node node) {
+        final BeansCustomizer answer = new BeansCustomizer();
         final SequenceNode sn = asSequenceNode(node);
         final List<CamelContextCustomizer> customizers = new ArrayList<>();
         final YamlDeserializationContext dc = getDeserializationContext(node);
@@ -65,29 +65,10 @@ public class BeansDeserializer extends YamlDeserializerSupport implements Constr
                 bean.setType("#class:" + bean.getType());
             }
 
-            customizers.add(new CamelContextCustomizer() {
-                @Override
-                public void configure(CamelContext camelContext) {
-                    try {
-                        // to support hot reloading of beans then we need to unbind old existing first
-                        String name = bean.getName();
-                        camelContext.getRegistry().unbind(name);
-                        camelContext.getRegistry().bind(
-                                name,
-                                newInstance(bean, camelContext));
-
-                        // register bean in model
-                        Model model = camelContext.getCamelContextExtension().getContextPlugin(Model.class);
-                        model.addRegistryBean(bean);
-
-                    } catch (Exception e) {
-                        throw new RuntimeException(e);
-                    }
-                }
-            });
+            answer.addBean(bean);
         }
 
-        return YamlSupport.customizer(customizers);
+        return answer;
     }
 
     public Object newInstance(RegistryBeanDefinition bean, CamelContext context) throws Exception {
@@ -100,4 +81,52 @@ public class BeansDeserializer extends YamlDeserializerSupport implements Constr
         return target;
     }
 
+    protected void registerBean(
+            CamelContext camelContext,
+            List<RegistryBeanDefinition> delayedRegistrations,
+            RegistryBeanDefinition def, boolean delayIfFailed) {
+        try {
+            // to support hot reloading of beans then we need to unbind old existing first
+            String name = def.getName();
+            Object bean = newInstance(def, camelContext);
+            camelContext.getRegistry().unbind(name);
+            camelContext.getRegistry().bind(name, bean);
+
+            // register bean in model
+            Model model = camelContext.getCamelContextExtension().getContextPlugin(Model.class);
+            model.addRegistryBean(def);
+
+        } catch (Exception e) {
+            if (delayIfFailed) {
+                delayedRegistrations.add(def);
+            } else {
+                throw new RuntimeException(e);
+            }
+        }
+    }
+
+    private class BeansCustomizer implements CamelContextCustomizer {
+
+        private final List<RegistryBeanDefinition> delayedRegistrations = new ArrayList<>();
+        private final List<RegistryBeanDefinition> beans = new ArrayList<>();
+
+        public void addBean(RegistryBeanDefinition bean) {
+            beans.add(bean);
+        }
+
+        @Override
+        public void configure(CamelContext camelContext) {
+            // first-pass of creating beans
+            for (RegistryBeanDefinition bean : beans) {
+                registerBean(camelContext, delayedRegistrations, bean, true);
+            }
+            beans.clear();
+            // second-pass of creating beans should fail if not possible
+            for (RegistryBeanDefinition bean : delayedRegistrations) {
+                registerBean(camelContext, delayedRegistrations, bean, false);
+            }
+            delayedRegistrations.clear();
+        }
+    }
+
 }


[camel] 01/03: CAMEL-19784: camel-core - PropertyBindingSupport - mandatory reference should fail if cannot resolve bean

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch fixes
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 1c1586dce9ee926a77fa98ed1d496041a5579470
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Wed Aug 23 16:49:08 2023 +0200

    CAMEL-19784: camel-core - PropertyBindingSupport - mandatory reference should fail if cannot resolve bean
---
 .../main/java/org/apache/camel/support/PropertyBindingSupport.java    | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/core/camel-support/src/main/java/org/apache/camel/support/PropertyBindingSupport.java b/core/camel-support/src/main/java/org/apache/camel/support/PropertyBindingSupport.java
index 1b2f7ee6d84..67d0a8179f4 100644
--- a/core/camel-support/src/main/java/org/apache/camel/support/PropertyBindingSupport.java
+++ b/core/camel-support/src/main/java/org/apache/camel/support/PropertyBindingSupport.java
@@ -542,6 +542,10 @@ public final class PropertyBindingSupport {
                 // resolve property placeholders
                 str = camelContext.resolvePropertyPlaceholders(str.toString());
             }
+            if (str == null && reference && mandatory && !optional) {
+                // we could not resolve the reference and this is mandatory
+                throw new PropertyBindingException(target, key, value);
+            }
             value = str;
         } catch (Exception e) {
             // report the exception using the long key and parent target


[camel] 02/03: Regen

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch fixes
in repository https://gitbox.apache.org/repos/asf/camel.git

commit fd39feea7798baa5379f2cac4be32f78962b5b82
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Wed Aug 23 16:49:37 2023 +0200

    Regen
---
 .../org/apache/camel/support/service/ServiceHelper.java    |  2 --
 .../file/FileConsumerBeginRenameStrategyTest.java          |  6 +++---
 .../file/FileConsumerCommitRenameStrategyTest.java         |  1 -
 .../component/file/FileProducerAllowNullBodyTest.java      |  2 +-
 .../camel/component/file/FileProducerMoveExistingTest.java |  1 -
 .../org/apache/camel/component/mock/MockEndpointTest.java  |  2 --
 .../apache/camel/component/xslt/XsltFeatureRouteTest.java  |  3 ++-
 .../org/apache/camel/impl/DefaultClassResolverTest.java    |  2 +-
 .../java/org/apache/camel/impl/DefaultComponentTest.java   | 10 +++++-----
 .../apache/camel/impl/DefaultComponentValidateURITest.java |  3 ++-
 .../camel/impl/DefaultExecutorServiceManagerTest.java      |  3 ++-
 .../camel/impl/DefaultProducerTemplateAsyncTest.java       | 10 ++++++----
 .../org/apache/camel/impl/DefaultProducerTemplateTest.java | 10 +++++-----
 .../DefaultProducerTemplateWithCustomCacheMaxSizeTest.java |  3 ++-
 .../impl/GracefulShutdownNoAutoStartOrderClashTest.java    |  2 +-
 .../camel/issues/AdviceWithInvalidConfiguredTest.java      |  2 +-
 .../apache/camel/issues/ChoiceEndOrEndChoiceIssueTest.java |  2 +-
 .../camel/issues/ExceptionThrownFromOnExceptionTest.java   | 14 +++++++-------
 18 files changed, 39 insertions(+), 39 deletions(-)

diff --git a/core/camel-api/src/main/java/org/apache/camel/support/service/ServiceHelper.java b/core/camel-api/src/main/java/org/apache/camel/support/service/ServiceHelper.java
index db75d3faf42..e1424fb3b43 100644
--- a/core/camel-api/src/main/java/org/apache/camel/support/service/ServiceHelper.java
+++ b/core/camel-api/src/main/java/org/apache/camel/support/service/ServiceHelper.java
@@ -188,7 +188,6 @@ public final class ServiceHelper {
         }
     }
 
-
     /**
      * Stops the given {@code value}, rethrowing the first exception caught.
      * <p/>
@@ -203,7 +202,6 @@ public final class ServiceHelper {
         }
     }
 
-
     /**
      * Stops the given {@code value}, rethrowing the first exception caught.
      * <p/>
diff --git a/core/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerBeginRenameStrategyTest.java b/core/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerBeginRenameStrategyTest.java
index 059bc460c71..d7148f6761f 100644
--- a/core/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerBeginRenameStrategyTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerBeginRenameStrategyTest.java
@@ -26,7 +26,6 @@ import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.junit.jupiter.api.Test;
 
-import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
 import static org.junit.jupiter.api.Assertions.assertNotNull;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
@@ -51,10 +50,11 @@ public class FileConsumerBeginRenameStrategyTest extends ContextTestSupport {
         // create a file in inprogress to let there be a duplicate file
         testDirectory("inprogress", true);
 
-        try(FileWriter fw = new FileWriter(testFile("inprogress/london.txt").toFile())) {
+        try (FileWriter fw = new FileWriter(testFile("inprogress/london.txt").toFile())) {
             fw.write("I was there once in London");
             fw.flush();
-        };
+        }
+        ;
 
         MockEndpoint mock = getMockEndpoint("mock:report");
         mock.expectedBodiesReceived("Hello London");
diff --git a/core/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerCommitRenameStrategyTest.java b/core/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerCommitRenameStrategyTest.java
index 203bfcac38c..9ee822d64a0 100644
--- a/core/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerCommitRenameStrategyTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerCommitRenameStrategyTest.java
@@ -25,7 +25,6 @@ import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.converter.IOConverter;
 import org.junit.jupiter.api.Test;
 
-import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
 import static org.junit.jupiter.api.Assertions.assertEquals;
 
 /**
diff --git a/core/camel-core/src/test/java/org/apache/camel/component/file/FileProducerAllowNullBodyTest.java b/core/camel-core/src/test/java/org/apache/camel/component/file/FileProducerAllowNullBodyTest.java
index 62723a6ca33..6448005268b 100644
--- a/core/camel-core/src/test/java/org/apache/camel/component/file/FileProducerAllowNullBodyTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/component/file/FileProducerAllowNullBodyTest.java
@@ -44,7 +44,7 @@ public class FileProducerAllowNullBodyTest extends ContextTestSupport {
 
         CamelExecutionException e = assertThrows(CamelExecutionException.class,
                 () -> template.sendBody(fileUri("?fileName=allowNullBody.txt"), null),
-        "Should have thrown a GenericFileOperationFailedException");
+                "Should have thrown a GenericFileOperationFailedException");
 
         GenericFileOperationFailedException cause
                 = assertIsInstanceOf(GenericFileOperationFailedException.class, e.getCause());
diff --git a/core/camel-core/src/test/java/org/apache/camel/component/file/FileProducerMoveExistingTest.java b/core/camel-core/src/test/java/org/apache/camel/component/file/FileProducerMoveExistingTest.java
index 2feb6cdf0b3..f48ae33ace8 100644
--- a/core/camel-core/src/test/java/org/apache/camel/component/file/FileProducerMoveExistingTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/component/file/FileProducerMoveExistingTest.java
@@ -28,7 +28,6 @@ import org.apache.camel.Exchange;
 import org.junit.jupiter.api.Test;
 
 import static java.io.File.separator;
-
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertThrows;
 import static org.junit.jupiter.api.Assertions.assertTrue;
diff --git a/core/camel-core/src/test/java/org/apache/camel/component/mock/MockEndpointTest.java b/core/camel-core/src/test/java/org/apache/camel/component/mock/MockEndpointTest.java
index a1bdb9ff052..3dd0ad7b477 100644
--- a/core/camel-core/src/test/java/org/apache/camel/component/mock/MockEndpointTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/component/mock/MockEndpointTest.java
@@ -667,8 +667,6 @@ public class MockEndpointTest extends ContextTestSupport {
         template.sendBodyAndHeader("direct:a", "Hello World", "foo", 123);
         template.sendBodyAndHeader("direct:a", "Hello World", "bar", 234);
 
-
-
         AssertionError e = assertThrows(AssertionError.class,
                 this::assertMockEndpointsSatisfied,
                 "Should have thrown exception");
diff --git a/core/camel-core/src/test/java/org/apache/camel/component/xslt/XsltFeatureRouteTest.java b/core/camel-core/src/test/java/org/apache/camel/component/xslt/XsltFeatureRouteTest.java
index 3c98007a41d..0049ec9fe67 100644
--- a/core/camel-core/src/test/java/org/apache/camel/component/xslt/XsltFeatureRouteTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/component/xslt/XsltFeatureRouteTest.java
@@ -36,7 +36,8 @@ public class XsltFeatureRouteTest extends ContextTestSupport {
     }
 
     public void sendXmlMessage(String uri, String message) {
-        Exception ex = assertThrows(Exception.class, () -> template.sendBody("direct:start1", message), "Expected an exception here");
+        Exception ex = assertThrows(Exception.class, () -> template.sendBody("direct:start1", message),
+                "Expected an exception here");
 
         // expect an exception here
         boolean b1 = ex instanceof CamelExecutionException;
diff --git a/core/camel-core/src/test/java/org/apache/camel/impl/DefaultClassResolverTest.java b/core/camel-core/src/test/java/org/apache/camel/impl/DefaultClassResolverTest.java
index d3526b89a61..b4e019dc311 100644
--- a/core/camel-core/src/test/java/org/apache/camel/impl/DefaultClassResolverTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/impl/DefaultClassResolverTest.java
@@ -125,7 +125,7 @@ public class DefaultClassResolverTest {
         DefaultClassResolver resolver = new DefaultClassResolver();
 
         assertThrows(ClassNotFoundException.class,
-                () ->  resolver.resolveMandatoryClass("com.FooBar"),
+                () -> resolver.resolveMandatoryClass("com.FooBar"),
                 "Should thrown an exception");
     }
 
diff --git a/core/camel-core/src/test/java/org/apache/camel/impl/DefaultComponentTest.java b/core/camel-core/src/test/java/org/apache/camel/impl/DefaultComponentTest.java
index 11d13841df9..6e6a67dad5a 100644
--- a/core/camel-core/src/test/java/org/apache/camel/impl/DefaultComponentTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/impl/DefaultComponentTest.java
@@ -129,7 +129,7 @@ public class DefaultComponentTest extends ContextTestSupport {
 
         assertEquals(
                 "Error during type conversion from type: java.lang.String " + "to the required type: java.lang.Integer "
-                        + "with value abc due to java.lang.NumberFormatException: For input string: \"abc\"",
+                     + "with value abc due to java.lang.NumberFormatException: For input string: \"abc\"",
                 ex.getMessage());
     }
 
@@ -139,8 +139,8 @@ public class DefaultComponentTest extends ContextTestSupport {
         parameters.put("date", "#somewhen");
         MyComponent my = new MyComponent(this.context);
 
-        NoSuchBeanException e = assertThrows(NoSuchBeanException.class, () ->
-                my.resolveAndRemoveReferenceParameter(parameters, "date", Date.class),
+        NoSuchBeanException e = assertThrows(NoSuchBeanException.class,
+                () -> my.resolveAndRemoveReferenceParameter(parameters, "date", Date.class),
                 "returned without finding object in registry");
 
         assertEquals("No bean could be found in the registry for: somewhen of type: java.util.Date", e.getMessage());
@@ -231,8 +231,8 @@ public class DefaultComponentTest extends ContextTestSupport {
         parameters.put("dates", "#bean1,#bean3");
         MyComponent my = new MyComponent(this.context);
 
-        NoSuchBeanException e = assertThrows(NoSuchBeanException.class, () ->
-                my.resolveAndRemoveReferenceListParameter(parameters, "dates", Date.class),
+        NoSuchBeanException e = assertThrows(NoSuchBeanException.class,
+                () -> my.resolveAndRemoveReferenceListParameter(parameters, "dates", Date.class),
                 "returned without finding object in registry");
 
         assertEquals("No bean could be found in the registry for: bean3 of type: java.util.Date", e.getMessage());
diff --git a/core/camel-core/src/test/java/org/apache/camel/impl/DefaultComponentValidateURITest.java b/core/camel-core/src/test/java/org/apache/camel/impl/DefaultComponentValidateURITest.java
index 24b2c404a66..d2168d57d05 100644
--- a/core/camel-core/src/test/java/org/apache/camel/impl/DefaultComponentValidateURITest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/impl/DefaultComponentValidateURITest.java
@@ -37,7 +37,8 @@ public class DefaultComponentValidateURITest extends ContextTestSupport {
 
     @Test
     public void testUnknownParameter() {
-        assertThrows(ResolveEndpointFailedException.class, () -> context.getEndpoint("timer://foo?delay=250&unknown=1&period=500"),
+        assertThrows(ResolveEndpointFailedException.class,
+                () -> context.getEndpoint("timer://foo?delay=250&unknown=1&period=500"),
                 "Should have thrown ResolveEndpointFailedException");
     }
 
diff --git a/core/camel-core/src/test/java/org/apache/camel/impl/DefaultExecutorServiceManagerTest.java b/core/camel-core/src/test/java/org/apache/camel/impl/DefaultExecutorServiceManagerTest.java
index f66ebfc042d..3913414d050 100644
--- a/core/camel-core/src/test/java/org/apache/camel/impl/DefaultExecutorServiceManagerTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/impl/DefaultExecutorServiceManagerTest.java
@@ -127,7 +127,8 @@ public class DefaultExecutorServiceManagerTest extends ContextTestSupport {
     public void testGetThreadNameCustomPatternInvalid() {
         context.getExecutorServiceManager().setThreadNamePattern("Cool #xxx#");
 
-        IllegalArgumentException e = assertThrows(IllegalArgumentException.class, () -> context.getExecutorServiceManager().resolveThreadName("foo"),
+        IllegalArgumentException e = assertThrows(IllegalArgumentException.class,
+                () -> context.getExecutorServiceManager().resolveThreadName("foo"),
                 "Should thrown an exception");
 
         assertEquals("Pattern is invalid: [Cool #xxx#] in resolved thread name: [Cool #xxx#]", e.getMessage());
diff --git a/core/camel-core/src/test/java/org/apache/camel/impl/DefaultProducerTemplateAsyncTest.java b/core/camel-core/src/test/java/org/apache/camel/impl/DefaultProducerTemplateAsyncTest.java
index fe0559bc1af..7105766dd9c 100644
--- a/core/camel-core/src/test/java/org/apache/camel/impl/DefaultProducerTemplateAsyncTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/impl/DefaultProducerTemplateAsyncTest.java
@@ -225,8 +225,9 @@ public class DefaultProducerTemplateAsyncTest extends ContextTestSupport {
         String echo = template.requestBody("direct:echo", "Hi", String.class);
         assertEquals("HiHi", echo);
 
-        RuntimeCamelException e = assertThrows(RuntimeCamelException.class, ()  -> template.extractFutureBody(future, Exchange.class),
-                "Should have thrown exception");
+        RuntimeCamelException e
+                = assertThrows(RuntimeCamelException.class, () -> template.extractFutureBody(future, Exchange.class),
+                        "Should have thrown exception");
 
         assertEquals("Damn forced by unit test", e.getCause().getMessage());
 
@@ -243,8 +244,9 @@ public class DefaultProducerTemplateAsyncTest extends ContextTestSupport {
         String echo = template.requestBody("direct:echo", "Hi", String.class);
         assertEquals("HiHi", echo);
 
-        RuntimeCamelException e = assertThrows(RuntimeCamelException.class, ()  -> template.extractFutureBody(future, String.class),
-                "Should have thrown exception");
+        RuntimeCamelException e
+                = assertThrows(RuntimeCamelException.class, () -> template.extractFutureBody(future, String.class),
+                        "Should have thrown exception");
 
         assertEquals("Damn forced by unit test", e.getCause().getMessage());
 
diff --git a/core/camel-core/src/test/java/org/apache/camel/impl/DefaultProducerTemplateTest.java b/core/camel-core/src/test/java/org/apache/camel/impl/DefaultProducerTemplateTest.java
index f6552c38caa..baa2ee69e16 100644
--- a/core/camel-core/src/test/java/org/apache/camel/impl/DefaultProducerTemplateTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/impl/DefaultProducerTemplateTest.java
@@ -90,9 +90,9 @@ public class DefaultProducerTemplateTest extends ContextTestSupport {
         MockEndpoint mock = getMockEndpoint("mock:result");
         mock.expectedMessageCount(0);
 
-        RuntimeCamelException e = assertThrows(RuntimeCamelException.class, () ->
-                template.sendBody("direct:exception", "Hello World"),
-                "Should have thrown RuntimeCamelException");
+        RuntimeCamelException e
+                = assertThrows(RuntimeCamelException.class, () -> template.sendBody("direct:exception", "Hello World"),
+                        "Should have thrown RuntimeCamelException");
 
         assertIsInstanceOf(IllegalArgumentException.class, e.getCause());
         assertEquals("Forced exception by unit test", e.getCause().getMessage());
@@ -104,8 +104,8 @@ public class DefaultProducerTemplateTest extends ContextTestSupport {
         MockEndpoint mock = getMockEndpoint("mock:result");
         mock.expectedMessageCount(0);
 
-        RuntimeCamelException e = assertThrows(RuntimeCamelException.class, () ->
-                template.requestBody("direct:exception", "Hello World", Integer.class),
+        RuntimeCamelException e = assertThrows(RuntimeCamelException.class,
+                () -> template.requestBody("direct:exception", "Hello World", Integer.class),
                 "Should have thrown RuntimeCamelException");
 
         assertIsInstanceOf(IllegalArgumentException.class, e.getCause());
diff --git a/core/camel-core/src/test/java/org/apache/camel/impl/DefaultProducerTemplateWithCustomCacheMaxSizeTest.java b/core/camel-core/src/test/java/org/apache/camel/impl/DefaultProducerTemplateWithCustomCacheMaxSizeTest.java
index f90cc39f6d8..6af4fe4f2b9 100644
--- a/core/camel-core/src/test/java/org/apache/camel/impl/DefaultProducerTemplateWithCustomCacheMaxSizeTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/impl/DefaultProducerTemplateWithCustomCacheMaxSizeTest.java
@@ -77,6 +77,7 @@ public class DefaultProducerTemplateWithCustomCacheMaxSizeTest extends ContextTe
         Exception e = assertThrows(Exception.class, () -> context.createProducerTemplate(),
                 "Should have thrown an exception");
 
-        assertEquals("Property CamelMaximumCachePoolSize must be a positive number, was: 0", e.getCause().getMessage());;
+        assertEquals("Property CamelMaximumCachePoolSize must be a positive number, was: 0", e.getCause().getMessage());
+        ;
     }
 }
diff --git a/core/camel-core/src/test/java/org/apache/camel/impl/GracefulShutdownNoAutoStartOrderClashTest.java b/core/camel-core/src/test/java/org/apache/camel/impl/GracefulShutdownNoAutoStartOrderClashTest.java
index c6a27b949cb..c6361e60e20 100644
--- a/core/camel-core/src/test/java/org/apache/camel/impl/GracefulShutdownNoAutoStartOrderClashTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/impl/GracefulShutdownNoAutoStartOrderClashTest.java
@@ -44,7 +44,7 @@ public class GracefulShutdownNoAutoStartOrderClashTest extends ContextTestSuppor
 
         assertEquals(
                 "Failed to start route bar because of startupOrder clash. Route foo already has startupOrder 5 configured"
-                        + " which this route have as well. Please correct startupOrder to be unique among all your routes.",
+                     + " which this route have as well. Please correct startupOrder to be unique among all your routes.",
                 e.getMessage());
     }
 
diff --git a/core/camel-core/src/test/java/org/apache/camel/issues/AdviceWithInvalidConfiguredTest.java b/core/camel-core/src/test/java/org/apache/camel/issues/AdviceWithInvalidConfiguredTest.java
index 09e72e49f81..548d6297ef1 100644
--- a/core/camel-core/src/test/java/org/apache/camel/issues/AdviceWithInvalidConfiguredTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/issues/AdviceWithInvalidConfiguredTest.java
@@ -42,7 +42,7 @@ public class AdviceWithInvalidConfiguredTest extends ContextTestSupport {
                             .throwException(new IllegalArgumentException("Forced"));
                 }
             });
-        },"Should have thrown an exception");
+        }, "Should have thrown an exception");
 
         assertEquals("You can not advice with error handlers. Remove the error handlers from the route builder.",
                 e.getMessage());
diff --git a/core/camel-core/src/test/java/org/apache/camel/issues/ChoiceEndOrEndChoiceIssueTest.java b/core/camel-core/src/test/java/org/apache/camel/issues/ChoiceEndOrEndChoiceIssueTest.java
index 31d0d5016bf..9d9a95363ba 100644
--- a/core/camel-core/src/test/java/org/apache/camel/issues/ChoiceEndOrEndChoiceIssueTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/issues/ChoiceEndOrEndChoiceIssueTest.java
@@ -47,7 +47,7 @@ public class ChoiceEndOrEndChoiceIssueTest extends ContextTestSupport {
         }, "Should have thrown exception");
 
         assertEquals("A new choice clause should start with a when() or otherwise()."
-                        + " If you intend to end the entire choice and are using endChoice() then use end() instead.",
+                     + " If you intend to end the entire choice and are using endChoice() then use end() instead.",
                 e.getMessage());
     }
 
diff --git a/core/camel-core/src/test/java/org/apache/camel/issues/ExceptionThrownFromOnExceptionTest.java b/core/camel-core/src/test/java/org/apache/camel/issues/ExceptionThrownFromOnExceptionTest.java
index 5103ed2e679..3bbeac34e36 100644
--- a/core/camel-core/src/test/java/org/apache/camel/issues/ExceptionThrownFromOnExceptionTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/issues/ExceptionThrownFromOnExceptionTest.java
@@ -80,9 +80,9 @@ public class ExceptionThrownFromOnExceptionTest extends ContextTestSupport {
         getMockEndpoint("mock:result").expectedMessageCount(0);
         getMockEndpoint("mock:end").expectedMessageCount(0);
 
-        CamelExecutionException e = assertThrows(CamelExecutionException.class, () ->
-                template.sendBody("direct:start", "Hello World"),
-                "Should have thrown an exception");
+        CamelExecutionException e
+                = assertThrows(CamelExecutionException.class, () -> template.sendBody("direct:start", "Hello World"),
+                        "Should have thrown an exception");
 
         IOException cause = assertIsInstanceOf(IOException.class, e.getCause());
         assertEquals("Some other IOException", cause.getMessage());
@@ -132,9 +132,9 @@ public class ExceptionThrownFromOnExceptionTest extends ContextTestSupport {
         getMockEndpoint("mock:result").expectedMessageCount(0);
         getMockEndpoint("mock:end").expectedMessageCount(0);
 
-        CamelExecutionException e = assertThrows(CamelExecutionException.class, () ->
-                template.sendBody("direct:start", "Hello World"),
-                "Should have thrown an exception");
+        CamelExecutionException e
+                = assertThrows(CamelExecutionException.class, () -> template.sendBody("direct:start", "Hello World"),
+                        "Should have thrown an exception");
 
         IOException cause = assertIsInstanceOf(IOException.class, e.getCause());
         assertEquals("Some other IOException", cause.getMessage());
@@ -312,7 +312,7 @@ public class ExceptionThrownFromOnExceptionTest extends ContextTestSupport {
 
         IOException cause = assertIsInstanceOf(IOException.class, e.getCause());
         assertEquals("IO error", cause.getMessage());
-        
+
         assertMockEndpointsSatisfied();
 
         assertEquals(4, RETRY.get(), "Should try 4 times (1 first, 3 retry)");