This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch export in repository https://gitbox.apache.org/repos/asf/camel.git
commit 68fb1e0299ee0559f692bb701bef4c01b71383a1 Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Thu Aug 3 14:43:31 2023 +0200 Regen --- .../org/apache/camel/component/saga/SagaComponentTest.java | 3 ++- .../component/seda/SameSedaQueueSizeAndNoSizeTest.java | 11 +++++++---- .../apache/camel/component/seda/SedaBlockWhenFullTest.java | 3 ++- .../seda/SedaConcurrentConsumersNPEIssueTest.java | 14 ++++++++------ .../camel/component/seda/SedaDefaultBlockWhenFullTest.java | 12 ++++++------ .../component/seda/SedaDefaultUnboundedQueueSizeTest.java | 5 +++-- .../camel/component/seda/SedaInOutChainedTimeoutTest.java | 3 ++- .../camel/component/seda/SedaInOutWithErrorTest.java | 3 ++- .../apache/camel/component/seda/SedaNoConsumerTest.java | 13 ++++++++----- .../org/apache/camel/component/seda/SedaTimeoutTest.java | 6 +++--- .../seda/SedaWaitForTaskCompleteOnCompletionTest.java | 5 +++-- .../apache/camel/component/timer/TimerEndpointTest.java | 4 ++-- .../camel/component/timer/TimerWithTimeOptionTest.java | 6 +++--- .../validator/ValidatorLazyStartProducerTest.java | 6 +++--- 14 files changed, 54 insertions(+), 40 deletions(-) diff --git a/core/camel-core/src/test/java/org/apache/camel/component/saga/SagaComponentTest.java b/core/camel-core/src/test/java/org/apache/camel/component/saga/SagaComponentTest.java index 3861783b385..89eb26f9cab 100644 --- a/core/camel-core/src/test/java/org/apache/camel/component/saga/SagaComponentTest.java +++ b/core/camel-core/src/test/java/org/apache/camel/component/saga/SagaComponentTest.java @@ -85,7 +85,8 @@ public class SagaComponentTest extends ContextTestSupport { MockEndpoint compensated = getMockEndpoint("mock:compensated"); compensated.expectedMessageCount(1); - assertThrows(Exception.class, () -> template.sendBody("direct:auto-workflow", "auto-compensate"), "Should throw an exception"); + assertThrows(Exception.class, () -> template.sendBody("direct:auto-workflow", "auto-compensate"), + "Should throw an exception"); completed.assertIsNotSatisfied(); compensated.assertIsSatisfied(); diff --git a/core/camel-core/src/test/java/org/apache/camel/component/seda/SameSedaQueueSizeAndNoSizeTest.java b/core/camel-core/src/test/java/org/apache/camel/component/seda/SameSedaQueueSizeAndNoSizeTest.java index cb4d372853a..50ef8e0ddeb 100644 --- a/core/camel-core/src/test/java/org/apache/camel/component/seda/SameSedaQueueSizeAndNoSizeTest.java +++ b/core/camel-core/src/test/java/org/apache/camel/component/seda/SameSedaQueueSizeAndNoSizeTest.java @@ -36,7 +36,8 @@ public class SameSedaQueueSizeAndNoSizeTest extends ContextTestSupport { template.sendBody("seda:foo", "" + i); } - CamelExecutionException e = assertThrows(CamelExecutionException.class, () -> template.sendBody("seda:foo", "Should be full now"), "Should fail"); + CamelExecutionException e = assertThrows(CamelExecutionException.class, + () -> template.sendBody("seda:foo", "Should be full now"), "Should fail"); IllegalStateException ise = assertIsInstanceOf(IllegalStateException.class, e.getCause()); if (!isJavaVendor("ibm")) { assertEquals("Queue full", ise.getMessage()); @@ -45,7 +46,8 @@ public class SameSedaQueueSizeAndNoSizeTest extends ContextTestSupport { @Test public void testSameQueueDifferentSize() { - ResolveEndpointFailedException e = assertThrows(ResolveEndpointFailedException.class, () -> template.sendBody("seda:foo?size=200", "Should fail"), "Should fail"); + ResolveEndpointFailedException e = assertThrows(ResolveEndpointFailedException.class, + () -> template.sendBody("seda:foo?size=200", "Should fail"), "Should fail"); IllegalArgumentException ise = assertIsInstanceOf(IllegalArgumentException.class, e.getCause()); assertEquals( "Cannot use existing queue seda://foo as the existing queue size 100 does not match given queue size 200", @@ -54,10 +56,11 @@ public class SameSedaQueueSizeAndNoSizeTest extends ContextTestSupport { @Test public void testSameQueueDifferentSizeBar() { - ResolveEndpointFailedException e = assertThrows(ResolveEndpointFailedException.class,() -> template.sendBody("seda:bar?size=200", "Should fail"), "Should fail"); + ResolveEndpointFailedException e = assertThrows(ResolveEndpointFailedException.class, + () -> template.sendBody("seda:bar?size=200", "Should fail"), "Should fail"); IllegalArgumentException ise = assertIsInstanceOf(IllegalArgumentException.class, e.getCause()); assertEquals("Cannot use existing queue seda://bar as the existing queue size " + SedaConstants.QUEUE_SIZE - + " does not match given queue size 200", + + " does not match given queue size 200", ise.getMessage()); } diff --git a/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaBlockWhenFullTest.java b/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaBlockWhenFullTest.java index 99ac0a0a6d5..a50259eaa37 100644 --- a/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaBlockWhenFullTest.java +++ b/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaBlockWhenFullTest.java @@ -71,7 +71,8 @@ public class SedaBlockWhenFullTest extends ContextTestSupport { assertFalse(seda.isBlockWhenFull(), "Seda Endpoint is not setting the correct default (should be false) for \"blockWhenFull\""); - Exception e = assertThrows(Exception.class, () -> sendTwoOverCapacity(DEFAULT_URI, QUEUE_SIZE), "The route didn't fill the queue beyond capacity: test class isn't working as intended"); + Exception e = assertThrows(Exception.class, () -> sendTwoOverCapacity(DEFAULT_URI, QUEUE_SIZE), + "The route didn't fill the queue beyond capacity: test class isn't working as intended"); assertIsInstanceOf(IllegalStateException.class, e.getCause()); } diff --git a/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaConcurrentConsumersNPEIssueTest.java b/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaConcurrentConsumersNPEIssueTest.java index ad7f185ffea..d09c8a18c25 100644 --- a/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaConcurrentConsumersNPEIssueTest.java +++ b/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaConcurrentConsumersNPEIssueTest.java @@ -36,11 +36,12 @@ public class SedaConcurrentConsumersNPEIssueTest extends ContextTestSupport { assertMockEndpointsSatisfied(); - FailedToStartRouteException e = assertThrows(FailedToStartRouteException.class, () -> context.getRouteController().startRoute("first"), - "Should have thrown exception"); + FailedToStartRouteException e + = assertThrows(FailedToStartRouteException.class, () -> context.getRouteController().startRoute("first"), + "Should have thrown exception"); assertEquals("Failed to start route first because of Multiple consumers for the same endpoint is not allowed:" - + " seda://foo?concurrentConsumers=5", + + " seda://foo?concurrentConsumers=5", e.getMessage()); } @@ -56,11 +57,12 @@ public class SedaConcurrentConsumersNPEIssueTest extends ContextTestSupport { // this should be okay context.getRouteController().startRoute("third"); - FailedToStartRouteException e = assertThrows(FailedToStartRouteException.class, () -> context.getRouteController().startRoute("first"), - "Should have thrown exception"); + FailedToStartRouteException e + = assertThrows(FailedToStartRouteException.class, () -> context.getRouteController().startRoute("first"), + "Should have thrown exception"); assertEquals("Failed to start route first because of Multiple consumers for the same endpoint is not allowed:" - + " seda://foo?concurrentConsumers=5", + + " seda://foo?concurrentConsumers=5", e.getMessage()); } diff --git a/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaDefaultBlockWhenFullTest.java b/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaDefaultBlockWhenFullTest.java index 090be18b1a1..48167cb9d42 100644 --- a/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaDefaultBlockWhenFullTest.java +++ b/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaDefaultBlockWhenFullTest.java @@ -24,8 +24,8 @@ import org.junit.jupiter.api.Timeout; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; /** * Tests that a Seda component properly set blockWhenFull on endpoints. @@ -74,12 +74,12 @@ public class SedaDefaultBlockWhenFullTest extends ContextTestSupport { @Test public void testSedaDefaultWhenFull() { - SedaEndpoint seda = context.getEndpoint(DEFAULT_URI, SedaEndpoint.class); - assertFalse(seda.isBlockWhenFull(), - "Seda Endpoint is not setting the correct default (should be false) for \"blockWhenFull\""); + SedaEndpoint seda = context.getEndpoint(DEFAULT_URI, SedaEndpoint.class); + assertFalse(seda.isBlockWhenFull(), + "Seda Endpoint is not setting the correct default (should be false) for \"blockWhenFull\""); - Exception e = assertThrows(Exception.class, () -> sendTwoOverCapacity(DEFAULT_URI, QUEUE_SIZE), - "The route didn't fill the queue beyond capacity: test class isn't working as intended"); + Exception e = assertThrows(Exception.class, () -> sendTwoOverCapacity(DEFAULT_URI, QUEUE_SIZE), + "The route didn't fill the queue beyond capacity: test class isn't working as intended"); assertIsInstanceOf(IllegalStateException.class, e.getCause()); } diff --git a/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaDefaultUnboundedQueueSizeTest.java b/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaDefaultUnboundedQueueSizeTest.java index 1a19890607c..c55361ed030 100644 --- a/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaDefaultUnboundedQueueSizeTest.java +++ b/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaDefaultUnboundedQueueSizeTest.java @@ -19,8 +19,8 @@ package org.apache.camel.component.seda; import org.apache.camel.ContextTestSupport; import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; public class SedaDefaultUnboundedQueueSizeTest extends ContextTestSupport { @@ -48,7 +48,8 @@ public class SedaDefaultUnboundedQueueSizeTest extends ContextTestSupport { assertEquals(500, seda.getQueue().size()); // sending one more hit the limit - Exception e = assertThrows(Exception.class, () -> template.sendBody("seda:foo", "Message overflow"), "Should thrown an exception"); + Exception e = assertThrows(Exception.class, () -> template.sendBody("seda:foo", "Message overflow"), + "Should thrown an exception"); assertIsInstanceOf(IllegalStateException.class, e.getCause()); } diff --git a/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaInOutChainedTimeoutTest.java b/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaInOutChainedTimeoutTest.java index d12b79d63f5..ae8c2b33f7c 100644 --- a/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaInOutChainedTimeoutTest.java +++ b/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaInOutChainedTimeoutTest.java @@ -34,7 +34,8 @@ public class SedaInOutChainedTimeoutTest extends ContextTestSupport { // time timeout after 2 sec should trigger an immediate reply StopWatch watch = new StopWatch(); - CamelExecutionException e = assertThrows(CamelExecutionException.class, () -> template.requestBody("seda:a?timeout=5000", "Hello World"), "Should have thrown an exception"); + CamelExecutionException e = assertThrows(CamelExecutionException.class, + () -> template.requestBody("seda:a?timeout=5000", "Hello World"), "Should have thrown an exception"); ExchangeTimedOutException cause = assertIsInstanceOf(ExchangeTimedOutException.class, e.getCause()); assertEquals(2000, cause.getTimeout()); diff --git a/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaInOutWithErrorTest.java b/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaInOutWithErrorTest.java index 9982f285275..460a07168bc 100644 --- a/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaInOutWithErrorTest.java +++ b/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaInOutWithErrorTest.java @@ -30,7 +30,8 @@ public class SedaInOutWithErrorTest extends ContextTestSupport { public void testInOutWithError() throws Exception { getMockEndpoint("mock:result").expectedMessageCount(0); - CamelExecutionException e = assertThrows(CamelExecutionException.class, () -> template.requestBody("direct:start", "Hello World", String.class), + CamelExecutionException e = assertThrows(CamelExecutionException.class, + () -> template.requestBody("direct:start", "Hello World", String.class), "Should have thrown an exception"); assertIsInstanceOf(IllegalArgumentException.class, e.getCause()); diff --git a/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaNoConsumerTest.java b/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaNoConsumerTest.java index 66c67fc4e71..c13714b3df2 100644 --- a/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaNoConsumerTest.java +++ b/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaNoConsumerTest.java @@ -16,6 +16,8 @@ */ package org.apache.camel.component.seda; +import java.util.concurrent.TimeUnit; + import org.apache.camel.CamelExecutionException; import org.apache.camel.ContextTestSupport; import org.apache.camel.ExchangeTimedOutException; @@ -23,8 +25,6 @@ import org.apache.camel.builder.NotifyBuilder; import org.apache.camel.builder.RouteBuilder; import org.junit.jupiter.api.Test; -import java.util.concurrent.TimeUnit; - import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -64,7 +64,8 @@ public class SedaNoConsumerTest extends ContextTestSupport { context.start(); - CamelExecutionException e = assertThrows(CamelExecutionException.class, () -> template.requestBody("direct:start", "Hello World"), "Should throw an exception"); + CamelExecutionException e = assertThrows(CamelExecutionException.class, + () -> template.requestBody("direct:start", "Hello World"), "Should throw an exception"); assertIsInstanceOf(ExchangeTimedOutException.class, e.getCause()); } @@ -79,7 +80,8 @@ public class SedaNoConsumerTest extends ContextTestSupport { context.start(); - CamelExecutionException e = assertThrows(CamelExecutionException.class, () -> template.sendBody("direct:start", "Hello World"), "Should throw an exception"); + CamelExecutionException e = assertThrows(CamelExecutionException.class, + () -> template.sendBody("direct:start", "Hello World"), "Should throw an exception"); assertIsInstanceOf(SedaConsumerNotAvailableException.class, e.getCause()); } @@ -124,7 +126,8 @@ public class SedaNoConsumerTest extends ContextTestSupport { context.getRouteController().stopRoute("stopThisRoute"); TimeUnit.MILLISECONDS.sleep(100); - CamelExecutionException e = assertThrows(CamelExecutionException.class, () -> template.sendBody("seda:foo?failIfNoConsumers=true", "Hello World"), "Should throw an exception"); + CamelExecutionException e = assertThrows(CamelExecutionException.class, + () -> template.sendBody("seda:foo?failIfNoConsumers=true", "Hello World"), "Should throw an exception"); assertIsInstanceOf(SedaConsumerNotAvailableException.class, e.getCause()); } diff --git a/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaTimeoutTest.java b/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaTimeoutTest.java index 29f598ff19f..62bb1f81936 100644 --- a/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaTimeoutTest.java +++ b/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaTimeoutTest.java @@ -16,15 +16,15 @@ */ package org.apache.camel.component.seda; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.Future; + import org.apache.camel.CamelExecutionException; import org.apache.camel.ContextTestSupport; import org.apache.camel.ExchangeTimedOutException; import org.apache.camel.builder.RouteBuilder; import org.junit.jupiter.api.Test; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.Future; - import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertThrows; diff --git a/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaWaitForTaskCompleteOnCompletionTest.java b/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaWaitForTaskCompleteOnCompletionTest.java index ce1d421fb46..fd95595cec5 100644 --- a/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaWaitForTaskCompleteOnCompletionTest.java +++ b/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaWaitForTaskCompleteOnCompletionTest.java @@ -35,8 +35,9 @@ public class SedaWaitForTaskCompleteOnCompletionTest extends ContextTestSupport public void testAlways() throws Exception { getMockEndpoint("mock:result").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"); assertIsInstanceOf(IllegalArgumentException.class, e.getCause()); assertEquals("Forced", e.getCause().getMessage()); diff --git a/core/camel-core/src/test/java/org/apache/camel/component/timer/TimerEndpointTest.java b/core/camel-core/src/test/java/org/apache/camel/component/timer/TimerEndpointTest.java index 5b6ab042f2b..46dd377c08a 100644 --- a/core/camel-core/src/test/java/org/apache/camel/component/timer/TimerEndpointTest.java +++ b/core/camel-core/src/test/java/org/apache/camel/component/timer/TimerEndpointTest.java @@ -16,6 +16,8 @@ */ package org.apache.camel.component.timer; +import java.util.Timer; + import org.apache.camel.ContextTestSupport; import org.apache.camel.Endpoint; import org.apache.camel.RuntimeCamelException; @@ -24,8 +26,6 @@ import org.apache.camel.component.mock.MockEndpoint; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import java.util.Timer; - public class TimerEndpointTest extends ContextTestSupport { @Override diff --git a/core/camel-core/src/test/java/org/apache/camel/component/timer/TimerWithTimeOptionTest.java b/core/camel-core/src/test/java/org/apache/camel/component/timer/TimerWithTimeOptionTest.java index 19c57198778..f79e11c709a 100644 --- a/core/camel-core/src/test/java/org/apache/camel/component/timer/TimerWithTimeOptionTest.java +++ b/core/camel-core/src/test/java/org/apache/camel/component/timer/TimerWithTimeOptionTest.java @@ -16,6 +16,9 @@ */ package org.apache.camel.component.timer; +import java.text.SimpleDateFormat; +import java.util.Date; + import org.apache.camel.ContextTestSupport; import org.apache.camel.FailedToCreateRouteException; import org.apache.camel.builder.RouteBuilder; @@ -23,9 +26,6 @@ import org.apache.camel.component.mock.MockEndpoint; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import java.text.SimpleDateFormat; -import java.util.Date; - public class TimerWithTimeOptionTest extends ContextTestSupport { @Override diff --git a/core/camel-core/src/test/java/org/apache/camel/component/validator/ValidatorLazyStartProducerTest.java b/core/camel-core/src/test/java/org/apache/camel/component/validator/ValidatorLazyStartProducerTest.java index ba46f959b94..36648958eb7 100644 --- a/core/camel-core/src/test/java/org/apache/camel/component/validator/ValidatorLazyStartProducerTest.java +++ b/core/camel-core/src/test/java/org/apache/camel/component/validator/ValidatorLazyStartProducerTest.java @@ -16,12 +16,12 @@ */ package org.apache.camel.component.validator; +import java.io.FileNotFoundException; + import org.apache.camel.ContextTestSupport; import org.apache.camel.builder.RouteBuilder; import org.junit.jupiter.api.Test; -import java.io.FileNotFoundException; - import static org.junit.jupiter.api.Assertions.assertThrows; public class ValidatorLazyStartProducerTest extends ContextTestSupport { @@ -30,7 +30,7 @@ public class ValidatorLazyStartProducerTest extends ContextTestSupport { public void testLazyStartProducerFail() throws Exception { getMockEndpoint("mock:result").expectedMessageCount(0); - Exception e = assertThrows(Exception.class, () -> template.sendBody("direct:fail", + Exception e = assertThrows(Exception.class, () -> template.sendBody("direct:fail", "<mail xmlns='http://foo.com/bar'><subject>Hey</subject><body>Hello world!</body></mail>"), "Should throw exception");