You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by or...@apache.org on 2023/01/31 15:49:10 UTC
[camel] branch main updated (3123b710aad -> 1800482a1e0)
This is an automated email from the ASF dual-hosted git repository.
orpiske pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
from 3123b710aad CAMEL-18988: increase log level to DEBUG
new c38a276cc45 (chores) camel-core: tests cleanups
new f2273cd2ecc (chores) camel-core: cleanup exception handling in the ConverterTest
new 733c8f63cc6 (chores) camel-core: simplified assertions in tests
new b9bedd579e1 (chores) camel-core: avoid redundant array creation
new 1800482a1e0 (chores) camel-core: use the empty array version as it is likely intrinsified
The 5 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.
Summary of changes:
.../org/apache/camel/SuspendableServiceTest.java | 9 +-
.../camel/builder/ContextErrorHandlerTest.java | 3 +-
.../org/apache/camel/builder/ErrorHandlerTest.java | 3 +-
.../camel/builder/ExpressionBuilderTest.java | 8 +-
.../apache/camel/builder/NotifyBuilderTest.java | 348 +++++++++++----------
.../builder/NotifyBuilderWhenDoneByIndexTest.java | 6 +-
.../builder/PredicateBuilderConcurrentTest.java | 7 +-
.../apache/camel/builder/SimpleBuilderTest.java | 4 +-
.../camel/builder/ThreadPoolBuilderTest.java | 51 +--
.../builder/xml/DefaultNamespaceContextTest.java | 14 +-
.../org/apache/camel/builder/xml/XPathTest.java | 4 +-
.../camel/cluster/ClusterServiceSelectorTest.java | 4 +-
.../camel/component/bean/BeanEndpointTest.java | 11 +-
.../bean/BeanInfoAMoreComplexOverloadedTest.java | 4 +-
.../component/bean/BeanInfoOverloadedTest.java | 2 +-
.../BeanInfoOverloadedWithSubTypeParamTest.java | 2 +-
.../apache/camel/component/bean/BeanInfoTest.java | 2 +-
.../BeanWithExpressionInjectionPredicateTest.java | 6 +-
...thPropertiesAndHeadersAndBodyInjectionTest.java | 3 +-
.../bean/issues/BeanRouteToDerivedClassTest.java | 9 +-
.../camel/component/log/LogListenerTest.java | 3 +-
.../camel/component/rest/FromRestGetTest.java | 3 +-
.../seda/SedaDiscardIfNoConsumerTest.java | 3 +-
.../seda/SedaShouldNotUseSameThreadTest.java | 4 +-
.../camel/component/seda/SedaUnitOfWorkTest.java | 3 +-
.../seda/SedaWaitForTaskAsPropertyTest.java | 3 +-
.../seda/SedaWaitForTaskIfReplyExpectedTest.java | 3 +-
.../component/seda/SedaWaitForTaskNewerTest.java | 3 +-
.../org/apache/camel/converter/ConverterTest.java | 94 +++---
.../camel/converter/ObjectConverterNaNTest.java | 17 +-
.../camel/converter/ObjectConverterTest.java | 24 +-
.../camel/converter/jaxp/StaxConverterTest.java | 5 +-
.../camel/converter/jaxp/XmlConverterTest.java | 2 +-
.../CamelCustomDefaultThreadPoolProfileTest.java | 3 +-
.../camel/impl/CustomUnitOfWorkFactoryTest.java | 2 +-
.../impl/DefaultCamelContextAutoStartupTest.java | 26 +-
.../DefaultComponentReferencePropertiesTest.java | 2 +-
.../org/apache/camel/impl/DefaultExchangeTest.java | 14 +-
.../impl/DefaultExecutorServiceManagerTest.java | 22 +-
.../impl/DefaultHeaderFilterStrategyTest.java | 8 +-
.../camel/impl/DefaultMessageHeaderTest.java | 10 +-
.../camel/impl/DefaultProducerCacheTest.java | 2 +-
.../impl/DefaultProducerTemplateAsyncTest.java | 2 +-
.../EventDrivenPollingConsumerQueueSizeTest.java | 2 +-
.../camel/impl/LifecycleStrategyServiceTest.java | 9 +-
.../camel/impl/ProducerCacheNonSingletonTest.java | 2 +-
.../camel/impl/ScheduledPollConsumerTest.java | 6 +-
.../camel/impl/StopRouteAbortAfterTimeoutTest.java | 4 +-
.../camel/impl/VetoCamelContextStartTest.java | 6 +-
.../camel/impl/engine/DefaultCamelContextTest.java | 60 ++--
.../DefaultSupervisingRouteControllerTest.java | 2 +-
.../EventNotifierFailureHandledEventsTest.java | 12 +-
.../apache/camel/issues/Camel4857UriIssueTest.java | 2 +-
.../camel/issues/ChangeHeaderCaseIssueTest.java | 3 +-
.../issues/EndpointWithRawUriParameterTest.java | 2 +-
.../camel/issues/ProxyReturnNullIssueTest.java | 3 +-
...olicyOnExceptionWhileRedeliveringIssueTest.java | 2 +-
.../RouteStartupFailShouldStopAlsoIssueTest.java | 2 +-
.../org/apache/camel/language/TokenizerTest.java | 6 +-
.../apache/camel/language/simple/SimpleTest.java | 5 +-
.../processor/ComposedMessageProcessorTest.java | 4 +-
.../camel/processor/ConsumerRouteIdAwareTest.java | 2 +-
.../camel/processor/DataFormatServiceTest.java | 10 +-
.../apache/camel/processor/LogEipListenerTest.java | 3 +-
.../MulticastParallelFailureEndpointTest.java | 3 +-
.../camel/processor/PipelineStepWithEventTest.java | 4 +-
.../processor/RollbackDefaultErrorHandlerTest.java | 2 +-
.../camel/processor/RollbackDoTryCatchTest.java | 3 +-
.../org/apache/camel/processor/RollbackTest.java | 2 +-
.../camel/processor/RouteMEPOptionalOutTest.java | 9 +-
...StartupOrderSuspendResumeNoAutoStartupTest.java | 5 +-
.../processor/ThrowExceptionNullMessageTest.java | 4 +-
.../TryProcessorHandleWrappedExceptionTest.java | 2 +-
.../apache/camel/processor/TryProcessorTest.java | 2 +-
.../aggregator/AggregateProcessorTest.java | 2 +-
.../AggregateShutdownThreadPoolTest.java | 15 +-
.../AuditInterceptorAsyncDelegateIssueTest.java | 6 +-
.../AuditInterceptorDelegateIssueTest.java | 6 +-
.../camel/processor/resequencer/SequenceTest.java | 9 +-
.../DefaultValidationErrorHandlerTest.java | 14 +-
.../camel/support/DefaultTimeoutMapTest.java | 2 +-
.../camel/support/IntrospectionSupportTest.java | 60 ++--
.../camel/support/PropertyBindingSupportTest.java | 14 +-
.../apache/camel/support/ServiceSupportTest.java | 74 ++---
.../apache/camel/support/component/TestProxy.java | 2 +-
.../support/jsse/SSLContextParametersTest.java | 92 +++---
.../apache/camel/util/CaseInsensitiveMapTest.java | 102 +++---
.../org/apache/camel/util/EndpointHelperTest.java | 4 +-
.../java/org/apache/camel/util/FileUtilTest.java | 49 +--
.../org/apache/camel/util/MessageHelperTest.java | 2 +-
.../org/apache/camel/util/PackageHelperTest.java | 4 +-
.../apache/camel/util/StingQuoteHelperTest.java | 3 +-
.../org/apache/camel/util/StringHelperTest.java | 116 +++----
93 files changed, 781 insertions(+), 736 deletions(-)
[camel] 03/05: (chores) camel-core: simplified assertions in tests
Posted by or...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 733c8f63cc62ce314fd7b4620687360fec942897
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Tue Jan 31 11:07:00 2023 +0100
(chores) camel-core: simplified assertions in tests
---
.../org/apache/camel/SuspendableServiceTest.java | 9 +-
.../camel/builder/ContextErrorHandlerTest.java | 3 +-
.../org/apache/camel/builder/ErrorHandlerTest.java | 3 +-
.../apache/camel/builder/NotifyBuilderTest.java | 348 +++++++++++----------
.../builder/NotifyBuilderWhenDoneByIndexTest.java | 6 +-
.../builder/PredicateBuilderConcurrentTest.java | 7 +-
.../apache/camel/builder/SimpleBuilderTest.java | 4 +-
.../camel/builder/ThreadPoolBuilderTest.java | 51 +--
.../builder/xml/DefaultNamespaceContextTest.java | 14 +-
.../org/apache/camel/builder/xml/XPathTest.java | 4 +-
.../camel/component/bean/BeanEndpointTest.java | 11 +-
.../BeanWithExpressionInjectionPredicateTest.java | 6 +-
...thPropertiesAndHeadersAndBodyInjectionTest.java | 3 +-
.../bean/issues/BeanRouteToDerivedClassTest.java | 9 +-
.../camel/component/log/LogListenerTest.java | 3 +-
.../camel/component/rest/FromRestGetTest.java | 3 +-
.../seda/SedaDiscardIfNoConsumerTest.java | 3 +-
.../seda/SedaShouldNotUseSameThreadTest.java | 4 +-
.../camel/component/seda/SedaUnitOfWorkTest.java | 3 +-
.../seda/SedaWaitForTaskAsPropertyTest.java | 3 +-
.../seda/SedaWaitForTaskIfReplyExpectedTest.java | 3 +-
.../component/seda/SedaWaitForTaskNewerTest.java | 3 +-
.../org/apache/camel/converter/ConverterTest.java | 26 +-
.../camel/converter/ObjectConverterNaNTest.java | 17 +-
.../camel/converter/ObjectConverterTest.java | 24 +-
.../camel/converter/jaxp/StaxConverterTest.java | 5 +-
.../camel/converter/jaxp/XmlConverterTest.java | 2 +-
.../CamelCustomDefaultThreadPoolProfileTest.java | 3 +-
.../impl/DefaultCamelContextAutoStartupTest.java | 26 +-
.../org/apache/camel/impl/DefaultExchangeTest.java | 14 +-
.../impl/DefaultExecutorServiceManagerTest.java | 22 +-
.../impl/DefaultHeaderFilterStrategyTest.java | 8 +-
.../camel/impl/DefaultMessageHeaderTest.java | 10 +-
.../impl/DefaultProducerTemplateAsyncTest.java | 2 +-
.../camel/impl/LifecycleStrategyServiceTest.java | 9 +-
.../camel/impl/ScheduledPollConsumerTest.java | 6 +-
.../camel/impl/StopRouteAbortAfterTimeoutTest.java | 4 +-
.../camel/impl/VetoCamelContextStartTest.java | 6 +-
.../camel/impl/engine/DefaultCamelContextTest.java | 60 ++--
.../EventNotifierFailureHandledEventsTest.java | 12 +-
.../camel/issues/ChangeHeaderCaseIssueTest.java | 3 +-
.../camel/issues/ProxyReturnNullIssueTest.java | 3 +-
.../org/apache/camel/language/TokenizerTest.java | 6 +-
.../apache/camel/language/simple/SimpleTest.java | 5 +-
.../camel/processor/DataFormatServiceTest.java | 10 +-
.../apache/camel/processor/LogEipListenerTest.java | 3 +-
.../MulticastParallelFailureEndpointTest.java | 3 +-
.../processor/RollbackDefaultErrorHandlerTest.java | 2 +-
.../camel/processor/RollbackDoTryCatchTest.java | 3 +-
.../org/apache/camel/processor/RollbackTest.java | 2 +-
.../camel/processor/RouteMEPOptionalOutTest.java | 9 +-
...StartupOrderSuspendResumeNoAutoStartupTest.java | 5 +-
.../processor/ThrowExceptionNullMessageTest.java | 4 +-
.../TryProcessorHandleWrappedExceptionTest.java | 2 +-
.../apache/camel/processor/TryProcessorTest.java | 2 +-
.../aggregator/AggregateProcessorTest.java | 2 +-
.../AggregateShutdownThreadPoolTest.java | 15 +-
.../AuditInterceptorAsyncDelegateIssueTest.java | 6 +-
.../AuditInterceptorDelegateIssueTest.java | 6 +-
.../camel/processor/resequencer/SequenceTest.java | 9 +-
.../DefaultValidationErrorHandlerTest.java | 14 +-
.../camel/support/DefaultTimeoutMapTest.java | 2 +-
.../camel/support/IntrospectionSupportTest.java | 58 ++--
.../camel/support/PropertyBindingSupportTest.java | 14 +-
.../apache/camel/support/ServiceSupportTest.java | 74 ++---
.../support/jsse/SSLContextParametersTest.java | 90 +++---
.../apache/camel/util/CaseInsensitiveMapTest.java | 102 +++---
.../org/apache/camel/util/EndpointHelperTest.java | 4 +-
.../java/org/apache/camel/util/FileUtilTest.java | 49 +--
.../org/apache/camel/util/MessageHelperTest.java | 2 +-
.../org/apache/camel/util/PackageHelperTest.java | 4 +-
.../apache/camel/util/StingQuoteHelperTest.java | 3 +-
.../org/apache/camel/util/StringHelperTest.java | 116 +++----
73 files changed, 718 insertions(+), 673 deletions(-)
diff --git a/core/camel-core/src/test/java/org/apache/camel/SuspendableServiceTest.java b/core/camel-core/src/test/java/org/apache/camel/SuspendableServiceTest.java
index 908a97eac1a..5f2aaf2f0d7 100644
--- a/core/camel-core/src/test/java/org/apache/camel/SuspendableServiceTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/SuspendableServiceTest.java
@@ -18,7 +18,8 @@ package org.apache.camel;
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.assertTrue;
public class SuspendableServiceTest {
@@ -53,13 +54,13 @@ public class SuspendableServiceTest {
@Test
public void testSuspendable() {
MyService my = new MyService();
- assertEquals(false, my.isSuspended());
+ assertFalse(my.isSuspended());
my.suspend();
- assertEquals(true, my.isSuspended());
+ assertTrue(my.isSuspended());
my.resume();
- assertEquals(false, my.isSuspended());
+ assertFalse(my.isSuspended());
}
}
diff --git a/core/camel-core/src/test/java/org/apache/camel/builder/ContextErrorHandlerTest.java b/core/camel-core/src/test/java/org/apache/camel/builder/ContextErrorHandlerTest.java
index a2104509630..c98982a0fc8 100644
--- a/core/camel-core/src/test/java/org/apache/camel/builder/ContextErrorHandlerTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/builder/ContextErrorHandlerTest.java
@@ -33,6 +33,7 @@ import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
public class ContextErrorHandlerTest extends ContextTestSupport {
@@ -116,7 +117,7 @@ public class ContextErrorHandlerTest extends ContextTestSupport {
RedeliveryPolicy redeliveryPolicy = deadLetterChannel.getRedeliveryPolicy();
assertEquals(1, redeliveryPolicy.getMaximumRedeliveries(), "getMaximumRedeliveries()");
- assertEquals(true, redeliveryPolicy.isUseExponentialBackOff(), "isUseExponentialBackOff()");
+ assertTrue(redeliveryPolicy.isUseExponentialBackOff(), "isUseExponentialBackOff()");
}
}
diff --git a/core/camel-core/src/test/java/org/apache/camel/builder/ErrorHandlerTest.java b/core/camel-core/src/test/java/org/apache/camel/builder/ErrorHandlerTest.java
index e6d91b9a74d..b141a455227 100644
--- a/core/camel-core/src/test/java/org/apache/camel/builder/ErrorHandlerTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/builder/ErrorHandlerTest.java
@@ -31,6 +31,7 @@ import org.apache.camel.processor.errorhandler.RedeliveryPolicy;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
public class ErrorHandlerTest extends TestSupport {
@@ -145,7 +146,7 @@ public class ErrorHandlerTest extends TestSupport {
RedeliveryPolicy redeliveryPolicy = deadLetterChannel.getRedeliveryPolicy();
assertEquals(2, redeliveryPolicy.getMaximumRedeliveries(), "getMaximumRedeliveries()");
- assertEquals(true, redeliveryPolicy.isUseExponentialBackOff(), "isUseExponentialBackOff()");
+ assertTrue(redeliveryPolicy.isUseExponentialBackOff(), "isUseExponentialBackOff()");
}
}
diff --git a/core/camel-core/src/test/java/org/apache/camel/builder/NotifyBuilderTest.java b/core/camel-core/src/test/java/org/apache/camel/builder/NotifyBuilderTest.java
index e2eb225ec50..8dd9c829256 100644
--- a/core/camel-core/src/test/java/org/apache/camel/builder/NotifyBuilderTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/builder/NotifyBuilderTest.java
@@ -22,6 +22,8 @@ import org.apache.camel.component.mock.MockEndpoint;
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.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
public class NotifyBuilderTest extends ContextTestSupport {
@@ -86,11 +88,11 @@ public class NotifyBuilderTest extends ContextTestSupport {
assertEquals("from(direct:foo).whenDone(1)", notify.toString());
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:foo", "A");
- assertEquals(true, notify.matches());
+ assertTrue(notify.matches());
}
@Test
@@ -99,11 +101,11 @@ public class NotifyBuilderTest extends ContextTestSupport {
assertEquals("from(direct:beer).whenDone(1)", notify.toString());
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:beer", "A");
- assertEquals(true, notify.matches());
+ assertTrue(notify.matches());
}
@Test
@@ -112,13 +114,13 @@ public class NotifyBuilderTest extends ContextTestSupport {
assertEquals("fromRoute(foo).whenDone(1)", notify.toString());
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:bar", "A");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:foo", "B");
- assertEquals(true, notify.matches());
+ assertTrue(notify.matches());
}
@Test
@@ -127,13 +129,13 @@ public class NotifyBuilderTest extends ContextTestSupport {
assertEquals("fromRoute(foo).whenReceived(1)", notify.toString());
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:bar", "A");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:foo", "B");
- assertEquals(true, notify.matches());
+ assertTrue(notify.matches());
}
@Test
@@ -142,7 +144,7 @@ public class NotifyBuilderTest extends ContextTestSupport {
assertEquals("from(direct:foo).whenDone(5)", notify.toString());
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:foo", "A");
template.sendBody("direct:foo", "B");
@@ -151,17 +153,17 @@ public class NotifyBuilderTest extends ContextTestSupport {
template.sendBody("direct:bar", "D");
template.sendBody("direct:bar", "E");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:foo", "F");
template.sendBody("direct:bar", "G");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:foo", "H");
template.sendBody("direct:bar", "I");
- assertEquals(true, notify.matches());
+ assertTrue(notify.matches());
}
@Test
@@ -169,7 +171,7 @@ public class NotifyBuilderTest extends ContextTestSupport {
NotifyBuilder notify
= new NotifyBuilder(context).from("direct:foo").whenDone(5).and().from("direct:bar").whenDone(7).create();
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:foo", "A");
template.sendBody("direct:foo", "B");
@@ -178,23 +180,23 @@ public class NotifyBuilderTest extends ContextTestSupport {
template.sendBody("direct:bar", "D");
template.sendBody("direct:bar", "E");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:foo", "F");
template.sendBody("direct:bar", "G");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:foo", "H");
template.sendBody("direct:bar", "I");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:bar", "J");
template.sendBody("direct:bar", "K");
template.sendBody("direct:bar", "L");
- assertEquals(true, notify.matches());
+ assertTrue(notify.matches());
}
@Test
@@ -202,7 +204,7 @@ public class NotifyBuilderTest extends ContextTestSupport {
NotifyBuilder notify
= new NotifyBuilder(context).fromRoute("foo").whenDone(5).and().fromRoute("bar").whenDone(7).create();
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:foo", "A");
template.sendBody("direct:foo", "B");
@@ -211,23 +213,23 @@ public class NotifyBuilderTest extends ContextTestSupport {
template.sendBody("direct:bar", "D");
template.sendBody("direct:bar", "E");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:foo", "F");
template.sendBody("direct:bar", "G");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:foo", "H");
template.sendBody("direct:bar", "I");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:bar", "J");
template.sendBody("direct:bar", "K");
template.sendBody("direct:bar", "L");
- assertEquals(true, notify.matches());
+ assertTrue(notify.matches());
}
@Test
@@ -235,22 +237,22 @@ public class NotifyBuilderTest extends ContextTestSupport {
NotifyBuilder notify = new NotifyBuilder(context).fromRoute("foo").whenDone(2).and().fromRoute("bar").whenReceived(1)
.not().fromRoute("cake").whenDone(1).create();
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:foo", "A");
template.sendBody("direct:foo", "B");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:bar", "C");
- assertEquals(true, notify.matches());
+ assertTrue(notify.matches());
template.sendBody("direct:foo", "D");
template.sendBody("direct:bar", "E");
- assertEquals(true, notify.matches());
+ assertTrue(notify.matches());
// and now the cake to make it false
template.sendBody("direct:cake", "F");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
}
@Test
@@ -260,7 +262,7 @@ public class NotifyBuilderTest extends ContextTestSupport {
assertEquals("from(direct:foo).whenDone(5).or().from(direct:bar).whenDone(7)", notify.toString());
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:foo", "A");
template.sendBody("direct:foo", "B");
@@ -269,21 +271,21 @@ public class NotifyBuilderTest extends ContextTestSupport {
template.sendBody("direct:bar", "D");
template.sendBody("direct:bar", "E");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:bar", "G");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:bar", "I");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:bar", "J");
template.sendBody("direct:bar", "K");
template.sendBody("direct:bar", "L");
- assertEquals(true, notify.matches());
+ assertTrue(notify.matches());
}
@Test
@@ -293,22 +295,22 @@ public class NotifyBuilderTest extends ContextTestSupport {
assertEquals("from(direct:foo).whenDone(5).not().from(direct:bar).whenDone(1)", notify.toString());
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:foo", "A");
template.sendBody("direct:foo", "B");
template.sendBody("direct:foo", "C");
template.sendBody("direct:foo", "D");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:foo", "E");
- assertEquals(true, notify.matches());
+ assertTrue(notify.matches());
template.sendBody("direct:foo", "F");
- assertEquals(true, notify.matches());
+ assertTrue(notify.matches());
template.sendBody("direct:bar", "G");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
}
@Test
@@ -317,13 +319,13 @@ public class NotifyBuilderTest extends ContextTestSupport {
assertEquals("whenDone(5).or().whenFailed(1)", notify.toString());
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:foo", "A");
template.sendBody("direct:foo", "B");
template.sendBody("direct:foo", "D");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
try {
template.sendBody("direct:fail", "E");
@@ -332,14 +334,14 @@ public class NotifyBuilderTest extends ContextTestSupport {
// ignore
}
- assertEquals(true, notify.matches());
+ assertTrue(notify.matches());
}
@Test
public void testWhenExchangeDoneNotFailure() throws Exception {
NotifyBuilder notify = new NotifyBuilder(context).whenDone(5).not().whenFailed(1).create();
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:foo", "A");
template.sendBody("direct:foo", "B");
@@ -347,7 +349,7 @@ public class NotifyBuilderTest extends ContextTestSupport {
template.sendBody("direct:bar", "E");
template.sendBody("direct:bar", "F");
- assertEquals(true, notify.matches());
+ assertTrue(notify.matches());
try {
template.sendBody("direct:fail", "G");
@@ -356,7 +358,7 @@ public class NotifyBuilderTest extends ContextTestSupport {
// ignore
}
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
}
@Test
@@ -365,27 +367,27 @@ public class NotifyBuilderTest extends ContextTestSupport {
assertEquals("filter(body contains World).whenDone(3)", notify.toString());
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:foo", "Hello World");
template.sendBody("direct:foo", "Hi World");
template.sendBody("direct:foo", "A");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:bar", "B");
template.sendBody("direct:bar", "C");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:bar", "Bye World");
- assertEquals(true, notify.matches());
+ assertTrue(notify.matches());
template.sendBody("direct:foo", "D");
template.sendBody("direct:bar", "Hey World");
- assertEquals(true, notify.matches());
+ assertTrue(notify.matches());
}
@Test
@@ -393,58 +395,58 @@ public class NotifyBuilderTest extends ContextTestSupport {
NotifyBuilder notify
= new NotifyBuilder(context).from("direct:foo").filter(body().contains("World")).whenDone(3).create();
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:foo", "Hello World");
template.sendBody("direct:foo", "Hi World");
template.sendBody("direct:foo", "A");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:bar", "B");
template.sendBody("direct:foo", "C");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:bar", "Bye World");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:bar", "D");
template.sendBody("direct:foo", "Hey World");
- assertEquals(true, notify.matches());
+ assertTrue(notify.matches());
template.sendBody("direct:bar", "E");
template.sendBody("direct:foo", "Hi Again World");
- assertEquals(true, notify.matches());
+ assertTrue(notify.matches());
}
@Test
public void testFromFilterBuilderWhenExchangeDone() throws Exception {
NotifyBuilder notify = new NotifyBuilder(context).filter().xpath("/person[@name='James']").whenDone(1).create();
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:foo", "<person name='Claus'/>");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:foo", "<person name='Jonathan'/>");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:foo", "<person name='James'/>");
- assertEquals(true, notify.matches());
+ assertTrue(notify.matches());
template.sendBody("direct:foo", "<person name='Hadrian'/>");
- assertEquals(true, notify.matches());
+ assertTrue(notify.matches());
}
@Test
public void testWhenExchangeCompleted() throws Exception {
NotifyBuilder notify = new NotifyBuilder(context).whenCompleted(5).create();
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:foo", "A");
template.sendBody("direct:foo", "B");
@@ -465,61 +467,61 @@ public class NotifyBuilderTest extends ContextTestSupport {
}
// should NOT be completed as it only counts successful exchanges
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:bar", "F");
template.sendBody("direct:foo", "G");
template.sendBody("direct:bar", "H");
// now it should match
- assertEquals(true, notify.matches());
+ assertTrue(notify.matches());
}
@Test
public void testWhenExchangeExactlyDone() throws Exception {
NotifyBuilder notify = new NotifyBuilder(context).whenExactlyDone(5).create();
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:foo", "A");
template.sendBody("direct:foo", "B");
template.sendBody("direct:foo", "C");
template.sendBody("direct:bar", "D");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:bar", "E");
- assertEquals(true, notify.matches());
+ assertTrue(notify.matches());
template.sendBody("direct:foo", "F");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
}
@Test
public void testWhenExchangeExactlyComplete() throws Exception {
NotifyBuilder notify = new NotifyBuilder(context).whenExactlyCompleted(5).create();
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:foo", "A");
template.sendBody("direct:foo", "B");
template.sendBody("direct:foo", "C");
template.sendBody("direct:bar", "D");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:bar", "E");
- assertEquals(true, notify.matches());
+ assertTrue(notify.matches());
template.sendBody("direct:foo", "F");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
}
@Test
public void testWhenExchangeExactlyFailed() throws Exception {
NotifyBuilder notify = new NotifyBuilder(context).whenExactlyFailed(2).create();
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:foo", "A");
template.sendBody("direct:foo", "B");
@@ -533,7 +535,7 @@ public class NotifyBuilderTest extends ContextTestSupport {
}
template.sendBody("direct:bar", "E");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
try {
template.sendBody("direct:fail", "F");
@@ -541,10 +543,10 @@ public class NotifyBuilderTest extends ContextTestSupport {
} catch (Exception e) {
// ignore
}
- assertEquals(true, notify.matches());
+ assertTrue(notify.matches());
template.sendBody("direct:bar", "G");
- assertEquals(true, notify.matches());
+ assertTrue(notify.matches());
try {
template.sendBody("direct:fail", "H");
@@ -552,145 +554,145 @@ public class NotifyBuilderTest extends ContextTestSupport {
} catch (Exception e) {
// ignore
}
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
}
@Test
public void testWhenAnyReceivedMatches() throws Exception {
NotifyBuilder notify = new NotifyBuilder(context).whenAnyReceivedMatches(body().contains("Camel")).create();
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:foo", "Hello World");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:foo", "Bye World");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:bar", "Hello Camel");
- assertEquals(true, notify.matches());
+ assertTrue(notify.matches());
}
@Test
public void testWhenAllReceivedMatches() throws Exception {
NotifyBuilder notify = new NotifyBuilder(context).whenAllReceivedMatches(body().contains("Camel")).create();
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:foo", "Hello Camel");
- assertEquals(true, notify.matches());
+ assertTrue(notify.matches());
template.sendBody("direct:foo", "Bye Camel");
- assertEquals(true, notify.matches());
+ assertTrue(notify.matches());
template.sendBody("direct:bar", "Hello World");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
}
@Test
public void testWhenAnyDoneMatches() throws Exception {
NotifyBuilder notify = new NotifyBuilder(context).whenAnyDoneMatches(body().contains("Bye")).create();
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:foo", "Hi World");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:cake", "Camel");
- assertEquals(true, notify.matches());
+ assertTrue(notify.matches());
template.sendBody("direct:foo", "Damn World");
- assertEquals(true, notify.matches());
+ assertTrue(notify.matches());
}
@Test
public void testWhenAllDoneMatches() throws Exception {
NotifyBuilder notify = new NotifyBuilder(context).whenAllDoneMatches(body().contains("Bye")).create();
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:cake", "Camel");
- assertEquals(true, notify.matches());
+ assertTrue(notify.matches());
template.sendBody("direct:cake", "World");
- assertEquals(true, notify.matches());
+ assertTrue(notify.matches());
template.sendBody("direct:foo", "Hi World");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
}
@Test
public void testWhenBodiesReceived() throws Exception {
NotifyBuilder notify = new NotifyBuilder(context).whenBodiesReceived("Hi World", "Hello World").create();
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:foo", "Hi World");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:foo", "Hello World");
- assertEquals(true, notify.matches());
+ assertTrue(notify.matches());
// should keep being true
template.sendBody("direct:foo", "Bye World");
- assertEquals(true, notify.matches());
+ assertTrue(notify.matches());
template.sendBody("direct:foo", "Damn World");
- assertEquals(true, notify.matches());
+ assertTrue(notify.matches());
}
@Test
public void testWhenBodiesDone() throws Exception {
NotifyBuilder notify = new NotifyBuilder(context).whenBodiesDone("Bye World", "Bye Camel").create();
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.requestBody("direct:cake", "World");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:cake", "Camel");
- assertEquals(true, notify.matches());
+ assertTrue(notify.matches());
// should keep being true
template.sendBody("direct:foo", "Damn World");
- assertEquals(true, notify.matches());
+ assertTrue(notify.matches());
}
@Test
public void testWhenExactBodiesReceived() throws Exception {
NotifyBuilder notify = new NotifyBuilder(context).whenExactBodiesReceived("Hi World", "Hello World").create();
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:foo", "Hi World");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:foo", "Hello World");
- assertEquals(true, notify.matches());
+ assertTrue(notify.matches());
// should not keep being true
template.sendBody("direct:foo", "Bye World");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:foo", "Damn World");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
}
@Test
public void testWhenExactBodiesDone() throws Exception {
NotifyBuilder notify = new NotifyBuilder(context).whenExactBodiesDone("Bye World", "Bye Camel").create();
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.requestBody("direct:cake", "World");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:cake", "Camel");
- assertEquals(true, notify.matches());
+ assertTrue(notify.matches());
// should NOT keep being true
template.sendBody("direct:foo", "Damn World");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
}
@Test
@@ -704,21 +706,21 @@ public class NotifyBuilderTest extends ContextTestSupport {
NotifyBuilder notify = new NotifyBuilder(context).from("direct:foo").whenDoneSatisfied(mock).create();
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:foo", "Bye World");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:foo", "Hello World");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
// the notify is based on direct:foo so sending to bar should not
// trigger match
template.sendBody("direct:bar", "Hi World");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:foo", "Hi World");
- assertEquals(true, notify.matches());
+ assertTrue(notify.matches());
}
@Test
@@ -732,21 +734,21 @@ public class NotifyBuilderTest extends ContextTestSupport {
NotifyBuilder notify = new NotifyBuilder(context).from("direct:foo").whenDoneSatisfied(mock).create();
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:foo", "Bye World");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:foo", "Hello World");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
// the notify is based on direct:foo so sending to bar should not
// trigger match
template.sendBody("direct:bar", "Hi World");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:foo", "Hi World");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
}
@Test
@@ -762,13 +764,13 @@ public class NotifyBuilderTest extends ContextTestSupport {
NotifyBuilder notify = new NotifyBuilder(context).from("direct:foo").whenReceivedNotSatisfied(mock).create();
// is always false to start with
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:foo", "Bye World");
- assertEquals(true, notify.matches());
+ assertTrue(notify.matches());
template.sendBody("direct:foo", "Hello Camel");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
}
@Test
@@ -783,13 +785,13 @@ public class NotifyBuilderTest extends ContextTestSupport {
NotifyBuilder notify = new NotifyBuilder(context).from("direct:foo").whenReceivedSatisfied(mock).create();
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:foo", "Bye World");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:foo", "Hello Camel");
- assertEquals(true, notify.matches());
+ assertTrue(notify.matches());
}
@Test
@@ -801,29 +803,29 @@ public class NotifyBuilderTest extends ContextTestSupport {
.from("direct:bar").whenExactlyDone(5)
.whenAnyReceivedMatches(body().contains("Camel")).create();
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:foo", "Bye World");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:foo", "Hello World");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
// the notify is based on direct:foo so sending to bar should not
// trigger match
template.sendBody("direct:bar", "Hi World");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:foo", "Hi World");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:bar", "Hi Camel");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:bar", "A");
template.sendBody("direct:bar", "B");
template.sendBody("direct:bar", "C");
- assertEquals(true, notify.matches());
+ assertTrue(notify.matches());
}
@Test
@@ -838,17 +840,17 @@ public class NotifyBuilderTest extends ContextTestSupport {
NotifyBuilder notify = new NotifyBuilder(context).whenDoneSatisfied(mock).create();
// is always false to start with
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.requestBody("direct:cake", "World");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.requestBody("direct:cake", "Camel");
- assertEquals(true, notify.matches());
+ assertTrue(notify.matches());
template.requestBody("direct:cake", "Damn");
// will still be true as the mock has been completed
- assertEquals(true, notify.matches());
+ assertTrue(notify.matches());
}
@Test
@@ -863,17 +865,17 @@ public class NotifyBuilderTest extends ContextTestSupport {
NotifyBuilder notify = new NotifyBuilder(context).whenDoneNotSatisfied(mock).create();
// is always false to start with
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.requestBody("direct:cake", "World");
- assertEquals(true, notify.matches());
+ assertTrue(notify.matches());
template.requestBody("direct:cake", "Camel");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.requestBody("direct:cake", "Damn");
// will still be false as the mock has been completed
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
}
@Test
@@ -881,20 +883,20 @@ public class NotifyBuilderTest extends ContextTestSupport {
NotifyBuilder notify = new NotifyBuilder(context).whenExactlyDone(1).create();
template.sendBody("direct:foo", "Hello World");
- assertEquals(true, notify.matches());
+ assertTrue(notify.matches());
template.sendBody("direct:foo", "Bye World");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
// reset
notify.reset();
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:foo", "Hello World");
- assertEquals(true, notify.matches());
+ assertTrue(notify.matches());
template.sendBody("direct:foo", "Bye World");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
}
@Test
@@ -903,17 +905,17 @@ public class NotifyBuilderTest extends ContextTestSupport {
template.sendBody("direct:foo", "Hello World");
template.sendBody("direct:foo", "Bye World");
- assertEquals(true, notify.matches());
+ assertTrue(notify.matches());
// reset
notify.reset();
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:foo", "Hello World");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:foo", "Bye World");
- assertEquals(true, notify.matches());
+ assertTrue(notify.matches());
}
@Test
@@ -931,10 +933,10 @@ public class NotifyBuilderTest extends ContextTestSupport {
NotifyBuilder notify = new NotifyBuilder(context).wereSentTo("mock:foo").whenDone(1).create();
template.sendBody("direct:bar", "Hello World");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:foo", "Bye World");
- assertEquals(true, notify.matches());
+ assertTrue(notify.matches());
}
@Test
@@ -943,10 +945,10 @@ public class NotifyBuilderTest extends ContextTestSupport {
NotifyBuilder notify = new NotifyBuilder(context).wereSentTo("log:beer").wereSentTo("mock:beer").whenDone(1).create();
template.sendBody("direct:bar", "Hello World");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:beer", "Bye World");
- assertEquals(true, notify.matches());
+ assertTrue(notify.matches());
}
@Test
@@ -955,22 +957,22 @@ public class NotifyBuilderTest extends ContextTestSupport {
NotifyBuilder notify = new NotifyBuilder(context).whenDone(2).wereSentTo("mock:beer").create();
template.sendBody("direct:bar", "A");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:beer", "B");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:bar", "C");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:bar", "D");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:cake", "E");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:beer", "F");
- assertEquals(true, notify.matches());
+ assertTrue(notify.matches());
}
@Test
@@ -979,22 +981,22 @@ public class NotifyBuilderTest extends ContextTestSupport {
NotifyBuilder notify = new NotifyBuilder(context).wereSentTo("mock:beer").whenDone(2).create();
template.sendBody("direct:bar", "A");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:beer", "B");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:bar", "C");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:bar", "D");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:cake", "E");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:beer", "F");
- assertEquals(true, notify.matches());
+ assertTrue(notify.matches());
}
@Test
@@ -1003,10 +1005,10 @@ public class NotifyBuilderTest extends ContextTestSupport {
NotifyBuilder notify = new NotifyBuilder(context).wereSentTo(".*beer.*").whenDone(1).create();
template.sendBody("direct:bar", "Hello World");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:beer", "Bye World");
- assertEquals(true, notify.matches());
+ assertTrue(notify.matches());
}
@Test
@@ -1017,13 +1019,13 @@ public class NotifyBuilderTest extends ContextTestSupport {
.wereSentTo("mock:fail").create();
template.sendBody("direct:bar", "Hello World");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:bar", "Hello World");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("direct:foo", "Hello World");
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
try {
template.sendBody("direct:fail", "Bye World");
@@ -1031,7 +1033,7 @@ public class NotifyBuilderTest extends ContextTestSupport {
} catch (CamelExecutionException e) {
// expected
}
- assertEquals(true, notify.matches());
+ assertTrue(notify.matches());
}
@Override
diff --git a/core/camel-core/src/test/java/org/apache/camel/builder/NotifyBuilderWhenDoneByIndexTest.java b/core/camel-core/src/test/java/org/apache/camel/builder/NotifyBuilderWhenDoneByIndexTest.java
index 203e9a09df0..4e6e3ffc61e 100644
--- a/core/camel-core/src/test/java/org/apache/camel/builder/NotifyBuilderWhenDoneByIndexTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/builder/NotifyBuilderWhenDoneByIndexTest.java
@@ -24,6 +24,8 @@ import org.apache.camel.Processor;
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.assertTrue;
public class NotifyBuilderWhenDoneByIndexTest extends ContextTestSupport {
@@ -40,11 +42,11 @@ public class NotifyBuilderWhenDoneByIndexTest extends ContextTestSupport {
// notify when the 1st exchange is done (by index)
NotifyBuilder notify = new NotifyBuilder(context).whenDoneByIndex(0).create();
- assertEquals(false, notify.matches());
+ assertFalse(notify.matches());
template.sendBody("seda:foo", "A,B,C");
- assertEquals(true, notify.matchesWaitTime());
+ assertTrue(notify.matchesWaitTime());
assertEquals(3, counter.get());
}
diff --git a/core/camel-core/src/test/java/org/apache/camel/builder/PredicateBuilderConcurrentTest.java b/core/camel-core/src/test/java/org/apache/camel/builder/PredicateBuilderConcurrentTest.java
index c1aa3cc6d8f..9ec67aceffd 100644
--- a/core/camel-core/src/test/java/org/apache/camel/builder/PredicateBuilderConcurrentTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/builder/PredicateBuilderConcurrentTest.java
@@ -31,7 +31,8 @@ import org.apache.camel.Predicate;
import org.apache.camel.support.DefaultExchange;
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.assertTrue;
public class PredicateBuilderConcurrentTest extends ContextTestSupport {
@@ -74,9 +75,9 @@ public class PredicateBuilderConcurrentTest extends ContextTestSupport {
for (int i = 0; i < 1000; i++) {
Boolean result = futures.get(i).get(10, TimeUnit.SECONDS);
if (i % 2 == 0) {
- assertEquals(true, result.booleanValue(), "Should be true for #" + i);
+ assertTrue(result.booleanValue(), "Should be true for #" + i);
} else {
- assertEquals(false, result.booleanValue(), "Should be false for #" + i);
+ assertFalse(result.booleanValue(), "Should be false for #" + i);
}
}
diff --git a/core/camel-core/src/test/java/org/apache/camel/builder/SimpleBuilderTest.java b/core/camel-core/src/test/java/org/apache/camel/builder/SimpleBuilderTest.java
index 641fce263d1..70fc69a47f0 100644
--- a/core/camel-core/src/test/java/org/apache/camel/builder/SimpleBuilderTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/builder/SimpleBuilderTest.java
@@ -80,12 +80,12 @@ public class SimpleBuilderTest extends TestSupport {
assertEquals(true, SimpleBuilder.simple("${header.cool}", boolean.class).evaluate(exchange, Object.class));
assertEquals("true", SimpleBuilder.simple("${header.cool}", String.class).evaluate(exchange, Object.class));
// not possible
- assertEquals(null, SimpleBuilder.simple("${header.cool}", int.class).evaluate(exchange, Object.class));
+ assertNull(SimpleBuilder.simple("${header.cool}", int.class).evaluate(exchange, Object.class));
assertEquals(true, SimpleBuilder.simple("${header.cool}").resultType(Boolean.class).evaluate(exchange, Object.class));
assertEquals("true", SimpleBuilder.simple("${header.cool}").resultType(String.class).evaluate(exchange, Object.class));
// not possible
- assertEquals(null, SimpleBuilder.simple("${header.cool}").resultType(int.class).evaluate(exchange, Object.class));
+ assertNull(SimpleBuilder.simple("${header.cool}").resultType(int.class).evaluate(exchange, Object.class));
// should be convertable to integers
assertEquals(11, SimpleBuilder.simple("11", int.class).evaluate(exchange, Object.class));
diff --git a/core/camel-core/src/test/java/org/apache/camel/builder/ThreadPoolBuilderTest.java b/core/camel-core/src/test/java/org/apache/camel/builder/ThreadPoolBuilderTest.java
index 4c2a1c97b56..4567ce64d58 100644
--- a/core/camel-core/src/test/java/org/apache/camel/builder/ThreadPoolBuilderTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/builder/ThreadPoolBuilderTest.java
@@ -26,8 +26,9 @@ import org.apache.camel.spi.Registry;
import org.apache.camel.util.concurrent.ThreadPoolRejectedPolicy;
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.assertTrue;
public class ThreadPoolBuilderTest extends ContextTestSupport {
@@ -45,9 +46,9 @@ public class ThreadPoolBuilderTest extends ContextTestSupport {
ExecutorService executor = builder.build(this, "myPool");
assertNotNull(executor);
- assertEquals(false, executor.isShutdown());
+ assertFalse(executor.isShutdown());
context.stop();
- assertEquals(true, executor.isShutdown());
+ assertTrue(executor.isShutdown());
}
@Test
@@ -56,9 +57,9 @@ public class ThreadPoolBuilderTest extends ContextTestSupport {
ExecutorService executor = builder.maxQueueSize(2000).build(this, "myPool");
assertNotNull(executor);
- assertEquals(false, executor.isShutdown());
+ assertFalse(executor.isShutdown());
context.stop();
- assertEquals(true, executor.isShutdown());
+ assertTrue(executor.isShutdown());
}
@Test
@@ -67,9 +68,9 @@ public class ThreadPoolBuilderTest extends ContextTestSupport {
ExecutorService executor = builder.maxPoolSize(100).build(this, "myPool");
assertNotNull(executor);
- assertEquals(false, executor.isShutdown());
+ assertFalse(executor.isShutdown());
context.stop();
- assertEquals(true, executor.isShutdown());
+ assertTrue(executor.isShutdown());
}
@Test
@@ -78,9 +79,9 @@ public class ThreadPoolBuilderTest extends ContextTestSupport {
ExecutorService executor = builder.poolSize(50).maxPoolSize(100).build(this, "myPool");
assertNotNull(executor);
- assertEquals(false, executor.isShutdown());
+ assertFalse(executor.isShutdown());
context.stop();
- assertEquals(true, executor.isShutdown());
+ assertTrue(executor.isShutdown());
}
@Test
@@ -89,9 +90,9 @@ public class ThreadPoolBuilderTest extends ContextTestSupport {
ExecutorService executor = builder.keepAliveTime(30).build(this, "myPool");
assertNotNull(executor);
- assertEquals(false, executor.isShutdown());
+ assertFalse(executor.isShutdown());
context.stop();
- assertEquals(true, executor.isShutdown());
+ assertTrue(executor.isShutdown());
}
@Test
@@ -100,9 +101,9 @@ public class ThreadPoolBuilderTest extends ContextTestSupport {
ExecutorService executor = builder.keepAliveTime(20000, TimeUnit.MILLISECONDS).build(this, "myPool");
assertNotNull(executor);
- assertEquals(false, executor.isShutdown());
+ assertFalse(executor.isShutdown());
context.stop();
- assertEquals(true, executor.isShutdown());
+ assertTrue(executor.isShutdown());
}
@Test
@@ -113,9 +114,9 @@ public class ThreadPoolBuilderTest extends ContextTestSupport {
.rejectedPolicy(ThreadPoolRejectedPolicy.DiscardOldest).build(this, "myPool");
assertNotNull(executor);
- assertEquals(false, executor.isShutdown());
+ assertFalse(executor.isShutdown());
context.stop();
- assertEquals(true, executor.isShutdown());
+ assertTrue(executor.isShutdown());
}
@Test
@@ -127,11 +128,11 @@ public class ThreadPoolBuilderTest extends ContextTestSupport {
assertNotNull(executor);
assertNotNull(executor2);
- assertEquals(false, executor.isShutdown());
- assertEquals(false, executor2.isShutdown());
+ assertFalse(executor.isShutdown());
+ assertFalse(executor2.isShutdown());
context.stop();
- assertEquals(true, executor.isShutdown());
- assertEquals(true, executor2.isShutdown());
+ assertTrue(executor.isShutdown());
+ assertTrue(executor2.isShutdown());
}
@Test
@@ -140,9 +141,9 @@ public class ThreadPoolBuilderTest extends ContextTestSupport {
ScheduledExecutorService executor = builder.poolSize(5).maxQueueSize(2000).buildScheduled();
assertNotNull(executor);
- assertEquals(false, executor.isShutdown());
+ assertFalse(executor.isShutdown());
context.stop();
- assertEquals(true, executor.isShutdown());
+ assertTrue(executor.isShutdown());
}
@Test
@@ -151,9 +152,9 @@ public class ThreadPoolBuilderTest extends ContextTestSupport {
ScheduledExecutorService executor = builder.poolSize(5).maxQueueSize(2000).buildScheduled("myScheduledPool");
assertNotNull(executor);
- assertEquals(false, executor.isShutdown());
+ assertFalse(executor.isShutdown());
context.stop();
- assertEquals(true, executor.isShutdown());
+ assertTrue(executor.isShutdown());
}
@Test
@@ -162,9 +163,9 @@ public class ThreadPoolBuilderTest extends ContextTestSupport {
ScheduledExecutorService executor = builder.poolSize(5).maxQueueSize(2000).buildScheduled(this, "myScheduledPool");
assertNotNull(executor);
- assertEquals(false, executor.isShutdown());
+ assertFalse(executor.isShutdown());
context.stop();
- assertEquals(true, executor.isShutdown());
+ assertTrue(executor.isShutdown());
}
}
diff --git a/core/camel-core/src/test/java/org/apache/camel/builder/xml/DefaultNamespaceContextTest.java b/core/camel-core/src/test/java/org/apache/camel/builder/xml/DefaultNamespaceContextTest.java
index 1d7e6732461..10dace2ce25 100644
--- a/core/camel-core/src/test/java/org/apache/camel/builder/xml/DefaultNamespaceContextTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/builder/xml/DefaultNamespaceContextTest.java
@@ -44,7 +44,7 @@ public class DefaultNamespaceContextTest extends ContextTestSupport {
assertNull(prefix);
Iterator<String> it = context.getPrefixes("foo");
- assertEquals(false, it.hasNext());
+ assertFalse(it.hasNext());
}
@Test
@@ -61,7 +61,7 @@ public class DefaultNamespaceContextTest extends ContextTestSupport {
assertEquals("pre", prefix);
Iterator<String> it = context.getPrefixes("http://acme/cheese");
- assertEquals(true, it.hasNext());
+ assertTrue(it.hasNext());
assertEquals("pre", it.next());
}
@@ -84,11 +84,11 @@ public class DefaultNamespaceContextTest extends ContextTestSupport {
assertEquals("bar", prefix2);
Iterator<String> it = context.getPrefixes("http://acme/cheese");
- assertEquals(true, it.hasNext());
+ assertTrue(it.hasNext());
assertEquals("pre", it.next());
Iterator<String> it2 = context.getPrefixes("http://acme/bar");
- assertEquals(true, it2.hasNext());
+ assertTrue(it2.hasNext());
assertEquals("bar", it2.next());
}
@@ -104,7 +104,7 @@ public class DefaultNamespaceContextTest extends ContextTestSupport {
String prefix = context.getPrefix(Namespaces.IN_NAMESPACE);
assertEquals("in", prefix);
Iterator<String> it = context.getPrefixes(Namespaces.IN_NAMESPACE);
- assertEquals(true, it.hasNext());
+ assertTrue(it.hasNext());
assertEquals("in", it.next());
String uri2 = context.getNamespaceURI("out");
@@ -123,7 +123,7 @@ public class DefaultNamespaceContextTest extends ContextTestSupport {
// should not have any namespaces
String uri = context.getNamespaceURI("in");
- assertEquals(null, uri);
+ assertNull(uri);
}
@Test
@@ -134,7 +134,7 @@ public class DefaultNamespaceContextTest extends ContextTestSupport {
// should not have any default namespaces
String uri = context.getNamespaceURI("in");
- assertEquals(null, uri);
+ assertNull(uri);
String uri2 = context.getNamespaceURI("foo");
assertEquals("http://acme/cheese", uri2);
diff --git a/core/camel-core/src/test/java/org/apache/camel/builder/xml/XPathTest.java b/core/camel-core/src/test/java/org/apache/camel/builder/xml/XPathTest.java
index de4cface987..0e491965666 100644
--- a/core/camel-core/src/test/java/org/apache/camel/builder/xml/XPathTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/builder/xml/XPathTest.java
@@ -93,7 +93,7 @@ public class XPathTest extends ContextTestSupport {
public void testXPathBooleanResult() throws Exception {
Object result = xpath("/foo/bar/@xyz").booleanResult().evaluate(createExchange("<foo><bar xyz='cheese'/></foo>"));
Boolean bool = assertIsInstanceOf(Boolean.class, result);
- assertEquals(true, bool.booleanValue());
+ assertTrue(bool.booleanValue());
}
@Test
@@ -347,7 +347,7 @@ public class XPathTest extends ContextTestSupport {
assertEquals(123, number.intValue());
Boolean bool = XPathBuilder.xpath("foo/bar").evaluate(context, "<foo><bar>true</bar></foo>", Boolean.class);
- assertEquals(true, bool.booleanValue());
+ assertTrue(bool.booleanValue());
}
@Test
diff --git a/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanEndpointTest.java b/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanEndpointTest.java
index 3e4ea87a57c..42fa6cbb33f 100644
--- a/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanEndpointTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanEndpointTest.java
@@ -23,6 +23,7 @@ import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
public class BeanEndpointTest extends ContextTestSupport {
@@ -47,7 +48,7 @@ public class BeanEndpointTest extends ContextTestSupport {
endpoint.setBeanName("foo");
assertEquals("foo", endpoint.getBeanName());
- assertEquals(true, endpoint.isSingleton());
+ assertTrue(endpoint.isSingleton());
assertNull(endpoint.getBeanHolder());
assertNull(endpoint.getMethod());
assertEquals("bean:foo", endpoint.getEndpointUri());
@@ -73,7 +74,7 @@ public class BeanEndpointTest extends ContextTestSupport {
endpoint.setBeanName("foo");
assertEquals("foo", endpoint.getBeanName());
- assertEquals(true, endpoint.isSingleton());
+ assertTrue(endpoint.isSingleton());
assertNull(endpoint.getBeanHolder());
assertNull(endpoint.getMethod());
assertEquals("bean:foo", endpoint.getEndpointUri());
@@ -101,7 +102,7 @@ public class BeanEndpointTest extends ContextTestSupport {
endpoint.setBeanName("foo");
assertEquals("foo", endpoint.getBeanName());
- assertEquals(true, endpoint.isSingleton());
+ assertTrue(endpoint.isSingleton());
assertNull(endpoint.getBeanHolder());
assertNull(endpoint.getMethod());
assertEquals("bean:foo", endpoint.getEndpointUri());
@@ -127,7 +128,7 @@ public class BeanEndpointTest extends ContextTestSupport {
endpoint.setMethod("hello");
assertEquals("foo", endpoint.getBeanName());
- assertEquals(true, endpoint.isSingleton());
+ assertTrue(endpoint.isSingleton());
assertNull(endpoint.getBeanHolder());
assertEquals("hello", endpoint.getMethod());
assertEquals("bean:foo?method=hello", endpoint.getEndpointUri());
@@ -154,7 +155,7 @@ public class BeanEndpointTest extends ContextTestSupport {
endpoint.setMethod("hello");
assertEquals("foo", endpoint.getBeanName());
- assertEquals(true, endpoint.isSingleton());
+ assertTrue(endpoint.isSingleton());
assertNull(endpoint.getBeanHolder());
assertEquals("hello", endpoint.getMethod());
assertEquals("bean:foo?method=hello", endpoint.getEndpointUri());
diff --git a/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanWithExpressionInjectionPredicateTest.java b/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanWithExpressionInjectionPredicateTest.java
index f1c7c6a3ca1..8e7b64f02b8 100644
--- a/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanWithExpressionInjectionPredicateTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanWithExpressionInjectionPredicateTest.java
@@ -23,6 +23,8 @@ import org.apache.camel.spi.Registry;
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.assertTrue;
public class BeanWithExpressionInjectionPredicateTest extends ContextTestSupport {
protected MyBean myBean = new MyBean();
@@ -32,7 +34,7 @@ public class BeanWithExpressionInjectionPredicateTest extends ContextTestSupport
template.sendBody("direct:in", "Hello");
assertEquals("Hello", myBean.body);
- assertEquals(false, myBean.foo);
+ assertFalse(myBean.foo);
}
@Test
@@ -40,7 +42,7 @@ public class BeanWithExpressionInjectionPredicateTest extends ContextTestSupport
template.sendBodyAndHeader("direct:in", "Hello", "foo", 123);
assertEquals("Hello", myBean.body);
- assertEquals(true, myBean.foo);
+ assertTrue(myBean.foo);
}
@Override
diff --git a/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanWithPropertiesAndHeadersAndBodyInjectionTest.java b/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanWithPropertiesAndHeadersAndBodyInjectionTest.java
index fb9f8a1920a..ba2bc5d939c 100644
--- a/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanWithPropertiesAndHeadersAndBodyInjectionTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanWithPropertiesAndHeadersAndBodyInjectionTest.java
@@ -30,6 +30,7 @@ import org.apache.camel.spi.Registry;
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;
public class BeanWithPropertiesAndHeadersAndBodyInjectionTest extends ContextTestSupport {
@@ -49,7 +50,7 @@ public class BeanWithPropertiesAndHeadersAndBodyInjectionTest extends ContextTes
}
});
- assertEquals(false, out.isFailed(), "Should not fail");
+ assertFalse(out.isFailed(), "Should not fail");
Map<?, ?> foo = myBean.foo;
Map<?, ?> bar = myBean.bar;
diff --git a/core/camel-core/src/test/java/org/apache/camel/component/bean/issues/BeanRouteToDerivedClassTest.java b/core/camel-core/src/test/java/org/apache/camel/component/bean/issues/BeanRouteToDerivedClassTest.java
index 4f0089cd63e..af99c6d7bd1 100644
--- a/core/camel-core/src/test/java/org/apache/camel/component/bean/issues/BeanRouteToDerivedClassTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/component/bean/issues/BeanRouteToDerivedClassTest.java
@@ -23,6 +23,7 @@ import org.apache.camel.spi.Registry;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
public class BeanRouteToDerivedClassTest extends ContextTestSupport {
@@ -68,11 +69,11 @@ public class BeanRouteToDerivedClassTest extends ContextTestSupport {
assertEquals("Hello World", out.toString());
out = template.requestBody("direct:other", new MyMessage("Hello World"));
- assertEquals(null, derived.getAndClearBody(), "Derived class should NOT have been invoked");
+ assertNull(derived.getAndClearBody(), "Derived class should NOT have been invoked");
assertEquals("Bye World", out.toString());
out = template.requestBody("direct:other", new MyMessage("Hello Again"));
- assertEquals(null, derived.getAndClearBody(), "Derived class should NOT have been invoked");
+ assertNull(derived.getAndClearBody(), "Derived class should NOT have been invoked");
assertEquals("Bye World", out.toString());
}
@@ -98,11 +99,11 @@ public class BeanRouteToDerivedClassTest extends ContextTestSupport {
assertEquals("Hello World", out.toString());
out = template.requestBody("direct:other", new MyMessage("Hello World"));
- assertEquals(null, derived.getAndClearBody(), "Derived class should NOT have been invoked");
+ assertNull(derived.getAndClearBody(), "Derived class should NOT have been invoked");
assertEquals("Bye World", out.toString());
out = template.requestBody("direct:other", new MyMessage("Hello Again"));
- assertEquals(null, derived.getAndClearBody(), "Derived class should NOT have been invoked");
+ assertNull(derived.getAndClearBody(), "Derived class should NOT have been invoked");
assertEquals("Bye World", out.toString());
}
diff --git a/core/camel-core/src/test/java/org/apache/camel/component/log/LogListenerTest.java b/core/camel-core/src/test/java/org/apache/camel/component/log/LogListenerTest.java
index 1d9e92c27c5..a54cdbda9b0 100644
--- a/core/camel-core/src/test/java/org/apache/camel/component/log/LogListenerTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/component/log/LogListenerTest.java
@@ -24,6 +24,7 @@ import org.apache.camel.impl.DefaultCamelContext;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
public class LogListenerTest {
private static boolean listenerFired;
@@ -42,7 +43,7 @@ public class LogListenerTest {
context.start();
context.createProducerTemplate().sendBody("direct:foo", "hello");
mock.assertIsSatisfied();
- assertEquals(true, listenerFired);
+ assertTrue(listenerFired);
context.stop();
}
diff --git a/core/camel-core/src/test/java/org/apache/camel/component/rest/FromRestGetTest.java b/core/camel-core/src/test/java/org/apache/camel/component/rest/FromRestGetTest.java
index a64da24731c..aef7b5e57fe 100644
--- a/core/camel-core/src/test/java/org/apache/camel/component/rest/FromRestGetTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/component/rest/FromRestGetTest.java
@@ -29,6 +29,7 @@ import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
public class FromRestGetTest extends ContextTestSupport {
@@ -82,7 +83,7 @@ public class FromRestGetTest extends ContextTestSupport {
assertEquals("1", rest.getVerbs().get(0).getParams().get(0).getDefaultValue());
assertEquals("b", rest.getVerbs().get(0).getParams().get(1).getDefaultValue());
- assertEquals(null, rest.getVerbs().get(0).getParams().get(0).getCollectionFormat());
+ assertNull(rest.getVerbs().get(0).getParams().get(0).getCollectionFormat());
assertEquals(CollectionFormat.multi, rest.getVerbs().get(0).getParams().get(1).getCollectionFormat());
assertEquals("header_count", rest.getVerbs().get(0).getParams().get(0).getName());
diff --git a/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaDiscardIfNoConsumerTest.java b/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaDiscardIfNoConsumerTest.java
index 00f84d707dd..709e1eec559 100644
--- a/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaDiscardIfNoConsumerTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaDiscardIfNoConsumerTest.java
@@ -25,6 +25,7 @@ import org.apache.camel.support.SynchronizationAdapter;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
public class SedaDiscardIfNoConsumerTest extends ContextTestSupport {
@@ -63,7 +64,7 @@ public class SedaDiscardIfNoConsumerTest extends ContextTestSupport {
assertEquals(0, bar.getCurrentQueueSize());
- assertEquals(true, myCompletion.isCalled());
+ assertTrue(myCompletion.isCalled());
}
@Override
diff --git a/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaShouldNotUseSameThreadTest.java b/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaShouldNotUseSameThreadTest.java
index b96c740ae4a..c42a1508454 100644
--- a/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaShouldNotUseSameThreadTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaShouldNotUseSameThreadTest.java
@@ -23,8 +23,8 @@ 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.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotSame;
+import static org.junit.jupiter.api.Assertions.assertNull;
/**
* Unit test to verify continuing using NOT same thread on the consumer side.
@@ -58,7 +58,7 @@ public class SedaShouldNotUseSameThreadTest extends ContextTestSupport {
from("seda:foo").process(new Processor() {
public void process(Exchange exchange) throws Exception {
- assertEquals(null, local.get());
+ assertNull(local.get());
assertNotSame(id, Thread.currentThread().getId(), "Thread is should not be same");
}
}).to("mock:result");
diff --git a/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaUnitOfWorkTest.java b/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaUnitOfWorkTest.java
index 8a09c0fe851..0f894d41615 100644
--- a/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaUnitOfWorkTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaUnitOfWorkTest.java
@@ -26,6 +26,7 @@ import org.apache.camel.spi.Synchronization;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
/**
* Unit test to verify unit of work with seda. That the UnitOfWork is able to route using seda but keeping the same UoW.
@@ -78,7 +79,7 @@ public class SedaUnitOfWorkTest extends ContextTestSupport {
from("seda:foo").process(new Processor() {
public void process(Exchange exchange) throws Exception {
- assertEquals(null, sync);
+ assertNull(sync);
}
}).process(new Processor() {
public void process(Exchange exchange) throws Exception {
diff --git a/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaWaitForTaskAsPropertyTest.java b/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaWaitForTaskAsPropertyTest.java
index 2c3e671c383..7396287fffb 100644
--- a/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaWaitForTaskAsPropertyTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaWaitForTaskAsPropertyTest.java
@@ -25,6 +25,7 @@ import org.apache.camel.builder.RouteBuilder;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
public class SedaWaitForTaskAsPropertyTest extends ContextTestSupport {
@@ -58,7 +59,7 @@ public class SedaWaitForTaskAsPropertyTest extends ContextTestSupport {
// we do not expecy a reply and thus do no wait so we just get our own
// input back
assertEquals("Hello World", out.getIn().getBody());
- assertEquals(null, out.getOut().getBody());
+ assertNull(out.getOut().getBody());
assertMockEndpointsSatisfied();
}
diff --git a/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaWaitForTaskIfReplyExpectedTest.java b/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaWaitForTaskIfReplyExpectedTest.java
index de8451f359d..aaa497bc0c0 100644
--- a/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaWaitForTaskIfReplyExpectedTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaWaitForTaskIfReplyExpectedTest.java
@@ -24,6 +24,7 @@ import org.apache.camel.builder.RouteBuilder;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
public class SedaWaitForTaskIfReplyExpectedTest extends ContextTestSupport {
@@ -50,7 +51,7 @@ public class SedaWaitForTaskIfReplyExpectedTest extends ContextTestSupport {
// we do not expecy a reply and thus do no wait so we just get our own
// input back
assertEquals("Hello World", out.getIn().getBody());
- assertEquals(null, out.getOut().getBody());
+ assertNull(out.getOut().getBody());
assertMockEndpointsSatisfied();
}
diff --git a/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaWaitForTaskNewerTest.java b/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaWaitForTaskNewerTest.java
index 808c2274f78..5074d5782ab 100644
--- a/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaWaitForTaskNewerTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaWaitForTaskNewerTest.java
@@ -24,6 +24,7 @@ import org.apache.camel.builder.RouteBuilder;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
public class SedaWaitForTaskNewerTest extends ContextTestSupport {
@@ -50,7 +51,7 @@ public class SedaWaitForTaskNewerTest extends ContextTestSupport {
});
// we do not wait for the response so we just get our own input back
assertEquals("Hello World", out.getIn().getBody());
- assertEquals(null, out.getOut().getBody());
+ assertNull(out.getOut().getBody());
assertMockEndpointsSatisfied();
}
diff --git a/core/camel-core/src/test/java/org/apache/camel/converter/ConverterTest.java b/core/camel-core/src/test/java/org/apache/camel/converter/ConverterTest.java
index 9b646137ed4..2ee4c710c85 100644
--- a/core/camel-core/src/test/java/org/apache/camel/converter/ConverterTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/converter/ConverterTest.java
@@ -47,6 +47,7 @@ import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
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.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -174,8 +175,9 @@ public class ConverterTest extends TestSupport {
@Test
public void testPrimitiveBooleanConversion() {
- boolean value = assertDoesNotThrow(() -> converter.convertTo(boolean.class, null));
- assertFalse(value);
+ boolean value = assertDoesNotThrow(() -> converter.convertTo(boolean.class, null),
+ "A conversion from primitive boolean must not throw when receiving a null value");
+ assertFalse(value, "A conversion from primitive boolean must default to false when converting from null");
}
@Test
@@ -187,8 +189,9 @@ public class ConverterTest extends TestSupport {
@Test
public void testPrimitiveIntPropertySetter() {
MyBean bean = new MyBean();
- assertDoesNotThrow(() -> IntrospectionSupport.setProperty(converter, bean, "foo", "4"));
- assertEquals(4, bean.getFoo(), "bean.foo");
+ assertDoesNotThrow(() -> IntrospectionSupport.setProperty(converter, bean, "foo", "4"),
+ "Setting an int property in a bean, should have succeeded without throwing exceptions");
+ assertEquals(4, bean.getFoo(), "The property bean.foo does not match the value that was previously set");
}
@Test
@@ -200,7 +203,7 @@ public class ConverterTest extends TestSupport {
assertEquals(Boolean.FALSE, value, "converted boolean value");
value = converter.convertTo(Boolean.class, null);
- assertEquals(null, value, "converted boolean value");
+ assertNull(value, "converted boolean value");
}
@Test
@@ -237,11 +240,14 @@ public class ConverterTest extends TestSupport {
@Test
public void testStringToChar() {
- char ch = assertDoesNotThrow(() -> converter.convertTo(char.class, "A"));
- assertEquals('A', (int) ch);
-
- ch = assertDoesNotThrow(() -> converter.convertTo(char.class, " "));
- assertEquals(' ', (int) ch);
+ char ch = assertDoesNotThrow(() -> converter.convertTo(char.class, "A"),
+ "A conversion from String to char should have succeeded without throwing exceptions");
+ assertEquals('A', (int) ch, "The converted value does not match what was set");
+
+ ch = assertDoesNotThrow(() -> converter.convertTo(char.class, " "),
+ "A conversion from String with spaces to char should have succeeded without throwing exceptions");
+ assertEquals(' ', (int) ch,
+ "The converted value does not match what was set");
Exception ex = assertThrows(TypeConversionException.class,
() -> converter.mandatoryConvertTo(char.class, "ABC"), "Should have thrown an exception");
diff --git a/core/camel-core/src/test/java/org/apache/camel/converter/ObjectConverterNaNTest.java b/core/camel-core/src/test/java/org/apache/camel/converter/ObjectConverterNaNTest.java
index f28c001e3c5..53ebba787ba 100644
--- a/core/camel-core/src/test/java/org/apache/camel/converter/ObjectConverterNaNTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/converter/ObjectConverterNaNTest.java
@@ -20,6 +20,7 @@ import org.apache.camel.ContextTestSupport;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
public class ObjectConverterNaNTest extends ContextTestSupport {
@@ -31,56 +32,56 @@ public class ObjectConverterNaNTest extends ContextTestSupport {
@Test
public void testDoubleToLongWithNaN() throws Exception {
assertEquals(Long.valueOf("4"), context.getTypeConverter().convertTo(Long.class, Double.valueOf("4")));
- assertEquals(null, context.getTypeConverter().convertTo(Long.class, Double.NaN));
+ assertNull(context.getTypeConverter().convertTo(Long.class, Double.NaN));
assertEquals(Long.valueOf("3"), context.getTypeConverter().convertTo(Long.class, Double.valueOf("3")));
}
@Test
public void testFloatToLongWithNaN() throws Exception {
assertEquals(Long.valueOf("4"), context.getTypeConverter().convertTo(Long.class, Float.valueOf("4")));
- assertEquals(null, context.getTypeConverter().convertTo(Long.class, Float.NaN));
+ assertNull(context.getTypeConverter().convertTo(Long.class, Float.NaN));
assertEquals(Long.valueOf("3"), context.getTypeConverter().convertTo(Long.class, Float.valueOf("3")));
}
@Test
public void testDoubleToIntegerWithNaN() throws Exception {
assertEquals(Integer.valueOf("4"), context.getTypeConverter().convertTo(Integer.class, Double.valueOf("4")));
- assertEquals(null, context.getTypeConverter().convertTo(Integer.class, Double.NaN));
+ assertNull(context.getTypeConverter().convertTo(Integer.class, Double.NaN));
assertEquals(Integer.valueOf("3"), context.getTypeConverter().convertTo(Integer.class, Double.valueOf("3")));
}
@Test
public void testFloatToIntegerWithNaN() throws Exception {
assertEquals(Integer.valueOf("4"), context.getTypeConverter().convertTo(Integer.class, Float.valueOf("4")));
- assertEquals(null, context.getTypeConverter().convertTo(Integer.class, Float.NaN));
+ assertNull(context.getTypeConverter().convertTo(Integer.class, Float.NaN));
assertEquals(Integer.valueOf("3"), context.getTypeConverter().convertTo(Integer.class, Float.valueOf("3")));
}
@Test
public void testDoubleToShortWithNaN() throws Exception {
assertEquals(Short.valueOf("4"), context.getTypeConverter().convertTo(Short.class, Double.valueOf("4")));
- assertEquals(null, context.getTypeConverter().convertTo(Short.class, Double.NaN));
+ assertNull(context.getTypeConverter().convertTo(Short.class, Double.NaN));
assertEquals(Short.valueOf("3"), context.getTypeConverter().convertTo(Short.class, Double.valueOf("3")));
}
@Test
public void testFloatToShortWithNaN() throws Exception {
assertEquals(Short.valueOf("4"), context.getTypeConverter().convertTo(Short.class, Float.valueOf("4")));
- assertEquals(null, context.getTypeConverter().convertTo(Short.class, Float.NaN));
+ assertNull(context.getTypeConverter().convertTo(Short.class, Float.NaN));
assertEquals(Short.valueOf("3"), context.getTypeConverter().convertTo(Short.class, Float.valueOf("3")));
}
@Test
public void testDoubleToByteWithNaN() throws Exception {
assertEquals(Byte.valueOf("4"), context.getTypeConverter().convertTo(Byte.class, Double.valueOf("4")));
- assertEquals(null, context.getTypeConverter().convertTo(Byte.class, Double.NaN));
+ assertNull(context.getTypeConverter().convertTo(Byte.class, Double.NaN));
assertEquals(Byte.valueOf("3"), context.getTypeConverter().convertTo(Byte.class, Double.valueOf("3")));
}
@Test
public void testFloatToByteWithNaN() throws Exception {
assertEquals(Byte.valueOf("4"), context.getTypeConverter().convertTo(Byte.class, Float.valueOf("4")));
- assertEquals(null, context.getTypeConverter().convertTo(Byte.class, Float.NaN));
+ assertNull(context.getTypeConverter().convertTo(Byte.class, Float.NaN));
assertEquals(Byte.valueOf("3"), context.getTypeConverter().convertTo(Byte.class, Float.valueOf("3")));
}
diff --git a/core/camel-core/src/test/java/org/apache/camel/converter/ObjectConverterTest.java b/core/camel-core/src/test/java/org/apache/camel/converter/ObjectConverterTest.java
index 02e49152638..c25ef5c2fb5 100644
--- a/core/camel-core/src/test/java/org/apache/camel/converter/ObjectConverterTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/converter/ObjectConverterTest.java
@@ -33,7 +33,7 @@ public class ObjectConverterTest {
Iterator<?> it = ObjectConverter.iterator("Claus,Jonathan");
assertEquals("Claus", it.next());
assertEquals("Jonathan", it.next());
- assertEquals(false, it.hasNext());
+ assertFalse(it.hasNext());
}
@Test
@@ -42,7 +42,7 @@ public class ObjectConverterTest {
assertEquals("Claus", it.next());
assertEquals("Jonathan", it.next());
assertEquals("Andrea", it.next());
- assertEquals(false, it.hasNext());
+ assertFalse(it.hasNext());
}
@SuppressWarnings("unchecked")
@@ -70,7 +70,7 @@ public class ObjectConverterTest {
@Test
public void testToClass() {
assertEquals(String.class, ObjectConverter.toClass("java.lang.String", null));
- assertEquals(null, ObjectConverter.toClass("foo.Bar", null));
+ assertNull(ObjectConverter.toClass("foo.Bar", null));
}
@Test
@@ -79,8 +79,8 @@ public class ObjectConverterTest {
assertEquals(Short.valueOf("4"), ObjectConverter.toShort(Integer.valueOf("4")));
assertEquals(Short.valueOf("4"), ObjectConverter.toShort("4"));
assertEquals(Short.valueOf("4"), ObjectConverter.toShort("4".getBytes(StandardCharsets.UTF_8), null));
- assertEquals(null, ObjectConverter.toShort(Double.NaN));
- assertEquals(null, ObjectConverter.toShort(Float.NaN));
+ assertNull(ObjectConverter.toShort(Double.NaN));
+ assertNull(ObjectConverter.toShort(Float.NaN));
assertEquals(Short.valueOf("4"), ObjectConverter.toShort(Short.valueOf("4")));
}
@@ -90,8 +90,8 @@ public class ObjectConverterTest {
assertEquals(Integer.valueOf("4"), ObjectConverter.toInteger(Long.valueOf("4")));
assertEquals(Integer.valueOf("4"), ObjectConverter.toInteger("4"));
assertEquals(Integer.valueOf("4"), ObjectConverter.toInteger("4".getBytes(StandardCharsets.UTF_8), null));
- assertEquals(null, ObjectConverter.toInteger(Double.NaN));
- assertEquals(null, ObjectConverter.toInteger(Float.NaN));
+ assertNull(ObjectConverter.toInteger(Double.NaN));
+ assertNull(ObjectConverter.toInteger(Float.NaN));
assertEquals(Integer.valueOf("4"), ObjectConverter.toInteger(Integer.valueOf("4")));
}
@@ -101,8 +101,8 @@ public class ObjectConverterTest {
assertEquals(Long.valueOf("4"), ObjectConverter.toLong(Integer.valueOf("4")));
assertEquals(Long.valueOf("4"), ObjectConverter.toLong("4"));
assertEquals(Long.valueOf("4"), ObjectConverter.toLong("4".getBytes(StandardCharsets.UTF_8), null));
- assertEquals(null, ObjectConverter.toLong(Double.NaN));
- assertEquals(null, ObjectConverter.toLong(Float.NaN));
+ assertNull(ObjectConverter.toLong(Double.NaN));
+ assertNull(ObjectConverter.toLong(Float.NaN));
assertEquals(Long.valueOf("4"), ObjectConverter.toLong(Long.valueOf("4")));
}
@@ -134,9 +134,9 @@ public class ObjectConverterTest {
assertEquals(BigInteger.valueOf(4), ObjectConverter.toBigInteger(Integer.valueOf("4")));
assertEquals(BigInteger.valueOf(4), ObjectConverter.toBigInteger("4"));
assertEquals(BigInteger.valueOf(123456789L), ObjectConverter.toBigInteger("123456789"));
- assertEquals(null, ObjectConverter.toBigInteger(new Date()));
- assertEquals(null, ObjectConverter.toBigInteger(Double.NaN));
- assertEquals(null, ObjectConverter.toBigInteger(Float.NaN));
+ assertNull(ObjectConverter.toBigInteger(new Date()));
+ assertNull(ObjectConverter.toBigInteger(Double.NaN));
+ assertNull(ObjectConverter.toBigInteger(Float.NaN));
assertEquals(BigInteger.valueOf(4), ObjectConverter.toBigInteger(Long.valueOf("4")));
assertEquals(new BigInteger("14350442579497085228"), ObjectConverter.toBigInteger("14350442579497085228"));
}
diff --git a/core/camel-core/src/test/java/org/apache/camel/converter/jaxp/StaxConverterTest.java b/core/camel-core/src/test/java/org/apache/camel/converter/jaxp/StaxConverterTest.java
index 82f066a1bf3..c8d6ece5e2d 100644
--- a/core/camel-core/src/test/java/org/apache/camel/converter/jaxp/StaxConverterTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/converter/jaxp/StaxConverterTest.java
@@ -23,7 +23,6 @@ import java.io.InputStream;
import java.io.Reader;
import java.io.StringReader;
import java.nio.charset.Charset;
-import java.util.Arrays;
import javax.xml.stream.XMLEventReader;
import javax.xml.stream.XMLEventWriter;
@@ -200,7 +199,7 @@ public class StaxConverterTest extends ContextTestSupport {
if (n2 < 0) {
break;
}
- assertTrue(Arrays.equals(tmp1, tmp2));
+ assertArrayEquals(tmp1, tmp2);
}
} finally {
if (xreader != null) {
@@ -238,7 +237,7 @@ public class StaxConverterTest extends ContextTestSupport {
if (n2 < 0) {
break;
}
- assertTrue(Arrays.equals(tmp1, tmp2));
+ assertArrayEquals(tmp1, tmp2);
}
} finally {
if (xreader != null) {
diff --git a/core/camel-core/src/test/java/org/apache/camel/converter/jaxp/XmlConverterTest.java b/core/camel-core/src/test/java/org/apache/camel/converter/jaxp/XmlConverterTest.java
index 5c4aa4d32bf..98f282652ee 100644
--- a/core/camel-core/src/test/java/org/apache/camel/converter/jaxp/XmlConverterTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/converter/jaxp/XmlConverterTest.java
@@ -73,7 +73,7 @@ public class XmlConverterTest extends ContextTestSupport {
Source source = null;
String out = conv.toString(source, null);
- assertEquals(null, out);
+ assertNull(out);
}
@Test
diff --git a/core/camel-core/src/test/java/org/apache/camel/impl/CamelCustomDefaultThreadPoolProfileTest.java b/core/camel-core/src/test/java/org/apache/camel/impl/CamelCustomDefaultThreadPoolProfileTest.java
index 52c9def29dd..6c18ef2cefe 100644
--- a/core/camel-core/src/test/java/org/apache/camel/impl/CamelCustomDefaultThreadPoolProfileTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/impl/CamelCustomDefaultThreadPoolProfileTest.java
@@ -25,6 +25,7 @@ import org.apache.camel.util.concurrent.ThreadPoolRejectedPolicy;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
public class CamelCustomDefaultThreadPoolProfileTest extends ContextTestSupport {
@@ -55,7 +56,7 @@ public class CamelCustomDefaultThreadPoolProfileTest extends ContextTestSupport
assertEquals(15, profile.getMaxPoolSize().intValue());
assertEquals(25, profile.getKeepAliveTime().longValue());
assertEquals(250, profile.getMaxQueueSize().intValue());
- assertEquals(true, profile.getAllowCoreThreadTimeOut().booleanValue());
+ assertTrue(profile.getAllowCoreThreadTimeOut().booleanValue());
assertEquals(ThreadPoolRejectedPolicy.Abort, profile.getRejectedPolicy());
}
diff --git a/core/camel-core/src/test/java/org/apache/camel/impl/DefaultCamelContextAutoStartupTest.java b/core/camel-core/src/test/java/org/apache/camel/impl/DefaultCamelContextAutoStartupTest.java
index 0fcb644634f..6cbaa61d913 100644
--- a/core/camel-core/src/test/java/org/apache/camel/impl/DefaultCamelContextAutoStartupTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/impl/DefaultCamelContextAutoStartupTest.java
@@ -22,6 +22,8 @@ import org.apache.camel.component.mock.MockEndpoint;
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.assertTrue;
public class DefaultCamelContextAutoStartupTest extends TestSupport {
@@ -39,14 +41,14 @@ public class DefaultCamelContextAutoStartupTest extends TestSupport {
});
camel.start();
- assertEquals(true, camel.isStarted());
+ assertTrue(camel.isStarted());
assertEquals(1, camel.getRoutes().size());
- assertEquals(true, camel.getRouteController().getRouteStatus("foo").isStopped());
+ assertTrue(camel.getRouteController().getRouteStatus("foo").isStopped());
// now start all routes
camel.getRouteController().startAllRoutes();
- assertEquals(true, camel.getRouteController().getRouteStatus("foo").isStarted());
+ assertTrue(camel.getRouteController().getRouteStatus("foo").isStarted());
// and now its started we can test that it works by sending in a message
// to the route
@@ -74,14 +76,14 @@ public class DefaultCamelContextAutoStartupTest extends TestSupport {
});
camel.start();
- assertEquals(true, camel.isStarted());
+ assertTrue(camel.isStarted());
assertEquals(1, camel.getRoutes().size());
- assertEquals(true, camel.getRouteController().getRouteStatus("foo").isStopped());
+ assertTrue(camel.getRouteController().getRouteStatus("foo").isStopped());
// now start the routes
camel.startRoute("foo");
- assertEquals(true, camel.getRouteController().getRouteStatus("foo").isStarted());
+ assertTrue(camel.getRouteController().getRouteStatus("foo").isStarted());
// and now its started we can test that it works by sending in a message
// to the route
@@ -109,9 +111,9 @@ public class DefaultCamelContextAutoStartupTest extends TestSupport {
});
camel.start();
- assertEquals(true, camel.isStarted());
+ assertTrue(camel.isStarted());
assertEquals(1, camel.getRoutes().size());
- assertEquals(true, camel.getRouteController().getRouteStatus("foo").isStarted());
+ assertTrue(camel.getRouteController().getRouteStatus("foo").isStarted());
MockEndpoint mock = camel.getEndpoint("mock:result", MockEndpoint.class);
mock.expectedMessageCount(1);
@@ -140,15 +142,15 @@ public class DefaultCamelContextAutoStartupTest extends TestSupport {
// this is special, when you have auto startup=false on CamelContext,
// then NO routes is started
- assertEquals(true, camel.isStarted());
+ assertTrue(camel.isStarted());
assertEquals(1, camel.getRoutes().size());
- assertEquals(true, camel.getRouteController().getRouteStatus("foo").isStopped());
- assertEquals(false, camel.getRouteController().getRouteStatus("foo").isStarted());
+ assertTrue(camel.getRouteController().getRouteStatus("foo").isStopped());
+ assertFalse(camel.getRouteController().getRouteStatus("foo").isStarted());
// now start all the routes
camel.getRouteController().startAllRoutes();
- assertEquals(true, camel.getRouteController().getRouteStatus("foo").isStarted());
+ assertTrue(camel.getRouteController().getRouteStatus("foo").isStarted());
MockEndpoint mock = camel.getEndpoint("mock:result", MockEndpoint.class);
mock.expectedMessageCount(1);
diff --git a/core/camel-core/src/test/java/org/apache/camel/impl/DefaultExchangeTest.java b/core/camel-core/src/test/java/org/apache/camel/impl/DefaultExchangeTest.java
index f26f132fcea..18bb4478a1b 100644
--- a/core/camel-core/src/test/java/org/apache/camel/impl/DefaultExchangeTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/impl/DefaultExchangeTest.java
@@ -65,7 +65,7 @@ public class DefaultExchangeTest extends ExchangeTestSupport {
assertEquals("<hello id='m123'>world!</hello>", exchange.getIn().getBody());
try {
- assertEquals(null, exchange.getIn().getBody(Integer.class));
+ assertNull(exchange.getIn().getBody(Integer.class));
fail("Should have thrown a TypeConversionException");
} catch (TypeConversionException e) {
// expected
@@ -134,15 +134,15 @@ public class DefaultExchangeTest extends ExchangeTestSupport {
assertTrue(exchange.hasProperties());
assertEquals("apple", exchange.getProperty("fruit"));
- assertEquals(null, exchange.getProperty("beer"));
- assertEquals(null, exchange.getProperty("beer", String.class));
+ assertNull(exchange.getProperty("beer"));
+ assertNull(exchange.getProperty("beer", String.class));
// Current TypeConverter support to turn the null value to false of
// boolean,
// as assertEquals needs the Object as the parameter, we have to use
// Boolean.FALSE value in this case
assertEquals(Boolean.FALSE, exchange.getProperty("beer", boolean.class));
- assertEquals(null, exchange.getProperty("beer", Boolean.class));
+ assertNull(exchange.getProperty("beer", Boolean.class));
assertEquals("apple", exchange.getProperty("fruit", String.class));
assertEquals("apple", exchange.getProperty("fruit", "banana", String.class));
@@ -167,8 +167,8 @@ public class DefaultExchangeTest extends ExchangeTestSupport {
exchange.removeProperties("fr*");
assertTrue(exchange.hasProperties());
assertEquals(1, exchange.getProperties().size());
- assertEquals(null, exchange.getProperty("fruit", String.class));
- assertEquals(null, exchange.getProperty("fruit1", String.class));
+ assertNull(exchange.getProperty("fruit", String.class));
+ assertNull(exchange.getProperty("fruit1", String.class));
assertEquals("Africa", exchange.getProperty("zone", String.class));
}
@@ -206,7 +206,7 @@ public class DefaultExchangeTest extends ExchangeTestSupport {
exchange.removeProperties("fr*", "fruit1", "fruit2");
assertTrue(exchange.hasProperties());
assertEquals(3, exchange.getProperties().size());
- assertEquals(null, exchange.getProperty("fruit", String.class));
+ assertNull(exchange.getProperty("fruit", String.class));
assertEquals("banana", exchange.getProperty("fruit1", String.class));
assertEquals("peach", exchange.getProperty("fruit2", String.class));
assertEquals("Africa", exchange.getProperty("zone", String.class));
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 4431c923114..52c4251f459 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
@@ -133,7 +133,7 @@ public class DefaultExecutorServiceManagerTest extends ContextTestSupport {
@Test
public void testDefaultThreadPool() throws Exception {
ExecutorService myPool = context.getExecutorServiceManager().newDefaultThreadPool(this, "myPool");
- assertEquals(false, myPool.isShutdown());
+ assertFalse(myPool.isShutdown());
// should use default settings
ThreadPoolExecutor executor = (ThreadPoolExecutor) myPool;
@@ -143,7 +143,7 @@ public class DefaultExecutorServiceManagerTest extends ContextTestSupport {
assertEquals(1000, executor.getQueue().remainingCapacity());
context.stop();
- assertEquals(true, myPool.isShutdown());
+ assertTrue(myPool.isShutdown());
}
@Test
@@ -155,10 +155,10 @@ public class DefaultExecutorServiceManagerTest extends ContextTestSupport {
custom.setMaxQueueSize(Integer.MAX_VALUE);
context.getExecutorServiceManager().setDefaultThreadPoolProfile(custom);
- assertEquals(true, custom.isDefaultProfile().booleanValue());
+ assertTrue(custom.isDefaultProfile().booleanValue());
ExecutorService myPool = context.getExecutorServiceManager().newDefaultThreadPool(this, "myPool");
- assertEquals(false, myPool.isShutdown());
+ assertFalse(myPool.isShutdown());
// should use default settings
ThreadPoolExecutor executor = (ThreadPoolExecutor) myPool;
@@ -168,7 +168,7 @@ public class DefaultExecutorServiceManagerTest extends ContextTestSupport {
assertEquals(Integer.MAX_VALUE, executor.getQueue().remainingCapacity());
context.stop();
- assertEquals(true, myPool.isShutdown());
+ assertTrue(myPool.isShutdown());
}
@Test
@@ -180,10 +180,10 @@ public class DefaultExecutorServiceManagerTest extends ContextTestSupport {
custom.setMaxQueueSize(0);
context.getExecutorServiceManager().setDefaultThreadPoolProfile(custom);
- assertEquals(true, custom.isDefaultProfile().booleanValue());
+ assertTrue(custom.isDefaultProfile().booleanValue());
ExecutorService myPool = context.getExecutorServiceManager().newDefaultThreadPool(this, "myPool");
- assertEquals(false, myPool.isShutdown());
+ assertFalse(myPool.isShutdown());
// should use default settings
ThreadPoolExecutor executor = (ThreadPoolExecutor) myPool;
@@ -193,7 +193,7 @@ public class DefaultExecutorServiceManagerTest extends ContextTestSupport {
assertEquals(0, executor.getQueue().remainingCapacity());
context.stop();
- assertEquals(true, myPool.isShutdown());
+ assertTrue(myPool.isShutdown());
}
@Test
@@ -205,10 +205,10 @@ public class DefaultExecutorServiceManagerTest extends ContextTestSupport {
custom.setMaxQueueSize(2000);
context.getExecutorServiceManager().setDefaultThreadPoolProfile(custom);
- assertEquals(true, custom.isDefaultProfile().booleanValue());
+ assertTrue(custom.isDefaultProfile().booleanValue());
ExecutorService myPool = context.getExecutorServiceManager().newDefaultThreadPool(this, "myPool");
- assertEquals(false, myPool.isShutdown());
+ assertFalse(myPool.isShutdown());
// should use default settings
ThreadPoolExecutor executor = (ThreadPoolExecutor) myPool;
@@ -218,7 +218,7 @@ public class DefaultExecutorServiceManagerTest extends ContextTestSupport {
assertEquals(2000, executor.getQueue().remainingCapacity());
context.stop();
- assertEquals(true, myPool.isShutdown());
+ assertTrue(myPool.isShutdown());
}
@Test
diff --git a/core/camel-core/src/test/java/org/apache/camel/impl/DefaultHeaderFilterStrategyTest.java b/core/camel-core/src/test/java/org/apache/camel/impl/DefaultHeaderFilterStrategyTest.java
index bcf714451df..6ff641362c2 100644
--- a/core/camel-core/src/test/java/org/apache/camel/impl/DefaultHeaderFilterStrategyTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/impl/DefaultHeaderFilterStrategyTest.java
@@ -35,16 +35,16 @@ public class DefaultHeaderFilterStrategyTest extends ContextTestSupport {
DefaultHeaderFilterStrategy comp = new DefaultHeaderFilterStrategy();
comp.setAllowNullValues(true);
- assertEquals(true, comp.isAllowNullValues());
+ assertTrue(comp.isAllowNullValues());
comp.setLowerCase(true);
- assertEquals(true, comp.isLowerCase());
+ assertTrue(comp.isLowerCase());
comp.setCaseInsensitive(true);
- assertEquals(true, comp.isCaseInsensitive());
+ assertTrue(comp.isCaseInsensitive());
comp.setFilterOnMatch(false);
- assertEquals(false, comp.isFilterOnMatch());
+ assertFalse(comp.isFilterOnMatch());
}
@Test
diff --git a/core/camel-core/src/test/java/org/apache/camel/impl/DefaultMessageHeaderTest.java b/core/camel-core/src/test/java/org/apache/camel/impl/DefaultMessageHeaderTest.java
index c0da4f323e7..80bde0cd6fc 100644
--- a/core/camel-core/src/test/java/org/apache/camel/impl/DefaultMessageHeaderTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/impl/DefaultMessageHeaderTest.java
@@ -138,9 +138,9 @@ public class DefaultMessageHeaderTest {
msg.removeHeader("FOO");
- assertEquals(null, msg.getHeader("foo"));
- assertEquals(null, msg.getHeader("Foo"));
- assertEquals(null, msg.getHeader("FOO"));
+ assertNull(msg.getHeader("foo"));
+ assertNull(msg.getHeader("Foo"));
+ assertNull(msg.getHeader("FOO"));
assertTrue(msg.getHeaders().isEmpty());
}
@@ -226,7 +226,7 @@ public class DefaultMessageHeaderTest {
// new message headers
assertEquals("bla", msg.getHeader("tick"));
- assertEquals(null, msg.getHeader("tack"));
+ assertNull(msg.getHeader("tack"));
assertEquals("blaaa", msg.getHeader("tock"));
}
@@ -295,7 +295,7 @@ public class DefaultMessageHeaderTest {
assertEquals("cheese", msg.getHeader("foo", "foo"));
assertEquals("cheese", msg.getHeader("foo", "foo", String.class));
- assertEquals(null, msg.getHeader("beer"));
+ assertNull(msg.getHeader("beer"));
assertEquals("foo", msg.getHeader("beer", "foo"));
assertEquals(Integer.valueOf(123), msg.getHeader("beer", "123", Integer.class));
}
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 f6023c64c25..cc0bf0643e9 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
@@ -432,7 +432,7 @@ public class DefaultProducerTemplateAsyncTest extends ContextTestSupport {
assertMockEndpointsSatisfied();
assertEquals(7, order.get());
// no reply when in only
- assertEquals(null, reply);
+ assertNull(reply);
}
@Test
diff --git a/core/camel-core/src/test/java/org/apache/camel/impl/LifecycleStrategyServiceTest.java b/core/camel-core/src/test/java/org/apache/camel/impl/LifecycleStrategyServiceTest.java
index d9b6c9f5269..c8f9b2dbe14 100644
--- a/core/camel-core/src/test/java/org/apache/camel/impl/LifecycleStrategyServiceTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/impl/LifecycleStrategyServiceTest.java
@@ -21,7 +21,8 @@ import org.apache.camel.Service;
import org.apache.camel.TestSupport;
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.assertTrue;
public class LifecycleStrategyServiceTest extends TestSupport {
@@ -35,13 +36,13 @@ public class LifecycleStrategyServiceTest extends TestSupport {
@Test
public void testLifecycleStrategyService() throws Exception {
- assertEquals(false, dummy1.isStarted());
+ assertFalse(dummy1.isStarted());
CamelContext context = createCamelContext();
context.start();
- assertEquals(true, dummy1.isStarted());
+ assertTrue(dummy1.isStarted());
context.stop();
- assertEquals(false, dummy1.isStarted());
+ assertFalse(dummy1.isStarted());
}
private static class MyLifecycleStrategy extends DummyLifecycleStrategy implements Service {
diff --git a/core/camel-core/src/test/java/org/apache/camel/impl/ScheduledPollConsumerTest.java b/core/camel-core/src/test/java/org/apache/camel/impl/ScheduledPollConsumerTest.java
index ae6e3039baf..7e9f69a8f76 100644
--- a/core/camel-core/src/test/java/org/apache/camel/impl/ScheduledPollConsumerTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/impl/ScheduledPollConsumerTest.java
@@ -23,6 +23,8 @@ import org.apache.camel.spi.PollingConsumerPollStrategy;
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.assertTrue;
public class ScheduledPollConsumerTest extends ContextTestSupport {
@@ -58,7 +60,7 @@ public class ScheduledPollConsumerTest extends ContextTestSupport {
consumer.run();
consumer.stop();
- assertEquals(true, rollback, "Should have rollback");
+ assertTrue(rollback, "Should have rollback");
// prepare for 2nd run but this time it should not thrown an exception
// on poll
@@ -70,7 +72,7 @@ public class ScheduledPollConsumerTest extends ContextTestSupport {
// should be able to stop with no problem
consumer.stop();
- assertEquals(false, rollback, "Should not have rollback");
+ assertFalse(rollback, "Should not have rollback");
}
@Test
diff --git a/core/camel-core/src/test/java/org/apache/camel/impl/StopRouteAbortAfterTimeoutTest.java b/core/camel-core/src/test/java/org/apache/camel/impl/StopRouteAbortAfterTimeoutTest.java
index 86c080c9249..8ea8af60df6 100644
--- a/core/camel-core/src/test/java/org/apache/camel/impl/StopRouteAbortAfterTimeoutTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/impl/StopRouteAbortAfterTimeoutTest.java
@@ -46,7 +46,7 @@ public class StopRouteAbortAfterTimeoutTest extends ContextTestSupport {
// confirm that route is still running
assertFalse(stopRouteResponse, "stopRoute response should be False");
- assertEquals(true, context.getRouteController().getRouteStatus("start").isStarted(), "route should still be started");
+ assertTrue(context.getRouteController().getRouteStatus("start").isStarted(), "route should still be started");
// send some more messages through the route
for (int i = 5; i < 10; i++) {
@@ -71,7 +71,7 @@ public class StopRouteAbortAfterTimeoutTest extends ContextTestSupport {
// the route should have been forced stopped
assertTrue(stopRouteResponse, "stopRoute response should be True");
- assertEquals(true, context.getRouteController().getRouteStatus("start").isStopped(), "route should be stopped");
+ assertTrue(context.getRouteController().getRouteStatus("start").isStopped(), "route should be stopped");
int before = mockEP.getExchanges().size();
diff --git a/core/camel-core/src/test/java/org/apache/camel/impl/VetoCamelContextStartTest.java b/core/camel-core/src/test/java/org/apache/camel/impl/VetoCamelContextStartTest.java
index ba74bb5d542..e073e9a7b3f 100644
--- a/core/camel-core/src/test/java/org/apache/camel/impl/VetoCamelContextStartTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/impl/VetoCamelContextStartTest.java
@@ -25,6 +25,8 @@ import org.apache.camel.support.LifecycleStrategySupport;
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.assertTrue;
/**
*
@@ -36,8 +38,8 @@ public class VetoCamelContextStartTest extends ContextTestSupport {
@Test
public void testVetoCamelContextStart() throws Exception {
// context is veto'ed but appears as started
- assertEquals(false, context.getStatus().isStarted());
- assertEquals(true, context.getStatus().isStopped());
+ assertFalse(context.getStatus().isStarted());
+ assertTrue(context.getStatus().isStopped());
assertEquals(0, context.getRoutes().size());
}
diff --git a/core/camel-core/src/test/java/org/apache/camel/impl/engine/DefaultCamelContextTest.java b/core/camel-core/src/test/java/org/apache/camel/impl/engine/DefaultCamelContextTest.java
index a27a1e1aeaa..be379ac9817 100644
--- a/core/camel-core/src/test/java/org/apache/camel/impl/engine/DefaultCamelContextTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/impl/engine/DefaultCamelContextTest.java
@@ -315,24 +315,24 @@ public class DefaultCamelContextTest extends TestSupport {
DefaultCamelContext ctx = new DefaultCamelContext(false);
ctx.disableJMX();
- assertEquals(false, ctx.isStarted());
- assertEquals(false, ctx.isSuspended());
+ assertFalse(ctx.isStarted());
+ assertFalse(ctx.isSuspended());
ctx.start();
- assertEquals(true, ctx.isStarted());
- assertEquals(false, ctx.isSuspended());
+ assertTrue(ctx.isStarted());
+ assertFalse(ctx.isSuspended());
ctx.suspend();
- assertEquals(false, ctx.isStarted());
- assertEquals(true, ctx.isSuspended());
+ assertFalse(ctx.isStarted());
+ assertTrue(ctx.isSuspended());
ctx.suspend();
- assertEquals(false, ctx.isStarted());
- assertEquals(true, ctx.isSuspended());
+ assertFalse(ctx.isStarted());
+ assertTrue(ctx.isSuspended());
ctx.stop();
- assertEquals(false, ctx.isStarted());
- assertEquals(false, ctx.isSuspended());
+ assertFalse(ctx.isStarted());
+ assertFalse(ctx.isSuspended());
}
@Test
@@ -340,48 +340,48 @@ public class DefaultCamelContextTest extends TestSupport {
DefaultCamelContext ctx = new DefaultCamelContext(false);
ctx.disableJMX();
- assertEquals(false, ctx.isStarted());
- assertEquals(false, ctx.isSuspended());
+ assertFalse(ctx.isStarted());
+ assertFalse(ctx.isSuspended());
ctx.start();
- assertEquals(true, ctx.isStarted());
- assertEquals(false, ctx.isSuspended());
+ assertTrue(ctx.isStarted());
+ assertFalse(ctx.isSuspended());
ctx.resume();
- assertEquals(true, ctx.isStarted());
- assertEquals(false, ctx.isSuspended());
+ assertTrue(ctx.isStarted());
+ assertFalse(ctx.isSuspended());
ctx.resume();
- assertEquals(true, ctx.isStarted());
- assertEquals(false, ctx.isSuspended());
+ assertTrue(ctx.isStarted());
+ assertFalse(ctx.isSuspended());
ctx.stop();
- assertEquals(false, ctx.isStarted());
- assertEquals(false, ctx.isSuspended());
+ assertFalse(ctx.isStarted());
+ assertFalse(ctx.isSuspended());
}
@Test
public void testSuspendResume() throws Exception {
DefaultCamelContext ctx = new DefaultCamelContext();
- assertEquals(false, ctx.isStarted());
- assertEquals(false, ctx.isSuspended());
+ assertFalse(ctx.isStarted());
+ assertFalse(ctx.isSuspended());
ctx.start();
- assertEquals(true, ctx.isStarted());
- assertEquals(false, ctx.isSuspended());
+ assertTrue(ctx.isStarted());
+ assertFalse(ctx.isSuspended());
ctx.suspend();
- assertEquals(false, ctx.isStarted());
- assertEquals(true, ctx.isSuspended());
+ assertFalse(ctx.isStarted());
+ assertTrue(ctx.isSuspended());
ctx.resume();
- assertEquals(true, ctx.isStarted());
- assertEquals(false, ctx.isSuspended());
+ assertTrue(ctx.isStarted());
+ assertFalse(ctx.isSuspended());
ctx.stop();
- assertEquals(false, ctx.isStarted());
- assertEquals(false, ctx.isSuspended());
+ assertFalse(ctx.isStarted());
+ assertFalse(ctx.isSuspended());
}
@Test
diff --git a/core/camel-core/src/test/java/org/apache/camel/impl/event/EventNotifierFailureHandledEventsTest.java b/core/camel-core/src/test/java/org/apache/camel/impl/event/EventNotifierFailureHandledEventsTest.java
index b5a58700d45..4daa4956d97 100644
--- a/core/camel-core/src/test/java/org/apache/camel/impl/event/EventNotifierFailureHandledEventsTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/impl/event/EventNotifierFailureHandledEventsTest.java
@@ -95,14 +95,14 @@ public class EventNotifierFailureHandledEventsTest extends ContextTestSupport {
assertIsInstanceOf(ExchangeCreatedEvent.class, events.get(10));
ExchangeFailureHandlingEvent e0 = assertIsInstanceOf(ExchangeFailureHandlingEvent.class, events.get(11));
- assertEquals(true, e0.isDeadLetterChannel(), "should be DLC");
+ assertTrue(e0.isDeadLetterChannel(), "should be DLC");
assertEquals("mock:dead", e0.getDeadLetterUri());
assertIsInstanceOf(ExchangeSendingEvent.class, events.get(12));
assertIsInstanceOf(ExchangeSentEvent.class, events.get(13));
ExchangeFailureHandledEvent e = assertIsInstanceOf(ExchangeFailureHandledEvent.class, events.get(14));
- assertEquals(true, e.isDeadLetterChannel(), "should be DLC");
+ assertTrue(e.isDeadLetterChannel(), "should be DLC");
assertTrue(e.isHandled(), "should be marked as failure handled");
assertFalse(e.isContinued(), "should not be continued");
Processor fh = e.getFailureHandler();
@@ -151,13 +151,13 @@ public class EventNotifierFailureHandledEventsTest extends ContextTestSupport {
assertIsInstanceOf(ExchangeCreatedEvent.class, events.get(10));
ExchangeFailureHandlingEvent e0 = assertIsInstanceOf(ExchangeFailureHandlingEvent.class, events.get(11));
- assertEquals(false, e0.isDeadLetterChannel(), "should NOT be DLC");
+ assertFalse(e0.isDeadLetterChannel(), "should NOT be DLC");
assertIsInstanceOf(ExchangeSendingEvent.class, events.get(12));
assertIsInstanceOf(ExchangeSentEvent.class, events.get(13));
ExchangeFailureHandledEvent e = assertIsInstanceOf(ExchangeFailureHandledEvent.class, events.get(14));
- assertEquals(false, e.isDeadLetterChannel(), "should NOT be DLC");
+ assertFalse(e.isDeadLetterChannel(), "should NOT be DLC");
assertTrue(e.isHandled(), "should be marked as failure handled");
assertFalse(e.isContinued(), "should not be continued");
@@ -198,13 +198,13 @@ public class EventNotifierFailureHandledEventsTest extends ContextTestSupport {
assertIsInstanceOf(ExchangeCreatedEvent.class, events.get(10));
ExchangeFailureHandlingEvent e0 = assertIsInstanceOf(ExchangeFailureHandlingEvent.class, events.get(11));
- assertEquals(false, e0.isDeadLetterChannel(), "should NOT be DLC");
+ assertFalse(e0.isDeadLetterChannel(), "should NOT be DLC");
assertIsInstanceOf(ExchangeSendingEvent.class, events.get(12));
assertIsInstanceOf(ExchangeSentEvent.class, events.get(13));
ExchangeFailureHandledEvent e = assertIsInstanceOf(ExchangeFailureHandledEvent.class, events.get(14));
- assertEquals(false, e.isDeadLetterChannel(), "should NOT be DLC");
+ assertFalse(e.isDeadLetterChannel(), "should NOT be DLC");
assertFalse(e.isHandled(), "should not be marked as failure handled as it was continued instead");
assertTrue(e.isContinued(), "should be continued");
diff --git a/core/camel-core/src/test/java/org/apache/camel/issues/ChangeHeaderCaseIssueTest.java b/core/camel-core/src/test/java/org/apache/camel/issues/ChangeHeaderCaseIssueTest.java
index a49b4dc4f01..8b622a8e31c 100644
--- a/core/camel-core/src/test/java/org/apache/camel/issues/ChangeHeaderCaseIssueTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/issues/ChangeHeaderCaseIssueTest.java
@@ -27,6 +27,7 @@ import org.apache.camel.component.mock.MockEndpoint;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
public class ChangeHeaderCaseIssueTest extends ContextTestSupport {
@@ -43,7 +44,7 @@ public class ChangeHeaderCaseIssueTest extends ContextTestSupport {
// only the changed case header should exist
Map<String, Object> headers = new HashMap<>(mock.getReceivedExchanges().get(0).getIn().getHeaders());
assertEquals("cool", headers.get("SoapAction"));
- assertEquals(null, headers.get("SOAPAction"));
+ assertNull(headers.get("SOAPAction"));
}
@Override
diff --git a/core/camel-core/src/test/java/org/apache/camel/issues/ProxyReturnNullIssueTest.java b/core/camel-core/src/test/java/org/apache/camel/issues/ProxyReturnNullIssueTest.java
index 0b55d9c51ca..bb3677694cc 100644
--- a/core/camel-core/src/test/java/org/apache/camel/issues/ProxyReturnNullIssueTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/issues/ProxyReturnNullIssueTest.java
@@ -22,6 +22,7 @@ import org.apache.camel.component.bean.ProxyHelper;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
public class ProxyReturnNullIssueTest extends ContextTestSupport {
@@ -34,7 +35,7 @@ public class ProxyReturnNullIssueTest extends ContextTestSupport {
@Test
public void testEchoNull() throws Exception {
Echo service = ProxyHelper.createProxy(context.getEndpoint("direct:echo"), Echo.class);
- assertEquals(null, service.echo(null));
+ assertNull(service.echo(null));
}
@Override
diff --git a/core/camel-core/src/test/java/org/apache/camel/language/TokenizerTest.java b/core/camel-core/src/test/java/org/apache/camel/language/TokenizerTest.java
index 1c3208835ee..037f9aaf14a 100644
--- a/core/camel-core/src/test/java/org/apache/camel/language/TokenizerTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/language/TokenizerTest.java
@@ -26,7 +26,9 @@ import org.apache.camel.model.language.TokenizerExpression;
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.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
public class TokenizerTest extends ExchangeTestSupport {
@@ -123,8 +125,8 @@ public class TokenizerTest extends ExchangeTestSupport {
assertEquals("names", lan.getHeaderName());
assertEquals(",", lan.getToken());
- assertEquals(false, lan.isRegex());
- assertEquals(true, lan.isSingleton());
+ assertFalse(lan.isRegex());
+ assertTrue(lan.isSingleton());
}
@Test
diff --git a/core/camel-core/src/test/java/org/apache/camel/language/simple/SimpleTest.java b/core/camel-core/src/test/java/org/apache/camel/language/simple/SimpleTest.java
index 7466326bf11..40739fe581b 100644
--- a/core/camel-core/src/test/java/org/apache/camel/language/simple/SimpleTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/language/simple/SimpleTest.java
@@ -95,9 +95,8 @@ public class SimpleTest extends LanguageTestSupport {
assertEquals("123",
context.resolveLanguage("simple").createExpression("${header.bar}").evaluate(exchange, String.class));
// should not be possible
- assertEquals(null, context.resolveLanguage("simple").createExpression("${header.bar}").evaluate(exchange, Date.class));
- assertEquals(null,
- context.resolveLanguage("simple").createExpression("${header.unknown}").evaluate(exchange, String.class));
+ assertNull(context.resolveLanguage("simple").createExpression("${header.bar}").evaluate(exchange, Date.class));
+ assertNull(context.resolveLanguage("simple").createExpression("${header.unknown}").evaluate(exchange, String.class));
}
@Test
diff --git a/core/camel-core/src/test/java/org/apache/camel/processor/DataFormatServiceTest.java b/core/camel-core/src/test/java/org/apache/camel/processor/DataFormatServiceTest.java
index 86989eb6d6d..70f2e9c42a8 100644
--- a/core/camel-core/src/test/java/org/apache/camel/processor/DataFormatServiceTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/processor/DataFormatServiceTest.java
@@ -28,8 +28,8 @@ import org.apache.camel.spi.DataFormat;
import org.apache.camel.support.service.ServiceSupport;
import org.junit.jupiter.api.Test;
-import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertSame;
+import static org.junit.jupiter.api.Assertions.assertTrue;
/**
* Test that data format receives callback if its a service / CamelContextAware
@@ -40,7 +40,7 @@ public class DataFormatServiceTest extends ContextTestSupport {
@Test
public void testMarshal() throws Exception {
- assertEquals(true, my.isStarted());
+ assertTrue(my.isStarted());
assertSame(context, my.getCamelContext());
getMockEndpoint("mock:a").expectedBodiesReceived("Hi Camel");
@@ -51,13 +51,13 @@ public class DataFormatServiceTest extends ContextTestSupport {
context.stop();
- assertEquals(true, my.isStopped());
+ assertTrue(my.isStopped());
assertSame(context, my.getCamelContext());
}
@Test
public void testUnmarshal() throws Exception {
- assertEquals(true, my.isStarted());
+ assertTrue(my.isStarted());
assertSame(context, my.getCamelContext());
getMockEndpoint("mock:b").expectedBodiesReceived("Bye World");
@@ -68,7 +68,7 @@ public class DataFormatServiceTest extends ContextTestSupport {
context.stop();
- assertEquals(true, my.isStopped());
+ assertTrue(my.isStopped());
assertSame(context, my.getCamelContext());
}
diff --git a/core/camel-core/src/test/java/org/apache/camel/processor/LogEipListenerTest.java b/core/camel-core/src/test/java/org/apache/camel/processor/LogEipListenerTest.java
index 160389261b2..cfb1f2e0f52 100644
--- a/core/camel-core/src/test/java/org/apache/camel/processor/LogEipListenerTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/processor/LogEipListenerTest.java
@@ -26,6 +26,7 @@ import org.apache.camel.support.DefaultRegistry;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
public class LogEipListenerTest {
private static boolean listenerFired;
@@ -44,7 +45,7 @@ public class LogEipListenerTest {
context.start();
context.createProducerTemplate().sendBody("direct:foo", "hello");
mock.assertIsSatisfied();
- assertEquals(true, listenerFired);
+ assertTrue(listenerFired);
context.stop();
}
diff --git a/core/camel-core/src/test/java/org/apache/camel/processor/MulticastParallelFailureEndpointTest.java b/core/camel-core/src/test/java/org/apache/camel/processor/MulticastParallelFailureEndpointTest.java
index bad928f0799..7329599b911 100644
--- a/core/camel-core/src/test/java/org/apache/camel/processor/MulticastParallelFailureEndpointTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/processor/MulticastParallelFailureEndpointTest.java
@@ -26,6 +26,7 @@ import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
public class MulticastParallelFailureEndpointTest extends ContextTestSupport {
@@ -45,7 +46,7 @@ public class MulticastParallelFailureEndpointTest extends ContextTestSupport {
// try..catch block should clear handled exceptions
assertNotNull(result);
- assertEquals(null, result.getProperty(Exchange.FAILURE_ENDPOINT));
+ assertNull(result.getProperty(Exchange.FAILURE_ENDPOINT));
}
public Exchange runTest(String uri) throws Exception {
diff --git a/core/camel-core/src/test/java/org/apache/camel/processor/RollbackDefaultErrorHandlerTest.java b/core/camel-core/src/test/java/org/apache/camel/processor/RollbackDefaultErrorHandlerTest.java
index 7f39af98ee6..de02e9082aa 100644
--- a/core/camel-core/src/test/java/org/apache/camel/processor/RollbackDefaultErrorHandlerTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/processor/RollbackDefaultErrorHandlerTest.java
@@ -59,7 +59,7 @@ public class RollbackDefaultErrorHandlerTest extends ContextTestSupport {
});
assertNotNull(out.getException());
assertIsInstanceOf(RollbackExchangeException.class, out.getException());
- assertEquals(true, out.isRollbackOnly(), "Should be marked as rollback");
+ assertTrue(out.isRollbackOnly(), "Should be marked as rollback");
}
@Override
diff --git a/core/camel-core/src/test/java/org/apache/camel/processor/RollbackDoTryCatchTest.java b/core/camel-core/src/test/java/org/apache/camel/processor/RollbackDoTryCatchTest.java
index cff2d477253..895e4db1643 100644
--- a/core/camel-core/src/test/java/org/apache/camel/processor/RollbackDoTryCatchTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/processor/RollbackDoTryCatchTest.java
@@ -24,7 +24,6 @@ import org.apache.camel.RuntimeCamelException;
import org.apache.camel.builder.RouteBuilder;
import org.junit.jupiter.api.Test;
-import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
@@ -74,7 +73,7 @@ public class RollbackDoTryCatchTest extends ContextTestSupport {
assertNotNull(out.getException());
assertIsInstanceOf(RollbackExchangeException.class, out.getException());
- assertEquals(true, out.isRollbackOnly(), "Should be marked as rollback");
+ assertTrue(out.isRollbackOnly(), "Should be marked as rollback");
}
@Override
diff --git a/core/camel-core/src/test/java/org/apache/camel/processor/RollbackTest.java b/core/camel-core/src/test/java/org/apache/camel/processor/RollbackTest.java
index b2e91f323a3..e8d480ecb12 100644
--- a/core/camel-core/src/test/java/org/apache/camel/processor/RollbackTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/processor/RollbackTest.java
@@ -68,7 +68,7 @@ public class RollbackTest extends ContextTestSupport {
assertNotNull(out.getException());
assertIsInstanceOf(RollbackExchangeException.class, out.getException());
- assertEquals(true, out.isRollbackOnly(), "Should be marked as rollback");
+ assertTrue(out.isRollbackOnly(), "Should be marked as rollback");
}
@Override
diff --git a/core/camel-core/src/test/java/org/apache/camel/processor/RouteMEPOptionalOutTest.java b/core/camel-core/src/test/java/org/apache/camel/processor/RouteMEPOptionalOutTest.java
index 0fa44d8e14e..f3e663e0c19 100644
--- a/core/camel-core/src/test/java/org/apache/camel/processor/RouteMEPOptionalOutTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/processor/RouteMEPOptionalOutTest.java
@@ -24,6 +24,7 @@ import org.apache.camel.builder.RouteBuilder;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
/**
* Unit test for in optional out
@@ -40,26 +41,26 @@ public class RouteMEPOptionalOutTest extends ContextTestSupport {
public void testHasNotOutForInOptionalOut() {
// OUT is optional in the route but we should not get a response
Object out = template.sendBody("direct:noout", ExchangePattern.InOptionalOut, "Hi");
- assertEquals(null, out);
+ assertNull(out);
}
@Test
public void testHasNotOutForInOut() {
// OUT is optional in the route but we should still not get a response
Object out = template.sendBody("direct:noout", ExchangePattern.InOut, "Hi");
- assertEquals(null, out);
+ assertNull(out);
}
@Test
public void testHasNotOutForInOnly() {
Object out = template.sendBody("direct:noout", ExchangePattern.InOnly, "Hi");
- assertEquals(null, out);
+ assertNull(out);
}
@Test
public void testInOnly() {
Object out = template.sendBody("direct:inonly", ExchangePattern.InOnly, "Hi");
- assertEquals(null, out);
+ assertNull(out);
}
@Override
diff --git a/core/camel-core/src/test/java/org/apache/camel/processor/RouteStartupOrderSuspendResumeNoAutoStartupTest.java b/core/camel-core/src/test/java/org/apache/camel/processor/RouteStartupOrderSuspendResumeNoAutoStartupTest.java
index ec0cf8eabcf..6c26dfb7d24 100644
--- a/core/camel-core/src/test/java/org/apache/camel/processor/RouteStartupOrderSuspendResumeNoAutoStartupTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/processor/RouteStartupOrderSuspendResumeNoAutoStartupTest.java
@@ -26,6 +26,7 @@ import org.apache.camel.spi.RouteStartupOrder;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
public class RouteStartupOrderSuspendResumeNoAutoStartupTest extends ContextTestSupport {
@@ -42,7 +43,7 @@ public class RouteStartupOrderSuspendResumeNoAutoStartupTest extends ContextTest
context.resume();
// route C should still be stopped after we have resumed
- assertEquals(true, context.getRouteController().getRouteStatus("C").isStopped());
+ assertTrue(context.getRouteController().getRouteStatus("C").isStopped());
// assert correct order
DefaultCamelContext dcc = (DefaultCamelContext) context;
@@ -70,7 +71,7 @@ public class RouteStartupOrderSuspendResumeNoAutoStartupTest extends ContextTest
context.resume();
// route C should be started
- assertEquals(true, context.getRouteController().getRouteStatus("C").isStarted());
+ assertTrue(context.getRouteController().getRouteStatus("C").isStarted());
// assert correct order
DefaultCamelContext dcc = (DefaultCamelContext) context;
diff --git a/core/camel-core/src/test/java/org/apache/camel/processor/ThrowExceptionNullMessageTest.java b/core/camel-core/src/test/java/org/apache/camel/processor/ThrowExceptionNullMessageTest.java
index 3cff6b398e6..f96c3d40448 100644
--- a/core/camel-core/src/test/java/org/apache/camel/processor/ThrowExceptionNullMessageTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/processor/ThrowExceptionNullMessageTest.java
@@ -21,7 +21,7 @@ import org.apache.camel.ContextTestSupport;
import org.apache.camel.builder.RouteBuilder;
import org.junit.jupiter.api.Test;
-import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.fail;
public class ThrowExceptionNullMessageTest extends ContextTestSupport {
@@ -36,7 +36,7 @@ public class ThrowExceptionNullMessageTest extends ContextTestSupport {
fail("Should have thrown an exception");
} catch (CamelExecutionException e) {
assertIsInstanceOf(IllegalArgumentException.class, e.getCause());
- assertEquals(null, e.getCause().getMessage());
+ assertNull(e.getCause().getMessage());
}
assertMockEndpointsSatisfied();
diff --git a/core/camel-core/src/test/java/org/apache/camel/processor/TryProcessorHandleWrappedExceptionTest.java b/core/camel-core/src/test/java/org/apache/camel/processor/TryProcessorHandleWrappedExceptionTest.java
index 0627f2368d5..91f9b408539 100644
--- a/core/camel-core/src/test/java/org/apache/camel/processor/TryProcessorHandleWrappedExceptionTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/processor/TryProcessorHandleWrappedExceptionTest.java
@@ -68,7 +68,7 @@ public class TryProcessorHandleWrappedExceptionTest extends ContextTestSupport {
public void process(Exchange exchange) throws Exception {
handled = true;
- assertEquals(false, exchange.isFailed(), "Should not be marked as failed");
+ assertFalse(exchange.isFailed(), "Should not be marked as failed");
Exception e = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT);
assertNotNull(e, "There should be an exception");
diff --git a/core/camel-core/src/test/java/org/apache/camel/processor/TryProcessorTest.java b/core/camel-core/src/test/java/org/apache/camel/processor/TryProcessorTest.java
index 711e7ccdc0b..1604104ea99 100644
--- a/core/camel-core/src/test/java/org/apache/camel/processor/TryProcessorTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/processor/TryProcessorTest.java
@@ -112,7 +112,7 @@ public class TryProcessorTest extends ContextTestSupport {
public void process(Exchange exchange) throws Exception {
handled = true;
- assertEquals(false, exchange.isFailed(), "Should not be marked as failed");
+ assertFalse(exchange.isFailed(), "Should not be marked as failed");
Exception e = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT);
assertNotNull(e, "There should be an exception");
diff --git a/core/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateProcessorTest.java b/core/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateProcessorTest.java
index 87ea97505d4..7533d4017d9 100644
--- a/core/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateProcessorTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateProcessorTest.java
@@ -511,7 +511,7 @@ public class AggregateProcessorTest extends ContextTestSupport {
};
doTestAggregateLogFailedExchange(myHandler);
- assertEquals(true, tested.get());
+ assertTrue(tested.get());
}
private void doTestAggregateLogFailedExchange(ExceptionHandler handler) throws Exception {
diff --git a/core/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateShutdownThreadPoolTest.java b/core/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateShutdownThreadPoolTest.java
index d53209ac3a7..15a0b82f692 100644
--- a/core/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateShutdownThreadPoolTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateShutdownThreadPoolTest.java
@@ -23,7 +23,8 @@ import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.processor.BodyInAggregatingStrategy;
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.assertTrue;
public class AggregateShutdownThreadPoolTest extends ContextTestSupport {
@@ -58,7 +59,7 @@ public class AggregateShutdownThreadPoolTest extends ContextTestSupport {
@Test
public void testAggregateShutdownCustomThreadPoolTest() throws Exception {
- assertEquals(false, myPool.isShutdown());
+ assertFalse(myPool.isShutdown());
getMockEndpoint("mock:aggregated").expectedBodiesReceived("A+B+C");
@@ -67,15 +68,15 @@ public class AggregateShutdownThreadPoolTest extends ContextTestSupport {
template.sendBodyAndHeader("direct:bar", "C", "id", 123);
assertMockEndpointsSatisfied();
- assertEquals(false, myPool.isShutdown());
+ assertFalse(myPool.isShutdown());
context.getRouteController().stopRoute("bar");
- assertEquals(false, myPool.isShutdown());
+ assertFalse(myPool.isShutdown());
resetMocks();
context.getRouteController().startRoute("bar");
- assertEquals(false, myPool.isShutdown());
+ assertFalse(myPool.isShutdown());
getMockEndpoint("mock:aggregated").expectedBodiesReceived("D+E+F");
@@ -84,11 +85,11 @@ public class AggregateShutdownThreadPoolTest extends ContextTestSupport {
template.sendBodyAndHeader("direct:bar", "F", "id", 123);
assertMockEndpointsSatisfied();
- assertEquals(false, myPool.isShutdown());
+ assertFalse(myPool.isShutdown());
context.stop();
// now it should be shutdown when CamelContext is stopped/shutdown
- assertEquals(true, myPool.isShutdown());
+ assertTrue(myPool.isShutdown());
}
@Override
diff --git a/core/camel-core/src/test/java/org/apache/camel/processor/interceptor/AuditInterceptorAsyncDelegateIssueTest.java b/core/camel-core/src/test/java/org/apache/camel/processor/interceptor/AuditInterceptorAsyncDelegateIssueTest.java
index c7963565159..036c4949197 100644
--- a/core/camel-core/src/test/java/org/apache/camel/processor/interceptor/AuditInterceptorAsyncDelegateIssueTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/processor/interceptor/AuditInterceptorAsyncDelegateIssueTest.java
@@ -29,7 +29,7 @@ import org.apache.camel.support.processor.DelegateAsyncProcessor;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
-import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
public class AuditInterceptorAsyncDelegateIssueTest extends ContextTestSupport {
@@ -53,7 +53,7 @@ public class AuditInterceptorAsyncDelegateIssueTest extends ContextTestSupport {
assertMockEndpointsSatisfied();
- assertEquals(true, strategy.isInvoked());
+ assertTrue(strategy.isInvoked());
}
@Test
@@ -67,7 +67,7 @@ public class AuditInterceptorAsyncDelegateIssueTest extends ContextTestSupport {
assertMockEndpointsSatisfied();
- assertEquals(true, strategy.isInvoked());
+ assertTrue(strategy.isInvoked());
}
@Override
diff --git a/core/camel-core/src/test/java/org/apache/camel/processor/interceptor/AuditInterceptorDelegateIssueTest.java b/core/camel-core/src/test/java/org/apache/camel/processor/interceptor/AuditInterceptorDelegateIssueTest.java
index 7e363bb83d1..43bde20ef69 100644
--- a/core/camel-core/src/test/java/org/apache/camel/processor/interceptor/AuditInterceptorDelegateIssueTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/processor/interceptor/AuditInterceptorDelegateIssueTest.java
@@ -28,7 +28,7 @@ import org.apache.camel.support.processor.DelegateProcessor;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
-import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
public class AuditInterceptorDelegateIssueTest extends ContextTestSupport {
@@ -52,7 +52,7 @@ public class AuditInterceptorDelegateIssueTest extends ContextTestSupport {
assertMockEndpointsSatisfied();
- assertEquals(true, strategy.isInvoked());
+ assertTrue(strategy.isInvoked());
}
@Test
@@ -66,7 +66,7 @@ public class AuditInterceptorDelegateIssueTest extends ContextTestSupport {
assertMockEndpointsSatisfied();
- assertEquals(true, strategy.isInvoked());
+ assertTrue(strategy.isInvoked());
}
@Override
diff --git a/core/camel-core/src/test/java/org/apache/camel/processor/resequencer/SequenceTest.java b/core/camel-core/src/test/java/org/apache/camel/processor/resequencer/SequenceTest.java
index 485841969cd..bed81089a47 100644
--- a/core/camel-core/src/test/java/org/apache/camel/processor/resequencer/SequenceTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/processor/resequencer/SequenceTest.java
@@ -21,6 +21,7 @@ import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
public class SequenceTest {
@@ -48,15 +49,15 @@ public class SequenceTest {
@Test
public void testPredecessor() {
assertEquals(e1, set.predecessor(e2));
- assertEquals(null, set.predecessor(e1));
- assertEquals(null, set.predecessor(e3));
+ assertNull(set.predecessor(e1));
+ assertNull(set.predecessor(e3));
}
@Test
public void testSuccessor() {
assertEquals(e2, set.successor(e1));
- assertEquals(null, set.successor(e2));
- assertEquals(null, set.successor(e3));
+ assertNull(set.successor(e2));
+ assertNull(set.successor(e3));
}
}
diff --git a/core/camel-core/src/test/java/org/apache/camel/processor/validation/DefaultValidationErrorHandlerTest.java b/core/camel-core/src/test/java/org/apache/camel/processor/validation/DefaultValidationErrorHandlerTest.java
index a0678c114cf..01813dae3c3 100644
--- a/core/camel-core/src/test/java/org/apache/camel/processor/validation/DefaultValidationErrorHandlerTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/processor/validation/DefaultValidationErrorHandlerTest.java
@@ -42,7 +42,7 @@ public class DefaultValidationErrorHandlerTest extends ContextTestSupport {
eh.warning(new SAXParseException("foo", createLocator(1, 2)));
// just a warning so should be valid
- assertEquals(true, eh.isValid());
+ assertTrue(eh.isValid());
}
@Test
@@ -51,7 +51,7 @@ public class DefaultValidationErrorHandlerTest extends ContextTestSupport {
eh.error(new SAXParseException("foo", createLocator(3, 5)));
- assertEquals(false, eh.isValid());
+ assertFalse(eh.isValid());
}
@Test
@@ -60,7 +60,7 @@ public class DefaultValidationErrorHandlerTest extends ContextTestSupport {
eh.fatalError(new SAXParseException("foo", createLocator(5, 8)));
- assertEquals(false, eh.isValid());
+ assertFalse(eh.isValid());
}
@Test
@@ -69,11 +69,11 @@ public class DefaultValidationErrorHandlerTest extends ContextTestSupport {
eh.fatalError(new SAXParseException("foo", createLocator(5, 8)));
- assertEquals(false, eh.isValid());
+ assertFalse(eh.isValid());
eh.reset();
- assertEquals(true, eh.isValid());
+ assertTrue(eh.isValid());
}
@Test
@@ -84,7 +84,7 @@ public class DefaultValidationErrorHandlerTest extends ContextTestSupport {
eh.error(new SAXParseException("bar", createLocator(9, 12)));
eh.fatalError(new SAXParseException("cheese", createLocator(13, 17)));
- assertEquals(false, eh.isValid());
+ assertFalse(eh.isValid());
Exchange exchange = new DefaultExchange(context);
try {
@@ -115,7 +115,7 @@ public class DefaultValidationErrorHandlerTest extends ContextTestSupport {
eh.error(new SAXParseException("foo", createLocator(3, 5)));
eh.error(new SAXParseException("bar", createLocator(9, 12)));
- assertEquals(false, eh.isValid());
+ assertFalse(eh.isValid());
Exchange exchange = new DefaultExchange(context);
try {
diff --git a/core/camel-core/src/test/java/org/apache/camel/support/DefaultTimeoutMapTest.java b/core/camel-core/src/test/java/org/apache/camel/support/DefaultTimeoutMapTest.java
index 60001073306..682bbf96103 100644
--- a/core/camel-core/src/test/java/org/apache/camel/support/DefaultTimeoutMapTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/support/DefaultTimeoutMapTest.java
@@ -99,7 +99,7 @@ public class DefaultTimeoutMapTest {
Object old = map.remove("A");
assertEquals(123, old);
- assertEquals(null, (Object) map.get("A"));
+ assertNull((Object) map.get("A"));
assertEquals(0, map.size());
map.stop();
diff --git a/core/camel-core/src/test/java/org/apache/camel/support/IntrospectionSupportTest.java b/core/camel-core/src/test/java/org/apache/camel/support/IntrospectionSupportTest.java
index 075762ae0b3..3c80c0e1136 100644
--- a/core/camel-core/src/test/java/org/apache/camel/support/IntrospectionSupportTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/support/IntrospectionSupportTest.java
@@ -294,7 +294,7 @@ public class IntrospectionSupportTest extends ContextTestSupport {
String price = map.get("price").toString();
assertTrue(price.startsWith("10"));
- assertEquals(null, map.get("id"));
+ assertNull(map.get("id"));
}
@Test
@@ -478,12 +478,12 @@ public class IntrospectionSupportTest extends ContextTestSupport {
ExampleBean bean = new ExampleBean();
Method name = bean.getClass().getMethod("getName", (Class<?>[]) null);
- assertEquals(true, isGetter(name));
- assertEquals(false, isSetter(name));
+ assertTrue(isGetter(name));
+ assertFalse(isSetter(name));
Method price = bean.getClass().getMethod("getPrice", (Class<?>[]) null);
- assertEquals(true, isGetter(price));
- assertEquals(false, isSetter(price));
+ assertTrue(isGetter(price));
+ assertFalse(isSetter(price));
}
@Test
@@ -491,12 +491,12 @@ public class IntrospectionSupportTest extends ContextTestSupport {
ExampleBean bean = new ExampleBean();
Method name = bean.getClass().getMethod("setName", String.class);
- assertEquals(false, isGetter(name));
- assertEquals(true, isSetter(name));
+ assertFalse(isGetter(name));
+ assertTrue(isSetter(name));
Method price = bean.getClass().getMethod("setPrice", double.class);
- assertEquals(false, isGetter(price));
- assertEquals(true, isSetter(price));
+ assertFalse(isGetter(price));
+ assertTrue(isSetter(price));
}
@Test
@@ -504,24 +504,24 @@ public class IntrospectionSupportTest extends ContextTestSupport {
OtherExampleBean bean = new OtherExampleBean();
Method customerId = bean.getClass().getMethod("getCustomerId", (Class<?>[]) null);
- assertEquals(true, isGetter(customerId));
- assertEquals(false, isSetter(customerId));
+ assertTrue(isGetter(customerId));
+ assertFalse(isSetter(customerId));
Method goldCustomer = bean.getClass().getMethod("isGoldCustomer", (Class<?>[]) null);
- assertEquals(true, isGetter(goldCustomer));
- assertEquals(false, isSetter(goldCustomer));
+ assertTrue(isGetter(goldCustomer));
+ assertFalse(isSetter(goldCustomer));
Method silverCustomer = bean.getClass().getMethod("isSilverCustomer", (Class<?>[]) null);
- assertEquals(true, isGetter(silverCustomer));
- assertEquals(false, isSetter(silverCustomer));
+ assertTrue(isGetter(silverCustomer));
+ assertFalse(isSetter(silverCustomer));
Method company = bean.getClass().getMethod("getCompany", (Class<?>[]) null);
- assertEquals(true, isGetter(company));
- assertEquals(false, isSetter(company));
+ assertTrue(isGetter(company));
+ assertFalse(isSetter(company));
Method setupSomething = bean.getClass().getMethod("setupSomething", Object.class);
- assertEquals(false, isGetter(setupSomething));
- assertEquals(false, isSetter(setupSomething));
+ assertFalse(isGetter(setupSomething));
+ assertFalse(isSetter(setupSomething));
}
@Test
@@ -529,24 +529,24 @@ public class IntrospectionSupportTest extends ContextTestSupport {
OtherExampleBean bean = new OtherExampleBean();
Method customerId = bean.getClass().getMethod("setCustomerId", int.class);
- assertEquals(false, isGetter(customerId));
- assertEquals(true, isSetter(customerId));
+ assertFalse(isGetter(customerId));
+ assertTrue(isSetter(customerId));
Method goldCustomer = bean.getClass().getMethod("setGoldCustomer", boolean.class);
- assertEquals(false, isGetter(goldCustomer));
- assertEquals(true, isSetter(goldCustomer));
+ assertFalse(isGetter(goldCustomer));
+ assertTrue(isSetter(goldCustomer));
Method silverCustomer = bean.getClass().getMethod("setSilverCustomer", Boolean.class);
- assertEquals(false, isGetter(silverCustomer));
- assertEquals(true, isSetter(silverCustomer));
+ assertFalse(isGetter(silverCustomer));
+ assertTrue(isSetter(silverCustomer));
Method company = bean.getClass().getMethod("setCompany", String.class);
- assertEquals(false, isGetter(company));
- assertEquals(true, isSetter(company));
+ assertFalse(isGetter(company));
+ assertTrue(isSetter(company));
Method setupSomething = bean.getClass().getMethod("setupSomething", Object.class);
- assertEquals(false, isGetter(setupSomething));
- assertEquals(false, isSetter(setupSomething));
+ assertFalse(isGetter(setupSomething));
+ assertFalse(isSetter(setupSomething));
}
@Test
diff --git a/core/camel-core/src/test/java/org/apache/camel/support/PropertyBindingSupportTest.java b/core/camel-core/src/test/java/org/apache/camel/support/PropertyBindingSupportTest.java
index e1e34e51472..250c1ec6095 100644
--- a/core/camel-core/src/test/java/org/apache/camel/support/PropertyBindingSupportTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/support/PropertyBindingSupportTest.java
@@ -340,7 +340,7 @@ public class PropertyBindingSupportTest extends ContextTestSupport {
assertTrue(foo.getBar().isGoldCustomer());
// a new class was created so its empty
assertEquals(0, foo.getBar().getWork().getId());
- assertEquals(null, foo.getBar().getWork().getName());
+ assertNull(foo.getBar().getWork().getName());
}
@Test
@@ -437,7 +437,7 @@ public class PropertyBindingSupportTest extends ContextTestSupport {
assertEquals("James", foo.getName());
assertEquals("Tony Tiger", foo.getAnimal().getName());
- assertEquals(true, foo.getAnimal().isDangerous());
+ assertTrue(foo.getAnimal().isDangerous());
}
@Test
@@ -450,7 +450,7 @@ public class PropertyBindingSupportTest extends ContextTestSupport {
assertEquals("James", foo.getName());
assertEquals("Acme", foo.getAnimal().getName());
- assertEquals(false, foo.getAnimal().isDangerous());
+ assertFalse(foo.getAnimal().isDangerous());
}
@Test
@@ -463,7 +463,7 @@ public class PropertyBindingSupportTest extends ContextTestSupport {
assertEquals("James", foo.getName());
assertEquals("Donald Duck", foo.getAnimal().getName());
- assertEquals(false, foo.getAnimal().isDangerous());
+ assertFalse(foo.getAnimal().isDangerous());
}
@Test
@@ -476,7 +476,7 @@ public class PropertyBindingSupportTest extends ContextTestSupport {
assertEquals("James", foo.getName());
assertEquals("Tiger", foo.getAnimal().getName());
- assertEquals(true, foo.getAnimal().isDangerous());
+ assertTrue(foo.getAnimal().isDangerous());
}
@Test
@@ -489,7 +489,7 @@ public class PropertyBindingSupportTest extends ContextTestSupport {
assertEquals("James", foo.getName());
assertEquals("Donald Duck", foo.getAnimal().getName());
- assertEquals(false, foo.getAnimal().isDangerous());
+ assertFalse(foo.getAnimal().isDangerous());
}
@Test
@@ -502,7 +502,7 @@ public class PropertyBindingSupportTest extends ContextTestSupport {
assertEquals("James", foo.getName());
assertEquals("Acme", foo.getAnimal().getName());
- assertEquals(false, foo.getAnimal().isDangerous());
+ assertFalse(foo.getAnimal().isDangerous());
}
@Test
diff --git a/core/camel-core/src/test/java/org/apache/camel/support/ServiceSupportTest.java b/core/camel-core/src/test/java/org/apache/camel/support/ServiceSupportTest.java
index 0a45fa59e0c..bacbcd1b3ee 100644
--- a/core/camel-core/src/test/java/org/apache/camel/support/ServiceSupportTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/support/ServiceSupportTest.java
@@ -40,38 +40,38 @@ public class ServiceSupportTest extends TestSupport {
MyService service = new MyService();
service.start();
- assertEquals(true, service.isStarted());
- assertEquals(false, service.isStarting());
- assertEquals(false, service.isStopped());
- assertEquals(false, service.isStopping());
+ assertTrue(service.isStarted());
+ assertFalse(service.isStarting());
+ assertFalse(service.isStopped());
+ assertFalse(service.isStopping());
service.stop();
- assertEquals(true, service.isStopped());
- assertEquals(false, service.isStopping());
- assertEquals(false, service.isStarted());
- assertEquals(false, service.isStarting());
+ assertTrue(service.isStopped());
+ assertFalse(service.isStopping());
+ assertFalse(service.isStarted());
+ assertFalse(service.isStarting());
}
@Test
public void testServiceSupportIsRunAllowed() throws Exception {
MyService service = new MyService();
- assertEquals(false, service.isRunAllowed());
+ assertFalse(service.isRunAllowed());
service.start();
- assertEquals(true, service.isRunAllowed());
+ assertTrue(service.isRunAllowed());
// we are allowed to run while suspending/suspended
service.suspend();
- assertEquals(true, service.isRunAllowed());
+ assertTrue(service.isRunAllowed());
service.resume();
- assertEquals(true, service.isRunAllowed());
+ assertTrue(service.isRunAllowed());
// but if we are stopped then we are not
service.stop();
- assertEquals(false, service.isRunAllowed());
+ assertFalse(service.isRunAllowed());
service.shutdown();
- assertEquals(false, service.isRunAllowed());
+ assertFalse(service.isRunAllowed());
}
private static class MyShutdownService extends ServiceSupport {
@@ -102,35 +102,35 @@ public class ServiceSupportTest extends TestSupport {
MyShutdownService service = new MyShutdownService();
service.start();
- assertEquals(true, service.isStarted());
- assertEquals(false, service.isStarting());
- assertEquals(false, service.isStopped());
- assertEquals(false, service.isStopping());
- assertEquals(false, service.isShutdown());
+ assertTrue(service.isStarted());
+ assertFalse(service.isStarting());
+ assertFalse(service.isStopped());
+ assertFalse(service.isStopping());
+ assertFalse(service.isShutdown());
service.shutdown();
- assertEquals(true, service.isStopped());
- assertEquals(false, service.isStopping());
- assertEquals(false, service.isStarted());
- assertEquals(false, service.isStarting());
+ assertTrue(service.isStopped());
+ assertFalse(service.isStopping());
+ assertFalse(service.isStarted());
+ assertFalse(service.isStarting());
- assertEquals(true, service.isShutdown());
+ assertTrue(service.isShutdown());
}
@Test
public void testExceptionOnStart() throws Exception {
ServiceSupportTestExOnStart service = new ServiceSupportTestExOnStart();
// forced not being stopped at start
- assertEquals(false, service.isStopped());
+ assertFalse(service.isStopped());
try {
service.start();
fail("RuntimeException expected");
} catch (RuntimeException e) {
- assertEquals(true, service.isStopped());
- assertEquals(false, service.isStopping());
- assertEquals(false, service.isStarted());
- assertEquals(false, service.isStarting());
+ assertTrue(service.isStopped());
+ assertFalse(service.isStopping());
+ assertFalse(service.isStarted());
+ assertFalse(service.isStarting());
}
}
@@ -143,17 +143,17 @@ public class ServiceSupportTest extends TestSupport {
assertFalse(service.isInit());
service.start();
- assertEquals(true, service.isStarted());
- assertEquals(false, service.isStarting());
- assertEquals(false, service.isStopped());
- assertEquals(false, service.isStopping());
+ assertTrue(service.isStarted());
+ assertFalse(service.isStarting());
+ assertFalse(service.isStopped());
+ assertFalse(service.isStopping());
service.stop();
- assertEquals(true, service.isStopped());
- assertEquals(false, service.isStopping());
- assertEquals(false, service.isStarted());
- assertEquals(false, service.isStarting());
+ assertTrue(service.isStopped());
+ assertFalse(service.isStopping());
+ assertFalse(service.isStarted());
+ assertFalse(service.isStarting());
}
public static class ServiceSupportTestExOnStart extends ServiceSupport {
diff --git a/core/camel-core/src/test/java/org/apache/camel/support/jsse/SSLContextParametersTest.java b/core/camel-core/src/test/java/org/apache/camel/support/jsse/SSLContextParametersTest.java
index cde53a9d079..206029b7ce1 100644
--- a/core/camel-core/src/test/java/org/apache/camel/support/jsse/SSLContextParametersTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/support/jsse/SSLContextParametersTest.java
@@ -142,10 +142,10 @@ public class SSLContextParametersTest extends AbstractJsseParametersTest {
engine = context.createSSLEngine();
serverSocket = (SSLServerSocket) context.getServerSocketFactory().createServerSocket();
- assertEquals(false, serverSocket.getWantClientAuth());
- assertEquals(false, serverSocket.getNeedClientAuth());
- assertEquals(false, engine.getWantClientAuth());
- assertEquals(false, engine.getNeedClientAuth());
+ assertFalse(serverSocket.getWantClientAuth());
+ assertFalse(serverSocket.getNeedClientAuth());
+ assertFalse(engine.getWantClientAuth());
+ assertFalse(engine.getNeedClientAuth());
// ClientAuthentication - WANT
scsp.setClientAuthentication(ClientAuthentication.WANT.name());
@@ -153,10 +153,10 @@ public class SSLContextParametersTest extends AbstractJsseParametersTest {
engine = context.createSSLEngine();
serverSocket = (SSLServerSocket) context.getServerSocketFactory().createServerSocket();
- assertEquals(true, serverSocket.getWantClientAuth());
- assertEquals(false, serverSocket.getNeedClientAuth());
- assertEquals(true, engine.getWantClientAuth());
- assertEquals(false, engine.getNeedClientAuth());
+ assertTrue(serverSocket.getWantClientAuth());
+ assertFalse(serverSocket.getNeedClientAuth());
+ assertTrue(engine.getWantClientAuth());
+ assertFalse(engine.getNeedClientAuth());
// ClientAuthentication - REQUIRE
scsp.setClientAuthentication(ClientAuthentication.REQUIRE.name());
@@ -164,10 +164,10 @@ public class SSLContextParametersTest extends AbstractJsseParametersTest {
engine = context.createSSLEngine();
serverSocket = (SSLServerSocket) context.getServerSocketFactory().createServerSocket();
- assertEquals(false, serverSocket.getWantClientAuth());
- assertEquals(true, serverSocket.getNeedClientAuth());
- assertEquals(false, engine.getWantClientAuth());
- assertEquals(true, engine.getNeedClientAuth());
+ assertFalse(serverSocket.getWantClientAuth());
+ assertTrue(serverSocket.getNeedClientAuth());
+ assertFalse(engine.getWantClientAuth());
+ assertTrue(engine.getNeedClientAuth());
}
@Test
@@ -192,10 +192,10 @@ public class SSLContextParametersTest extends AbstractJsseParametersTest {
assertStartsWith(socket.getEnabledProtocols(), "TLS");
assertStartsWith(serverSocket.getEnabledProtocols(), "TLS");
- assertTrue(Arrays.equals(controlEngine.getEnabledCipherSuites(), engine.getEnabledCipherSuites()));
- assertTrue(Arrays.equals(controlSocket.getEnabledCipherSuites(), socket.getEnabledCipherSuites()));
- assertTrue(Arrays.equals(this.getDefaultCipherSuiteIncludes(controlServerSocket.getSupportedCipherSuites()),
- serverSocket.getEnabledCipherSuites()));
+ assertArrayEquals(controlEngine.getEnabledCipherSuites(), engine.getEnabledCipherSuites());
+ assertArrayEquals(controlSocket.getEnabledCipherSuites(), socket.getEnabledCipherSuites());
+ assertArrayEquals(this.getDefaultCipherSuiteIncludes(controlServerSocket.getSupportedCipherSuites()),
+ serverSocket.getEnabledCipherSuites());
assertEquals(controlServerSocket.getWantClientAuth(), serverSocket.getWantClientAuth());
assertEquals(controlServerSocket.getNeedClientAuth(), serverSocket.getNeedClientAuth());
@@ -219,8 +219,8 @@ public class SSLContextParametersTest extends AbstractJsseParametersTest {
socket = (SSLSocket) context.getSocketFactory().createSocket();
serverSocket = (SSLServerSocket) context.getServerSocketFactory().createServerSocket();
- assertTrue(Arrays.equals(controlEngine.getEnabledCipherSuites(), engine.getEnabledCipherSuites()));
- assertTrue(Arrays.equals(controlSocket.getEnabledCipherSuites(), socket.getEnabledCipherSuites()));
+ assertArrayEquals(controlEngine.getEnabledCipherSuites(), engine.getEnabledCipherSuites());
+ assertArrayEquals(controlSocket.getEnabledCipherSuites(), socket.getEnabledCipherSuites());
assertEquals(0, serverSocket.getEnabledCipherSuites().length);
// Cipher suites filter on server params
@@ -233,8 +233,8 @@ public class SSLContextParametersTest extends AbstractJsseParametersTest {
socket = (SSLSocket) context.getSocketFactory().createSocket();
serverSocket = (SSLServerSocket) context.getServerSocketFactory().createServerSocket();
- assertTrue(Arrays.equals(controlEngine.getEnabledCipherSuites(), engine.getEnabledCipherSuites()));
- assertTrue(Arrays.equals(controlSocket.getEnabledCipherSuites(), socket.getEnabledCipherSuites()));
+ assertArrayEquals(controlEngine.getEnabledCipherSuites(), engine.getEnabledCipherSuites());
+ assertArrayEquals(controlSocket.getEnabledCipherSuites(), socket.getEnabledCipherSuites());
assertEquals(0, serverSocket.getEnabledCipherSuites().length);
// Csp on server overrides cipher suites filter on server
@@ -246,8 +246,8 @@ public class SSLContextParametersTest extends AbstractJsseParametersTest {
socket = (SSLSocket) context.getSocketFactory().createSocket();
serverSocket = (SSLServerSocket) context.getServerSocketFactory().createServerSocket();
- assertTrue(Arrays.equals(controlEngine.getEnabledCipherSuites(), engine.getEnabledCipherSuites()));
- assertTrue(Arrays.equals(controlSocket.getEnabledCipherSuites(), socket.getEnabledCipherSuites()));
+ assertArrayEquals(controlEngine.getEnabledCipherSuites(), engine.getEnabledCipherSuites());
+ assertArrayEquals(controlSocket.getEnabledCipherSuites(), socket.getEnabledCipherSuites());
assertEquals(0, serverSocket.getEnabledCipherSuites().length);
// Sspp on server params
@@ -335,10 +335,10 @@ public class SSLContextParametersTest extends AbstractJsseParametersTest {
assertStartsWith(socket.getEnabledProtocols(), "TLS");
assertStartsWith(serverSocket.getEnabledProtocols(), "TLS");
- assertTrue(Arrays.equals(controlEngine.getEnabledCipherSuites(), engine.getEnabledCipherSuites()));
- assertTrue(Arrays.equals(controlSocket.getEnabledCipherSuites(), socket.getEnabledCipherSuites()));
- assertTrue(Arrays.equals(this.getDefaultCipherSuiteIncludes(controlServerSocket.getSupportedCipherSuites()),
- serverSocket.getEnabledCipherSuites()));
+ assertArrayEquals(controlEngine.getEnabledCipherSuites(), engine.getEnabledCipherSuites());
+ assertArrayEquals(controlSocket.getEnabledCipherSuites(), socket.getEnabledCipherSuites());
+ assertArrayEquals(this.getDefaultCipherSuiteIncludes(controlServerSocket.getSupportedCipherSuites()),
+ serverSocket.getEnabledCipherSuites());
// No csp or filter on client params passes through shared config
scp.setCipherSuites(new CipherSuitesParameters());
@@ -358,10 +358,10 @@ public class SSLContextParametersTest extends AbstractJsseParametersTest {
socket = (SSLSocket) context.getSocketFactory().createSocket();
serverSocket = (SSLServerSocket) context.getServerSocketFactory().createServerSocket();
- assertTrue(Arrays.equals(controlEngine.getEnabledCipherSuites(), engine.getEnabledCipherSuites()));
+ assertArrayEquals(controlEngine.getEnabledCipherSuites(), engine.getEnabledCipherSuites());
assertEquals(0, socket.getEnabledCipherSuites().length);
- assertTrue(Arrays.equals(this.getDefaultCipherSuiteIncludes(controlServerSocket.getSupportedCipherSuites()),
- serverSocket.getEnabledCipherSuites()));
+ assertArrayEquals(this.getDefaultCipherSuiteIncludes(controlServerSocket.getSupportedCipherSuites()),
+ serverSocket.getEnabledCipherSuites());
// Cipher suites filter on client params
FilterParameters filter = new FilterParameters();
@@ -373,10 +373,10 @@ public class SSLContextParametersTest extends AbstractJsseParametersTest {
socket = (SSLSocket) context.getSocketFactory().createSocket();
serverSocket = (SSLServerSocket) context.getServerSocketFactory().createServerSocket();
- assertTrue(Arrays.equals(controlEngine.getEnabledCipherSuites(), engine.getEnabledCipherSuites()));
+ assertArrayEquals(controlEngine.getEnabledCipherSuites(), engine.getEnabledCipherSuites());
assertEquals(0, socket.getEnabledCipherSuites().length);
- assertTrue(Arrays.equals(this.getDefaultCipherSuiteIncludes(controlServerSocket.getSupportedCipherSuites()),
- serverSocket.getEnabledCipherSuites()));
+ assertArrayEquals(this.getDefaultCipherSuiteIncludes(controlServerSocket.getSupportedCipherSuites()),
+ serverSocket.getEnabledCipherSuites());
// Csp on client overrides cipher suites filter on client
filter.getInclude().add(".*");
@@ -387,10 +387,10 @@ public class SSLContextParametersTest extends AbstractJsseParametersTest {
socket = (SSLSocket) context.getSocketFactory().createSocket();
serverSocket = (SSLServerSocket) context.getServerSocketFactory().createServerSocket();
- assertTrue(Arrays.equals(controlEngine.getEnabledCipherSuites(), engine.getEnabledCipherSuites()));
+ assertArrayEquals(controlEngine.getEnabledCipherSuites(), engine.getEnabledCipherSuites());
assertEquals(0, socket.getEnabledCipherSuites().length);
- assertTrue(Arrays.equals(this.getDefaultCipherSuiteIncludes(controlServerSocket.getSupportedCipherSuites()),
- serverSocket.getEnabledCipherSuites()));
+ assertArrayEquals(this.getDefaultCipherSuiteIncludes(controlServerSocket.getSupportedCipherSuites()),
+ serverSocket.getEnabledCipherSuites());
// Sspp on client params
SecureSocketProtocolsParameters sspp = new SecureSocketProtocolsParameters();
@@ -460,10 +460,10 @@ public class SSLContextParametersTest extends AbstractJsseParametersTest {
SSLSocket socket = (SSLSocket) context.getSocketFactory().createSocket();
SSLServerSocket serverSocket = (SSLServerSocket) context.getServerSocketFactory().createServerSocket();
- assertTrue(Arrays.equals(controlEngine.getEnabledCipherSuites(), engine.getEnabledCipherSuites()));
- assertTrue(Arrays.equals(controlSocket.getEnabledCipherSuites(), socket.getEnabledCipherSuites()));
- assertTrue(Arrays.equals(this.getDefaultCipherSuiteIncludes(controlServerSocket.getSupportedCipherSuites()),
- serverSocket.getEnabledCipherSuites()));
+ assertArrayEquals(controlEngine.getEnabledCipherSuites(), engine.getEnabledCipherSuites());
+ assertArrayEquals(controlSocket.getEnabledCipherSuites(), socket.getEnabledCipherSuites());
+ assertArrayEquals(this.getDefaultCipherSuiteIncludes(controlServerSocket.getSupportedCipherSuites()),
+ serverSocket.getEnabledCipherSuites());
// empty csp
@@ -531,10 +531,10 @@ public class SSLContextParametersTest extends AbstractJsseParametersTest {
SSLSocket socket = (SSLSocket) context.getSocketFactory().createSocket();
SSLServerSocket serverSocket = (SSLServerSocket) context.getServerSocketFactory().createServerSocket();
- assertTrue(Arrays.equals(controlEngine.getEnabledCipherSuites(), engine.getEnabledCipherSuites()));
- assertTrue(Arrays.equals(controlSocket.getEnabledCipherSuites(), socket.getEnabledCipherSuites()));
- assertTrue(Arrays.equals(this.getDefaultCipherSuiteIncludes(controlServerSocket.getSupportedCipherSuites()),
- serverSocket.getEnabledCipherSuites()));
+ assertArrayEquals(controlEngine.getEnabledCipherSuites(), engine.getEnabledCipherSuites());
+ assertArrayEquals(controlSocket.getEnabledCipherSuites(), socket.getEnabledCipherSuites());
+ assertArrayEquals(this.getDefaultCipherSuiteIncludes(controlServerSocket.getSupportedCipherSuites()),
+ serverSocket.getEnabledCipherSuites());
// empty filter
FilterParameters filter = new FilterParameters();
@@ -705,8 +705,8 @@ public class SSLContextParametersTest extends AbstractJsseParametersTest {
socket = (SSLSocket) context.getSocketFactory().createSocket();
serverSocket = (SSLServerSocket) context.getServerSocketFactory().createServerSocket();
- assertTrue(Arrays.equals(controlEngine.getEnabledProtocols(), engine.getEnabledProtocols()));
- assertTrue(Arrays.equals(controlSocket.getEnabledProtocols(), socket.getEnabledProtocols()));
+ assertArrayEquals(controlEngine.getEnabledProtocols(), engine.getEnabledProtocols());
+ assertArrayEquals(controlSocket.getEnabledProtocols(), socket.getEnabledProtocols());
checkProtocols(controlServerSocket.getEnabledProtocols(), serverSocket.getEnabledProtocols());
// explicit filter with excludes (excludes overrides)
diff --git a/core/camel-core/src/test/java/org/apache/camel/util/CaseInsensitiveMapTest.java b/core/camel-core/src/test/java/org/apache/camel/util/CaseInsensitiveMapTest.java
index a1b6f1fe786..e1d4d6b3e48 100644
--- a/core/camel-core/src/test/java/org/apache/camel/util/CaseInsensitiveMapTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/util/CaseInsensitiveMapTest.java
@@ -142,9 +142,9 @@ public class CaseInsensitiveMapTest {
map.remove("FOO");
- assertEquals(null, map.get("foo"));
- assertEquals(null, map.get("Foo"));
- assertEquals(null, map.get("FOO"));
+ assertNull(map.get("foo"));
+ assertNull(map.get("Foo"));
+ assertNull(map.get("FOO"));
assertTrue(map.isEmpty());
}
@@ -309,19 +309,19 @@ public class CaseInsensitiveMapTest {
assertEquals(1, map.size());
assertEquals("cheese", map.get("fOo"));
- assertEquals(true, map.containsKey("foo"));
- assertEquals(true, map.containsKey("FOO"));
+ assertTrue(map.containsKey("foo"));
+ assertTrue(map.containsKey("FOO"));
- assertEquals(true, map.keySet().contains("FOO"));
- assertEquals(true, map.keySet().contains("FoO"));
- assertEquals(true, map.keySet().contains("Foo"));
- assertEquals(true, map.keySet().contains("foo"));
- assertEquals(true, map.keySet().contains("fOO"));
+ assertTrue(map.keySet().contains("FOO"));
+ assertTrue(map.keySet().contains("FoO"));
+ assertTrue(map.keySet().contains("Foo"));
+ assertTrue(map.keySet().contains("foo"));
+ assertTrue(map.keySet().contains("fOO"));
map.put("FOO", "cake");
assertEquals(1, map.size());
- assertEquals(true, map.containsKey("foo"));
- assertEquals(true, map.containsKey("FOO"));
+ assertTrue(map.containsKey("foo"));
+ assertTrue(map.containsKey("FOO"));
assertEquals("cake", map.get("fOo"));
}
@@ -332,18 +332,18 @@ public class CaseInsensitiveMapTest {
map.put("foo", "cheese");
assertEquals(1, map.size());
- assertEquals(null, map.get("fOo"));
- assertEquals(true, map.containsKey("foo"));
- assertEquals(false, map.containsKey("FOO"));
+ assertNull(map.get("fOo"));
+ assertTrue(map.containsKey("foo"));
+ assertFalse(map.containsKey("FOO"));
- assertEquals(false, map.keySet().contains("FOO"));
+ assertFalse(map.keySet().contains("FOO"));
map.put("FOO", "cake");
assertEquals(2, map.size());
- assertEquals(true, map.containsKey("foo"));
- assertEquals(true, map.containsKey("FOO"));
+ assertTrue(map.containsKey("foo"));
+ assertTrue(map.containsKey("FOO"));
- assertEquals(null, map.get("fOo"));
+ assertNull(map.get("fOo"));
assertEquals("cheese", map.get("foo"));
assertEquals("cake", map.get("FOO"));
}
@@ -354,15 +354,15 @@ public class CaseInsensitiveMapTest {
map.put("Foo", "cheese");
map.put("FOO", "cake");
assertEquals(1, map.size());
- assertEquals(true, map.containsKey("foo"));
- assertEquals(true, map.containsKey("FOO"));
+ assertTrue(map.containsKey("foo"));
+ assertTrue(map.containsKey("FOO"));
Map<String, Object> other = new HashMap<>(map);
- assertEquals(false, other.containsKey("foo"));
- assertEquals(false, other.containsKey("FOO"));
+ assertFalse(other.containsKey("foo"));
+ assertFalse(other.containsKey("FOO"));
// CaseInsensitiveMap preserves the original keys, which would be the
// 1st key we put
- assertEquals(true, other.containsKey("Foo"));
+ assertTrue(other.containsKey("Foo"));
assertEquals(1, other.size());
}
@@ -390,8 +390,8 @@ public class CaseInsensitiveMapTest {
map.put("Foo", "cheese");
map.put("BAR", "cake");
assertEquals(2, map.size());
- assertEquals(true, map.containsKey("foo"));
- assertEquals(true, map.containsKey("bar"));
+ assertTrue(map.containsKey("foo"));
+ assertTrue(map.containsKey("bar"));
Map<String, Object> other = new HashMap<>();
for (Map.Entry<String, Object> entry : map.entrySet()) {
@@ -400,10 +400,10 @@ public class CaseInsensitiveMapTest {
other.put(key, value);
}
- assertEquals(false, other.containsKey("foo"));
- assertEquals(true, other.containsKey("Foo"));
- assertEquals(false, other.containsKey("bar"));
- assertEquals(true, other.containsKey("BAR"));
+ assertFalse(other.containsKey("foo"));
+ assertTrue(other.containsKey("Foo"));
+ assertFalse(other.containsKey("bar"));
+ assertTrue(other.containsKey("BAR"));
assertEquals(2, other.size());
}
@@ -413,15 +413,15 @@ public class CaseInsensitiveMapTest {
map.put("Foo", "cheese");
map.put("BAR", "cake");
assertEquals(2, map.size());
- assertEquals(true, map.containsKey("foo"));
- assertEquals(true, map.containsKey("bar"));
+ assertTrue(map.containsKey("foo"));
+ assertTrue(map.containsKey("bar"));
Map<String, Object> other = new HashMap<>(map);
- assertEquals(false, other.containsKey("foo"));
- assertEquals(true, other.containsKey("Foo"));
- assertEquals(false, other.containsKey("bar"));
- assertEquals(true, other.containsKey("BAR"));
+ assertFalse(other.containsKey("foo"));
+ assertTrue(other.containsKey("Foo"));
+ assertFalse(other.containsKey("bar"));
+ assertTrue(other.containsKey("BAR"));
assertEquals(2, other.size());
}
@@ -431,15 +431,15 @@ public class CaseInsensitiveMapTest {
map.put("Foo", "cheese");
map.put("BAR", "cake");
assertEquals(2, map.size());
- assertEquals(true, map.containsKey("foo"));
- assertEquals(true, map.containsKey("bar"));
+ assertTrue(map.containsKey("foo"));
+ assertTrue(map.containsKey("bar"));
Map<String, Object> other = new HashMap<>(map);
- assertEquals(false, other.containsKey("foo"));
- assertEquals(true, other.containsKey("Foo"));
- assertEquals(false, other.containsKey("bar"));
- assertEquals(true, other.containsKey("BAR"));
+ assertFalse(other.containsKey("foo"));
+ assertTrue(other.containsKey("Foo"));
+ assertFalse(other.containsKey("bar"));
+ assertTrue(other.containsKey("BAR"));
assertEquals(2, other.size());
}
@@ -449,8 +449,8 @@ public class CaseInsensitiveMapTest {
map.put("Foo", "cheese");
map.put("BAR", "cake");
assertEquals(2, map.size());
- assertEquals(true, map.containsKey("foo"));
- assertEquals(true, map.containsKey("bar"));
+ assertTrue(map.containsKey("foo"));
+ assertTrue(map.containsKey("bar"));
Map<String, Object> other = new HashMap<>();
@@ -460,10 +460,10 @@ public class CaseInsensitiveMapTest {
}
// the original case of the keys should be preserved
- assertEquals(false, other.containsKey("foo"));
- assertEquals(true, other.containsKey("Foo"));
- assertEquals(false, other.containsKey("bar"));
- assertEquals(true, other.containsKey("BAR"));
+ assertFalse(other.containsKey("foo"));
+ assertTrue(other.containsKey("Foo"));
+ assertFalse(other.containsKey("bar"));
+ assertTrue(other.containsKey("BAR"));
assertEquals(2, other.size());
}
@@ -498,9 +498,9 @@ public class CaseInsensitiveMapTest {
assertTrue(latch.await(10, TimeUnit.SECONDS));
assertEquals(1003, map.size());
- assertEquals(true, map.containsKey("counter0"));
- assertEquals(true, map.containsKey("counter500"));
- assertEquals(true, map.containsKey("counter999"));
+ assertTrue(map.containsKey("counter0"));
+ assertTrue(map.containsKey("counter500"));
+ assertTrue(map.containsKey("counter999"));
assertEquals(123, map.get("FOO"));
assertEquals(456, map.get("Bar"));
diff --git a/core/camel-core/src/test/java/org/apache/camel/util/EndpointHelperTest.java b/core/camel-core/src/test/java/org/apache/camel/util/EndpointHelperTest.java
index 9ba7b5dcf03..d11ba17b763 100644
--- a/core/camel-core/src/test/java/org/apache/camel/util/EndpointHelperTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/util/EndpointHelperTest.java
@@ -92,7 +92,7 @@ public class EndpointHelperTest extends ContextTestSupport {
public void testLookupEndpointRegistryId() throws Exception {
assertEquals("foo", EndpointHelper.lookupEndpointRegistryId(foo));
assertEquals("coolbar", EndpointHelper.lookupEndpointRegistryId(bar));
- assertEquals(null, EndpointHelper.lookupEndpointRegistryId(context.getEndpoint("mock:cheese")));
+ assertNull(EndpointHelper.lookupEndpointRegistryId(context.getEndpoint("mock:cheese")));
}
@Test
@@ -102,7 +102,7 @@ public class EndpointHelperTest extends ContextTestSupport {
assertEquals("foo", EndpointHelper.lookupEndpointRegistryId(foo));
assertEquals("coolbar", EndpointHelper.lookupEndpointRegistryId(bar));
- assertEquals(null, EndpointHelper.lookupEndpointRegistryId(context.getEndpoint("mock:cheese")));
+ assertNull(EndpointHelper.lookupEndpointRegistryId(context.getEndpoint("mock:cheese")));
}
@Test
diff --git a/core/camel-core/src/test/java/org/apache/camel/util/FileUtilTest.java b/core/camel-core/src/test/java/org/apache/camel/util/FileUtilTest.java
index 4a7365481dd..2077cfde05c 100644
--- a/core/camel-core/src/test/java/org/apache/camel/util/FileUtilTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/util/FileUtilTest.java
@@ -27,6 +27,7 @@ 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;
public class FileUtilTest extends TestSupport {
@@ -48,7 +49,7 @@ public class FileUtilTest extends TestSupport {
@Test
public void testStripLeadingSeparator() {
- assertEquals(null, FileUtil.stripLeadingSeparator(null));
+ assertNull(FileUtil.stripLeadingSeparator(null));
assertEquals("foo", FileUtil.stripLeadingSeparator("foo"));
assertEquals("foo/bar", FileUtil.stripLeadingSeparator("foo/bar"));
assertEquals("foo/", FileUtil.stripLeadingSeparator("foo/"));
@@ -59,18 +60,18 @@ public class FileUtilTest extends TestSupport {
@Test
public void testHasLeadingSeparator() {
- assertEquals(false, FileUtil.hasLeadingSeparator(null));
- assertEquals(false, FileUtil.hasLeadingSeparator("foo"));
- assertEquals(false, FileUtil.hasLeadingSeparator("foo/bar"));
- assertEquals(false, FileUtil.hasLeadingSeparator("foo/"));
- assertEquals(true, FileUtil.hasLeadingSeparator("/foo/bar"));
- assertEquals(true, FileUtil.hasLeadingSeparator("//foo/bar"));
- assertEquals(true, FileUtil.hasLeadingSeparator("///foo/bar"));
+ assertFalse(FileUtil.hasLeadingSeparator(null));
+ assertFalse(FileUtil.hasLeadingSeparator("foo"));
+ assertFalse(FileUtil.hasLeadingSeparator("foo/bar"));
+ assertFalse(FileUtil.hasLeadingSeparator("foo/"));
+ assertTrue(FileUtil.hasLeadingSeparator("/foo/bar"));
+ assertTrue(FileUtil.hasLeadingSeparator("//foo/bar"));
+ assertTrue(FileUtil.hasLeadingSeparator("///foo/bar"));
}
@Test
public void testStripFirstLeadingSeparator() {
- assertEquals(null, FileUtil.stripFirstLeadingSeparator(null));
+ assertNull(FileUtil.stripFirstLeadingSeparator(null));
assertEquals("foo", FileUtil.stripFirstLeadingSeparator("foo"));
assertEquals("foo/bar", FileUtil.stripFirstLeadingSeparator("foo/bar"));
assertEquals("foo/", FileUtil.stripFirstLeadingSeparator("foo/"));
@@ -81,7 +82,7 @@ public class FileUtilTest extends TestSupport {
@Test
public void testStripTrailingSeparator() {
- assertEquals(null, FileUtil.stripTrailingSeparator(null));
+ assertNull(FileUtil.stripTrailingSeparator(null));
assertEquals("foo", FileUtil.stripTrailingSeparator("foo"));
assertEquals("foo/bar", FileUtil.stripTrailingSeparator("foo/bar"));
assertEquals("foo", FileUtil.stripTrailingSeparator("foo/"));
@@ -99,7 +100,7 @@ public class FileUtilTest extends TestSupport {
@Test
public void testStripPath() {
- assertEquals(null, FileUtil.stripPath(null));
+ assertNull(FileUtil.stripPath(null));
assertEquals("", FileUtil.stripPath("/"));
assertEquals("foo.xml", FileUtil.stripPath("/foo.xml"));
assertEquals("foo", FileUtil.stripPath("foo"));
@@ -109,7 +110,7 @@ public class FileUtilTest extends TestSupport {
@Test
public void testStripPathWithMixedSeparators() {
- assertEquals(null, FileUtil.stripPath(null));
+ assertNull(FileUtil.stripPath(null));
assertEquals("", FileUtil.stripPath("/"));
assertEquals("foo.xml", FileUtil.stripPath("/foo.xml"));
assertEquals("foo", FileUtil.stripPath("foo"));
@@ -120,7 +121,7 @@ public class FileUtilTest extends TestSupport {
@Test
public void testStripExt() {
- assertEquals(null, FileUtil.stripExt(null));
+ assertNull(FileUtil.stripExt(null));
assertEquals("foo", FileUtil.stripExt("foo"));
assertEquals("foo", FileUtil.stripExt("foo.xml"));
assertEquals("/foo/bar", FileUtil.stripExt("/foo/bar.xml"));
@@ -128,8 +129,8 @@ public class FileUtilTest extends TestSupport {
@Test
public void testOnlyExt() {
- assertEquals(null, FileUtil.onlyExt(null));
- assertEquals(null, FileUtil.onlyExt("foo"));
+ assertNull(FileUtil.onlyExt(null));
+ assertNull(FileUtil.onlyExt("foo"));
assertEquals("xml", FileUtil.onlyExt("foo.xml"));
assertEquals("xml", FileUtil.onlyExt("/foo/bar.xml"));
assertEquals("tar.gz", FileUtil.onlyExt("/foo/bigfile.tar.gz"));
@@ -138,9 +139,9 @@ public class FileUtilTest extends TestSupport {
@Test
public void testOnlyPath() {
- assertEquals(null, FileUtil.onlyPath(null));
- assertEquals(null, FileUtil.onlyPath("foo"));
- assertEquals(null, FileUtil.onlyPath("foo.xml"));
+ assertNull(FileUtil.onlyPath(null));
+ assertNull(FileUtil.onlyPath("foo"));
+ assertNull(FileUtil.onlyPath("foo.xml"));
assertEquals("foo", FileUtil.onlyPath("foo/bar.xml"));
assertEquals("/foo", FileUtil.onlyPath("/foo/bar.xml"));
assertEquals("/foo/bar", FileUtil.onlyPath("/foo/bar/baz.xml"));
@@ -150,9 +151,9 @@ public class FileUtilTest extends TestSupport {
@Test
public void testOnlyPathWithMixedSeparators() {
- assertEquals(null, FileUtil.onlyPath(null));
- assertEquals(null, FileUtil.onlyPath("foo"));
- assertEquals(null, FileUtil.onlyPath("foo.xml"));
+ assertNull(FileUtil.onlyPath(null));
+ assertNull(FileUtil.onlyPath("foo"));
+ assertNull(FileUtil.onlyPath("foo.xml"));
assertEquals("foo", FileUtil.onlyPath("foo/bar.xml"));
assertEquals("/foo", FileUtil.onlyPath("/foo\\bar.xml"));
assertEquals("\\foo\\bar", FileUtil.onlyPath("\\foo\\bar/baz.xml"));
@@ -162,7 +163,7 @@ public class FileUtilTest extends TestSupport {
@Test
public void testOnlyName() {
- assertEquals(null, FileUtil.onlyName(null));
+ assertNull(FileUtil.onlyName(null));
assertEquals("foo", FileUtil.onlyName("foo"));
assertEquals("foo", FileUtil.onlyName("foo.xml"));
assertEquals("bar", FileUtil.onlyName("foo/bar.xml"));
@@ -174,7 +175,7 @@ public class FileUtilTest extends TestSupport {
@Test
public void testCompactPath() {
- assertEquals(null, FileUtil.compactPath(null));
+ assertNull(FileUtil.compactPath(null));
if (FileUtil.isWindows()) {
assertEquals("..\\foo", FileUtil.compactPath("..\\foo"));
assertEquals("..\\..\\foo", FileUtil.compactPath("..\\..\\foo"));
@@ -231,7 +232,7 @@ public class FileUtilTest extends TestSupport {
@Test
public void testCompactPathSeparator() {
- assertEquals(null, FileUtil.compactPath(null, '\''));
+ assertNull(FileUtil.compactPath(null, '\''));
assertEquals("..\\foo", FileUtil.compactPath("..\\foo", '\\'));
assertEquals("../foo", FileUtil.compactPath("../foo", '/'));
diff --git a/core/camel-core/src/test/java/org/apache/camel/util/MessageHelperTest.java b/core/camel-core/src/test/java/org/apache/camel/util/MessageHelperTest.java
index 9d371df8bff..f8cf1ea4c8f 100644
--- a/core/camel-core/src/test/java/org/apache/camel/util/MessageHelperTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/util/MessageHelperTest.java
@@ -145,7 +145,7 @@ public class MessageHelperTest {
MessageHelper.copyHeaders(source, target, headerFilterStrategy, true);
- assertEquals(null, target.getHeader("foo"));
+ assertNull(target.getHeader("foo"));
assertEquals(456, target.getHeader("bar"));
context.stop();
}
diff --git a/core/camel-core/src/test/java/org/apache/camel/util/PackageHelperTest.java b/core/camel-core/src/test/java/org/apache/camel/util/PackageHelperTest.java
index aaa0e13d06b..625f5fa2f75 100644
--- a/core/camel-core/src/test/java/org/apache/camel/util/PackageHelperTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/util/PackageHelperTest.java
@@ -18,13 +18,13 @@ package org.apache.camel.util;
import org.junit.jupiter.api.Test;
-import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
public class PackageHelperTest {
@Test
public void testIsValidPackage() {
boolean valid = PackageHelper.isValidVersion("org.apache.camel", 2.0);
- assertEquals(true, valid, "Should be Camel 2.0 or higher");
+ assertTrue(valid, "Should be Camel 2.0 or higher");
}
}
diff --git a/core/camel-core/src/test/java/org/apache/camel/util/StingQuoteHelperTest.java b/core/camel-core/src/test/java/org/apache/camel/util/StingQuoteHelperTest.java
index 1f5126a292a..b8c79f5be24 100644
--- a/core/camel-core/src/test/java/org/apache/camel/util/StingQuoteHelperTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/util/StingQuoteHelperTest.java
@@ -19,6 +19,7 @@ package org.apache.camel.util;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
/**
*
@@ -27,7 +28,7 @@ public class StingQuoteHelperTest {
@Test
public void testSplitSafeQuote() throws Exception {
- assertEquals(null, StringQuoteHelper.splitSafeQuote(null, ','));
+ assertNull(StringQuoteHelper.splitSafeQuote(null, ','));
String[] out = StringQuoteHelper.splitSafeQuote("", ',');
assertEquals(1, out.length);
diff --git a/core/camel-core/src/test/java/org/apache/camel/util/StringHelperTest.java b/core/camel-core/src/test/java/org/apache/camel/util/StringHelperTest.java
index d6ac2c858d6..a0770e7009a 100644
--- a/core/camel-core/src/test/java/org/apache/camel/util/StringHelperTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/util/StringHelperTest.java
@@ -85,7 +85,7 @@ public class StringHelperTest {
public void testRemoveQuotes() throws Exception {
assertEquals("Hello World", StringHelper.removeQuotes("Hello World"));
assertEquals("", StringHelper.removeQuotes(""));
- assertEquals(null, StringHelper.removeQuotes(null));
+ assertNull(StringHelper.removeQuotes(null));
assertEquals(" ", StringHelper.removeQuotes(" "));
assertEquals("foo", StringHelper.removeQuotes("'foo'"));
assertEquals("foo", StringHelper.removeQuotes("'foo"));
@@ -98,7 +98,7 @@ public class StringHelperTest {
@Test
public void testRemoveLeadingAndEndingQuotes() throws Exception {
- assertEquals(null, StringHelper.removeLeadingAndEndingQuotes(null));
+ assertNull(StringHelper.removeLeadingAndEndingQuotes(null));
assertEquals("", StringHelper.removeLeadingAndEndingQuotes(""));
assertEquals(" ", StringHelper.removeLeadingAndEndingQuotes(" "));
assertEquals("Hello World", StringHelper.removeLeadingAndEndingQuotes("Hello World"));
@@ -109,70 +109,70 @@ public class StringHelperTest {
@Test
public void testHasUpper() throws Exception {
- assertEquals(false, StringHelper.hasUpperCase(null));
- assertEquals(false, StringHelper.hasUpperCase(""));
- assertEquals(false, StringHelper.hasUpperCase(" "));
- assertEquals(false, StringHelper.hasUpperCase("com.foo"));
- assertEquals(false, StringHelper.hasUpperCase("com.foo.123"));
+ assertFalse(StringHelper.hasUpperCase(null));
+ assertFalse(StringHelper.hasUpperCase(""));
+ assertFalse(StringHelper.hasUpperCase(" "));
+ assertFalse(StringHelper.hasUpperCase("com.foo"));
+ assertFalse(StringHelper.hasUpperCase("com.foo.123"));
- assertEquals(true, StringHelper.hasUpperCase("com.foo.MyClass"));
- assertEquals(true, StringHelper.hasUpperCase("com.foo.My"));
+ assertTrue(StringHelper.hasUpperCase("com.foo.MyClass"));
+ assertTrue(StringHelper.hasUpperCase("com.foo.My"));
// Note, this is not a FQN
- assertEquals(true, StringHelper.hasUpperCase("com.foo.subA"));
+ assertTrue(StringHelper.hasUpperCase("com.foo.subA"));
}
@Test
public void testIsClassName() throws Exception {
- assertEquals(false, StringHelper.isClassName(null));
- assertEquals(false, StringHelper.isClassName(""));
- assertEquals(false, StringHelper.isClassName(" "));
- assertEquals(false, StringHelper.isClassName("com.foo"));
- assertEquals(false, StringHelper.isClassName("com.foo.123"));
+ assertFalse(StringHelper.isClassName(null));
+ assertFalse(StringHelper.isClassName(""));
+ assertFalse(StringHelper.isClassName(" "));
+ assertFalse(StringHelper.isClassName("com.foo"));
+ assertFalse(StringHelper.isClassName("com.foo.123"));
- assertEquals(true, StringHelper.isClassName("com.foo.MyClass"));
- assertEquals(true, StringHelper.isClassName("com.foo.My"));
+ assertTrue(StringHelper.isClassName("com.foo.MyClass"));
+ assertTrue(StringHelper.isClassName("com.foo.My"));
// Note, this is not a FQN
- assertEquals(false, StringHelper.isClassName("com.foo.subA"));
+ assertFalse(StringHelper.isClassName("com.foo.subA"));
}
@Test
public void testHasStartToken() throws Exception {
- assertEquals(false, StringHelper.hasStartToken(null, null));
- assertEquals(false, StringHelper.hasStartToken(null, "simple"));
- assertEquals(false, StringHelper.hasStartToken("", null));
- assertEquals(false, StringHelper.hasStartToken("", "simple"));
- assertEquals(false, StringHelper.hasStartToken("Hello World", null));
- assertEquals(false, StringHelper.hasStartToken("Hello World", "simple"));
-
- assertEquals(false, StringHelper.hasStartToken("${body}", null));
- assertEquals(true, StringHelper.hasStartToken("${body}", "simple"));
- assertEquals(true, StringHelper.hasStartToken("$simple{body}", "simple"));
-
- assertEquals(false, StringHelper.hasStartToken("${body}", null));
- assertEquals(false, StringHelper.hasStartToken("${body}", "foo"));
+ assertFalse(StringHelper.hasStartToken(null, null));
+ assertFalse(StringHelper.hasStartToken(null, "simple"));
+ assertFalse(StringHelper.hasStartToken("", null));
+ assertFalse(StringHelper.hasStartToken("", "simple"));
+ assertFalse(StringHelper.hasStartToken("Hello World", null));
+ assertFalse(StringHelper.hasStartToken("Hello World", "simple"));
+
+ assertFalse(StringHelper.hasStartToken("${body}", null));
+ assertTrue(StringHelper.hasStartToken("${body}", "simple"));
+ assertTrue(StringHelper.hasStartToken("$simple{body}", "simple"));
+
+ assertFalse(StringHelper.hasStartToken("${body}", null));
+ assertFalse(StringHelper.hasStartToken("${body}", "foo"));
// $foo{ is valid because its foo language
- assertEquals(true, StringHelper.hasStartToken("$foo{body}", "foo"));
+ assertTrue(StringHelper.hasStartToken("$foo{body}", "foo"));
}
@Test
public void testIsQuoted() throws Exception {
- assertEquals(false, StringHelper.isQuoted(null));
- assertEquals(false, StringHelper.isQuoted(""));
- assertEquals(false, StringHelper.isQuoted(" "));
- assertEquals(false, StringHelper.isQuoted("abc"));
- assertEquals(false, StringHelper.isQuoted("abc'"));
- assertEquals(false, StringHelper.isQuoted("\"abc'"));
- assertEquals(false, StringHelper.isQuoted("abc\""));
- assertEquals(false, StringHelper.isQuoted("'abc\""));
- assertEquals(false, StringHelper.isQuoted("\"abc'"));
- assertEquals(false, StringHelper.isQuoted("abc'def'"));
- assertEquals(false, StringHelper.isQuoted("abc'def'ghi"));
- assertEquals(false, StringHelper.isQuoted("'def'ghi"));
-
- assertEquals(true, StringHelper.isQuoted("'abc'"));
- assertEquals(true, StringHelper.isQuoted("\"abc\""));
+ assertFalse(StringHelper.isQuoted(null));
+ assertFalse(StringHelper.isQuoted(""));
+ assertFalse(StringHelper.isQuoted(" "));
+ assertFalse(StringHelper.isQuoted("abc"));
+ assertFalse(StringHelper.isQuoted("abc'"));
+ assertFalse(StringHelper.isQuoted("\"abc'"));
+ assertFalse(StringHelper.isQuoted("abc\""));
+ assertFalse(StringHelper.isQuoted("'abc\""));
+ assertFalse(StringHelper.isQuoted("\"abc'"));
+ assertFalse(StringHelper.isQuoted("abc'def'"));
+ assertFalse(StringHelper.isQuoted("abc'def'ghi"));
+ assertFalse(StringHelper.isQuoted("'def'ghi"));
+
+ assertTrue(StringHelper.isQuoted("'abc'"));
+ assertTrue(StringHelper.isQuoted("\"abc\""));
}
@Test
@@ -186,7 +186,7 @@ public class StringHelperTest {
public void testBefore() {
assertEquals("Hello ", StringHelper.before("Hello World", "World"));
assertEquals("Hello ", StringHelper.before("Hello World Again", "World"));
- assertEquals(null, StringHelper.before("Hello Again", "Foo"));
+ assertNull(StringHelper.before("Hello Again", "Foo"));
assertTrue(StringHelper.before("mykey:ignore", ":", "mykey"::equals).orElse(false));
assertFalse(StringHelper.before("ignore:ignore", ":", "mykey"::equals).orElse(false));
@@ -202,7 +202,7 @@ public class StringHelperTest {
public void testAfter() {
assertEquals(" World", StringHelper.after("Hello World", "Hello"));
assertEquals(" World Again", StringHelper.after("Hello World Again", "Hello"));
- assertEquals(null, StringHelper.after("Hello Again", "Foo"));
+ assertNull(StringHelper.after("Hello Again", "Foo"));
assertTrue(StringHelper.after("ignore:mykey", ":", "mykey"::equals).orElse(false));
assertFalse(StringHelper.after("ignore:ignore", ":", "mykey"::equals).orElse(false));
@@ -218,7 +218,7 @@ public class StringHelperTest {
public void testBetween() {
assertEquals("foo bar", StringHelper.between("Hello 'foo bar' how are you", "'", "'"));
assertEquals("foo bar", StringHelper.between("Hello ${foo bar} how are you", "${", "}"));
- assertEquals(null, StringHelper.between("Hello ${foo bar} how are you", "'", "'"));
+ assertNull(StringHelper.between("Hello ${foo bar} how are you", "'", "'"));
assertTrue(StringHelper.between("begin:mykey:end", "begin:", ":end", "mykey"::equals).orElse(false));
assertFalse(StringHelper.between("begin:ignore:end", "begin:", ":end", "mykey"::equals).orElse(false));
@@ -227,9 +227,9 @@ public class StringHelperTest {
@Test
public void testBetweenOuterPair() {
assertEquals("bar(baz)123", StringHelper.betweenOuterPair("foo(bar(baz)123)", '(', ')'));
- assertEquals(null, StringHelper.betweenOuterPair("foo(bar(baz)123))", '(', ')'));
- assertEquals(null, StringHelper.betweenOuterPair("foo(bar(baz123", '(', ')'));
- assertEquals(null, StringHelper.betweenOuterPair("foo)bar)baz123", '(', ')'));
+ assertNull(StringHelper.betweenOuterPair("foo(bar(baz)123))", '(', ')'));
+ assertNull(StringHelper.betweenOuterPair("foo(bar(baz123", '(', ')'));
+ assertNull(StringHelper.betweenOuterPair("foo)bar)baz123", '(', ')'));
assertEquals("bar", StringHelper.betweenOuterPair("foo(bar)baz123", '(', ')'));
assertEquals("'bar', 'baz()123', 123", StringHelper.betweenOuterPair("foo('bar', 'baz()123', 123)", '(', ')'));
@@ -239,10 +239,10 @@ public class StringHelperTest {
@Test
public void testIsJavaIdentifier() {
- assertEquals(true, StringHelper.isJavaIdentifier("foo"));
- assertEquals(false, StringHelper.isJavaIdentifier("foo.bar"));
- assertEquals(false, StringHelper.isJavaIdentifier(""));
- assertEquals(false, StringHelper.isJavaIdentifier(null));
+ assertTrue(StringHelper.isJavaIdentifier("foo"));
+ assertFalse(StringHelper.isJavaIdentifier("foo.bar"));
+ assertFalse(StringHelper.isJavaIdentifier(""));
+ assertFalse(StringHelper.isJavaIdentifier(null));
}
@Test
@@ -321,7 +321,7 @@ public class StringHelperTest {
@Test
public void testCapitalizeDash() {
- assertEquals(null, StringHelper.dashToCamelCase(null));
+ assertNull(StringHelper.dashToCamelCase(null));
assertEquals("", StringHelper.dashToCamelCase(""));
assertEquals("hello", StringHelper.dashToCamelCase("hello"));
assertEquals("helloGreat", StringHelper.dashToCamelCase("helloGreat"));
[camel] 05/05: (chores) camel-core: use the empty array version as it is likely intrinsified
Posted by or...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 1800482a1e0477d27990968daa56c1e7b9a4ce6f
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Tue Jan 31 11:21:39 2023 +0100
(chores) camel-core: use the empty array version as it is likely intrinsified
---
.../src/test/java/org/apache/camel/support/component/TestProxy.java | 2 +-
.../java/org/apache/camel/support/jsse/SSLContextParametersTest.java | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/core/camel-core/src/test/java/org/apache/camel/support/component/TestProxy.java b/core/camel-core/src/test/java/org/apache/camel/support/component/TestProxy.java
index a0bdf175c43..c78bce68657 100644
--- a/core/camel-core/src/test/java/org/apache/camel/support/component/TestProxy.java
+++ b/core/camel-core/src/test/java/org/apache/camel/support/component/TestProxy.java
@@ -61,7 +61,7 @@ class TestProxy {
for (int i = 0; i < times; i++) {
result.add("Greetings " + name);
}
- return result.toArray(new String[result.size()]);
+ return result.toArray(new String[0]);
}
public Map<String, String> greetAll(Map<String, String> nameMap) {
diff --git a/core/camel-core/src/test/java/org/apache/camel/support/jsse/SSLContextParametersTest.java b/core/camel-core/src/test/java/org/apache/camel/support/jsse/SSLContextParametersTest.java
index 206029b7ce1..9971e981646 100644
--- a/core/camel-core/src/test/java/org/apache/camel/support/jsse/SSLContextParametersTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/support/jsse/SSLContextParametersTest.java
@@ -835,7 +835,7 @@ public class SSLContextParametersTest extends AbstractJsseParametersTest {
}
}
- return enabled.toArray(new String[enabled.size()]);
+ return enabled.toArray(new String[0]);
}
protected void assertStartsWith(String[] values, String prefix) {
[camel] 04/05: (chores) camel-core: avoid redundant array creation
Posted by or...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
commit b9bedd579e197fe5c029ddccbfed12f35cf294a5
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Tue Jan 31 11:18:30 2023 +0100
(chores) camel-core: avoid redundant array creation
---
.../test/java/org/apache/camel/builder/ExpressionBuilderTest.java | 8 ++++----
.../org/apache/camel/processor/ComposedMessageProcessorTest.java | 4 ++--
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/core/camel-core/src/test/java/org/apache/camel/builder/ExpressionBuilderTest.java b/core/camel-core/src/test/java/org/apache/camel/builder/ExpressionBuilderTest.java
index 60cecaa0b86..12a38d1df3b 100644
--- a/core/camel-core/src/test/java/org/apache/camel/builder/ExpressionBuilderTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/builder/ExpressionBuilderTest.java
@@ -44,7 +44,7 @@ public class ExpressionBuilderTest extends TestSupport {
@Test
public void testRegexTokenize() throws Exception {
Expression expression = regexTokenizeExpression(headerExpression("location"), ",");
- List<String> expected = new ArrayList<>(Arrays.asList(new String[] { "Islington", "London", "UK" }));
+ List<String> expected = new ArrayList<>(Arrays.asList("Islington", "London", "UK"));
assertExpression(expression, exchange, expected);
Predicate predicate
@@ -68,7 +68,7 @@ public class ExpressionBuilderTest extends TestSupport {
public void testTokenize() throws Exception {
Expression expression = tokenizeExpression(headerExpression("location"), ",");
- List<String> expected = new ArrayList<>(Arrays.asList(new String[] { "Islington", "London", "UK" }));
+ List<String> expected = new ArrayList<>(Arrays.asList("Islington", "London", "UK"));
assertExpression(expression, exchange, expected);
Predicate predicate = contains(tokenizeExpression(headerExpression("location"), ","), constantExpression("London"));
@@ -83,7 +83,7 @@ public class ExpressionBuilderTest extends TestSupport {
Expression expression = regexTokenizeExpression(bodyExpression(), "[\r|\n]");
exchange.getIn().setBody("Hello World\nBye World\rSee you again");
- List<String> expected = new ArrayList<>(Arrays.asList(new String[] { "Hello World", "Bye World", "See you again" }));
+ List<String> expected = new ArrayList<>(Arrays.asList("Hello World", "Bye World", "See you again"));
assertExpression(expression, exchange, expected);
}
@@ -92,7 +92,7 @@ public class ExpressionBuilderTest extends TestSupport {
Expression expression = sortExpression(body().tokenize(",").getExpression(), new SortByName());
exchange.getIn().setBody("Jonathan,Claus,James,Hadrian");
- List<String> expected = new ArrayList<>(Arrays.asList(new String[] { "Claus", "Hadrian", "James", "Jonathan" }));
+ List<String> expected = new ArrayList<>(Arrays.asList("Claus", "Hadrian", "James", "Jonathan"));
assertExpression(expression, exchange, expected);
}
diff --git a/core/camel-core/src/test/java/org/apache/camel/processor/ComposedMessageProcessorTest.java b/core/camel-core/src/test/java/org/apache/camel/processor/ComposedMessageProcessorTest.java
index 99bd7af68f7..f2c0e097b82 100644
--- a/core/camel-core/src/test/java/org/apache/camel/processor/ComposedMessageProcessorTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/processor/ComposedMessageProcessorTest.java
@@ -40,7 +40,7 @@ public class ComposedMessageProcessorTest extends ContextTestSupport {
resultEndpoint.expectedMessageCount(1);
resultEndpoint.expectedHeaderReceived("orderId", "myorderid");
- List<OrderItem> order = Arrays.asList(new OrderItem[] { new OrderItem("widget", 5), new OrderItem("gadget", 10) });
+ List<OrderItem> order = Arrays.asList(new OrderItem("widget", 5), new OrderItem("gadget", 10));
template.sendBodyAndHeader("direct:start", order, "orderId", "myorderid");
@@ -59,7 +59,7 @@ public class ComposedMessageProcessorTest extends ContextTestSupport {
resultEndpoint.expectedHeaderReceived("orderId", "myorderid");
// START SNIPPET: e1
- List<OrderItem> order = Arrays.asList(new OrderItem[] { new OrderItem("widget", 500), new OrderItem("gadget", 200) });
+ List<OrderItem> order = Arrays.asList(new OrderItem("widget", 500), new OrderItem("gadget", 200));
template.sendBodyAndHeader("direct:start", order, "orderId", "myorderid");
// END SNIPPET: e1
[camel] 02/05: (chores) camel-core: cleanup exception handling in the ConverterTest
Posted by or...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
commit f2273cd2ecca61a0bc19baf4a933783a83e6e787
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Tue Jan 31 10:55:52 2023 +0100
(chores) camel-core: cleanup exception handling in the ConverterTest
- use static class when possible
---
.../org/apache/camel/converter/ConverterTest.java | 74 +++++++++++-----------
1 file changed, 37 insertions(+), 37 deletions(-)
diff --git a/core/camel-core/src/test/java/org/apache/camel/converter/ConverterTest.java b/core/camel-core/src/test/java/org/apache/camel/converter/ConverterTest.java
index 48e8a342d5c..9b646137ed4 100644
--- a/core/camel-core/src/test/java/org/apache/camel/converter/ConverterTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/converter/ConverterTest.java
@@ -43,7 +43,12 @@ import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import static org.junit.jupiter.api.Assertions.*;
+import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
+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.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
public class ConverterTest extends TestSupport {
@@ -58,7 +63,7 @@ public class ConverterTest extends TestSupport {
}
@Test
- public void testIntegerPropertyEditorConversion() throws Exception {
+ public void testIntegerPropertyEditorConversion() {
Integer value = converter.convertTo(Integer.class, "1000");
assertNotNull(value);
assertEquals(Integer.valueOf(1000), (Object) value, "Converted to Integer");
@@ -68,7 +73,7 @@ public class ConverterTest extends TestSupport {
}
@Test
- public void testConvertStringToAndFromByteArray() throws Exception {
+ public void testConvertStringToAndFromByteArray() {
byte[] array = converter.convertTo(byte[].class, "foo");
assertNotNull(array);
@@ -79,7 +84,7 @@ public class ConverterTest extends TestSupport {
}
@Test
- public void testConvertStringToAndFromCharArray() throws Exception {
+ public void testConvertStringToAndFromCharArray() {
char[] array = converter.convertTo(char[].class, "foo");
assertNotNull(array);
@@ -90,7 +95,7 @@ public class ConverterTest extends TestSupport {
}
@Test
- public void testConvertStringAndStreams() throws Exception {
+ public void testConvertStringAndStreams() {
InputStream inputStream = converter.convertTo(InputStream.class, "bar");
assertNotNull(inputStream);
@@ -99,7 +104,7 @@ public class ConverterTest extends TestSupport {
}
@Test
- public void testArrayToListAndSetConversion() throws Exception {
+ public void testArrayToListAndSetConversion() {
String[] array = new String[] { "one", "two" };
List<?> list = converter.convertTo(List.class, array);
@@ -115,7 +120,7 @@ public class ConverterTest extends TestSupport {
}
@Test
- public void testCollectionToArrayConversion() throws Exception {
+ public void testCollectionToArrayConversion() {
List<String> list = new ArrayList<>();
list.add("one");
list.add("two");
@@ -128,7 +133,7 @@ public class ConverterTest extends TestSupport {
}
@Test
- public void testCollectionToPrimitiveArrayConversion() throws Exception {
+ public void testCollectionToPrimitiveArrayConversion() {
List<Integer> list = new ArrayList<>();
list.add(5);
list.add(6);
@@ -150,7 +155,7 @@ public class ConverterTest extends TestSupport {
}
@Test
- public void testStringToFile() throws Exception {
+ public void testStringToFile() {
File file = converter.convertTo(File.class, "foo.txt");
assertNotNull("Should have converted to a file!");
assertEquals("foo.txt", file.getName(), "file name");
@@ -168,26 +173,26 @@ public class ConverterTest extends TestSupport {
}
@Test
- public void testPrimitiveBooleanConversion() throws Exception {
- boolean value = converter.convertTo(boolean.class, null);
+ public void testPrimitiveBooleanConversion() {
+ boolean value = assertDoesNotThrow(() -> converter.convertTo(boolean.class, null));
assertFalse(value);
}
@Test
- public void testPrimitiveIntConversion() throws Exception {
+ public void testPrimitiveIntConversion() {
int value = converter.convertTo(int.class, 4);
assertEquals(4, value, "value");
}
@Test
- public void testPrimitiveIntPropertySetter() throws Exception {
+ public void testPrimitiveIntPropertySetter() {
MyBean bean = new MyBean();
- IntrospectionSupport.setProperty(converter, bean, "foo", "4");
+ assertDoesNotThrow(() -> IntrospectionSupport.setProperty(converter, bean, "foo", "4"));
assertEquals(4, bean.getFoo(), "bean.foo");
}
@Test
- public void testStringToBoolean() throws Exception {
+ public void testStringToBoolean() {
Boolean value = converter.convertTo(Boolean.class, "true");
assertEquals(Boolean.TRUE, value, "converted boolean value");
@@ -199,7 +204,7 @@ public class ConverterTest extends TestSupport {
}
@Test
- public void testStaticMethodConversionWithExchange() throws Exception {
+ public void testStaticMethodConversionWithExchange() {
CamelContext camel = new DefaultCamelContext();
Exchange e = new DefaultExchange(camel);
e.setProperty("prefix", "foo-");
@@ -209,7 +214,7 @@ public class ConverterTest extends TestSupport {
}
@Test
- public void testInstanceMethodConversionWithExchange() throws Exception {
+ public void testInstanceMethodConversionWithExchange() {
String[] values = new String[] { "5", "bar" };
CamelContext camel = new DefaultCamelContext();
@@ -223,46 +228,41 @@ public class ConverterTest extends TestSupport {
@Test
public void testMandatoryConvertTo() {
CamelContext camel = new DefaultCamelContext();
- Exchange e = new DefaultExchange(camel);
- try {
- converter.mandatoryConvertTo(InputStream.class, e);
- fail("Expect exception here");
- } catch (Exception ex) {
- boolean b = ex instanceof NoTypeConversionAvailableException;
- assertTrue(b, "Expect to get a NoTypeConversionAvailableException here");
- }
+ Exchange exchange = new DefaultExchange(camel);
+
+ Exception ex = assertThrows(NoTypeConversionAvailableException.class,
+ () -> converter.mandatoryConvertTo(InputStream.class, exchange),
+ "Expected to get a NoTypeConversionAvailableException here");
}
@Test
- public void testStringToChar() throws Exception {
- char ch = converter.convertTo(char.class, "A");
+ public void testStringToChar() {
+ char ch = assertDoesNotThrow(() -> converter.convertTo(char.class, "A"));
assertEquals('A', (int) ch);
- ch = converter.convertTo(char.class, " ");
+ ch = assertDoesNotThrow(() -> converter.convertTo(char.class, " "));
assertEquals(' ', (int) ch);
- try {
- converter.mandatoryConvertTo(char.class, "ABC");
- fail("Should have thrown an exception");
- } catch (TypeConversionException e) {
- assertEquals("String must have exactly a length of 1: ABC", e.getCause().getMessage());
- }
+ Exception ex = assertThrows(TypeConversionException.class,
+ () -> converter.mandatoryConvertTo(char.class, "ABC"), "Should have thrown an exception");
+
+ assertEquals("String must have exactly a length of 1: ABC", ex.getCause().getMessage());
}
@Test
- public void testNullToBoolean() throws Exception {
+ public void testNullToBoolean() {
boolean b = converter.convertTo(boolean.class, null);
assertFalse(b);
}
@Test
- public void testNullToInt() throws Exception {
+ public void testNullToInt() {
int i = converter.convertTo(int.class, null);
assertEquals(0, i);
}
@Test
- public void testToInt() throws Exception {
+ public void testToInt() {
int i = converter.convertTo(int.class, "0");
assertEquals(0, i);
}
[camel] 01/05: (chores) camel-core: tests cleanups
Posted by or...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
commit c38a276cc45c9abc5a0100eaf064373f56bc51ca
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Tue Jan 31 10:44:20 2023 +0100
(chores) camel-core: tests cleanups
- use static class when possible
---
.../java/org/apache/camel/cluster/ClusterServiceSelectorTest.java | 4 ++--
.../camel/component/bean/BeanInfoAMoreComplexOverloadedTest.java | 4 ++--
.../java/org/apache/camel/component/bean/BeanInfoOverloadedTest.java | 2 +-
.../camel/component/bean/BeanInfoOverloadedWithSubTypeParamTest.java | 2 +-
.../src/test/java/org/apache/camel/component/bean/BeanInfoTest.java | 2 +-
.../test/java/org/apache/camel/impl/CustomUnitOfWorkFactoryTest.java | 2 +-
.../apache/camel/impl/DefaultComponentReferencePropertiesTest.java | 2 +-
.../src/test/java/org/apache/camel/impl/DefaultProducerCacheTest.java | 2 +-
.../apache/camel/impl/EventDrivenPollingConsumerQueueSizeTest.java | 2 +-
.../java/org/apache/camel/impl/ProducerCacheNonSingletonTest.java | 2 +-
.../camel/impl/engine/DefaultSupervisingRouteControllerTest.java | 2 +-
.../src/test/java/org/apache/camel/issues/Camel4857UriIssueTest.java | 2 +-
.../java/org/apache/camel/issues/EndpointWithRawUriParameterTest.java | 2 +-
.../issues/RedeliveryPolicyOnExceptionWhileRedeliveringIssueTest.java | 2 +-
.../apache/camel/issues/RouteStartupFailShouldStopAlsoIssueTest.java | 2 +-
.../java/org/apache/camel/processor/ConsumerRouteIdAwareTest.java | 2 +-
.../java/org/apache/camel/processor/PipelineStepWithEventTest.java | 4 ++--
.../test/java/org/apache/camel/support/IntrospectionSupportTest.java | 2 +-
18 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/core/camel-core/src/test/java/org/apache/camel/cluster/ClusterServiceSelectorTest.java b/core/camel-core/src/test/java/org/apache/camel/cluster/ClusterServiceSelectorTest.java
index 8fc8355907a..f8abc4a2925 100644
--- a/core/camel-core/src/test/java/org/apache/camel/cluster/ClusterServiceSelectorTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/cluster/ClusterServiceSelectorTest.java
@@ -326,7 +326,7 @@ public class ClusterServiceSelectorTest {
// Helpers
// **************************************
- private final class DummyClusterService1 extends AbstractCamelClusterService {
+ private static final class DummyClusterService1 extends AbstractCamelClusterService {
public DummyClusterService1() {
}
@@ -336,7 +336,7 @@ public class ClusterServiceSelectorTest {
}
}
- private final class DummyClusterService2 extends AbstractCamelClusterService {
+ private static final class DummyClusterService2 extends AbstractCamelClusterService {
public DummyClusterService2() {
}
diff --git a/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanInfoAMoreComplexOverloadedTest.java b/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanInfoAMoreComplexOverloadedTest.java
index 8dad77cc9c7..703e15cb169 100644
--- a/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanInfoAMoreComplexOverloadedTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanInfoAMoreComplexOverloadedTest.java
@@ -93,11 +93,11 @@ public class BeanInfoAMoreComplexOverloadedTest extends ContextTestSupport {
public long id;
}
- class RequestA extends BaseRequest {
+ static class RequestA extends BaseRequest {
public int i;
}
- class RequestB extends BaseRequest {
+ static class RequestB extends BaseRequest {
public String s;
}
diff --git a/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanInfoOverloadedTest.java b/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanInfoOverloadedTest.java
index cfe9acfe16c..ccc1e2c77ed 100644
--- a/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanInfoOverloadedTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanInfoOverloadedTest.java
@@ -46,7 +46,7 @@ public class BeanInfoOverloadedTest extends ContextTestSupport {
assertEquals(RequestB.class, method.getGenericParameterTypes()[0]);
}
- class Bean {
+ static class Bean {
public void doSomething(RequestA request) {
}
diff --git a/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanInfoOverloadedWithSubTypeParamTest.java b/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanInfoOverloadedWithSubTypeParamTest.java
index a62ec949f38..28d5a2e3fbb 100644
--- a/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanInfoOverloadedWithSubTypeParamTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanInfoOverloadedWithSubTypeParamTest.java
@@ -41,6 +41,6 @@ public class BeanInfoOverloadedWithSubTypeParamTest extends ContextTestSupport {
static class RequestB {
}
- class RequestC extends RequestB {
+ static class RequestC extends RequestB {
}
}
diff --git a/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanInfoTest.java b/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanInfoTest.java
index fd2dbecdacd..0e9b1134ecf 100644
--- a/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanInfoTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanInfoTest.java
@@ -225,7 +225,7 @@ public class BeanInfoTest {
}
}
- public class PublicClassImplementingBySuperPackagePrivateClass extends PackagePrivateClassDefiningMethod
+ public static class PublicClassImplementingBySuperPackagePrivateClass extends PackagePrivateClassDefiningMethod
implements IMethodInterface {
}
diff --git a/core/camel-core/src/test/java/org/apache/camel/impl/CustomUnitOfWorkFactoryTest.java b/core/camel-core/src/test/java/org/apache/camel/impl/CustomUnitOfWorkFactoryTest.java
index b647ed28a71..05171a082ac 100644
--- a/core/camel-core/src/test/java/org/apache/camel/impl/CustomUnitOfWorkFactoryTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/impl/CustomUnitOfWorkFactoryTest.java
@@ -57,7 +57,7 @@ public class CustomUnitOfWorkFactoryTest extends ContextTestSupport {
};
}
- private class MyUnitOfWorkFactory implements UnitOfWorkFactory {
+ private static class MyUnitOfWorkFactory implements UnitOfWorkFactory {
@Override
public UnitOfWork createUnitOfWork(Exchange exchange) {
diff --git a/core/camel-core/src/test/java/org/apache/camel/impl/DefaultComponentReferencePropertiesTest.java b/core/camel-core/src/test/java/org/apache/camel/impl/DefaultComponentReferencePropertiesTest.java
index a151151b123..7c39afab159 100644
--- a/core/camel-core/src/test/java/org/apache/camel/impl/DefaultComponentReferencePropertiesTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/impl/DefaultComponentReferencePropertiesTest.java
@@ -90,7 +90,7 @@ public class DefaultComponentReferencePropertiesTest extends ContextTestSupport
}
}
- public final class MyComponent extends DefaultComponent {
+ public static final class MyComponent extends DefaultComponent {
private MyComponent(CamelContext context) {
super(context);
diff --git a/core/camel-core/src/test/java/org/apache/camel/impl/DefaultProducerCacheTest.java b/core/camel-core/src/test/java/org/apache/camel/impl/DefaultProducerCacheTest.java
index fb7466cb78b..f901642cc8f 100644
--- a/core/camel-core/src/test/java/org/apache/camel/impl/DefaultProducerCacheTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/impl/DefaultProducerCacheTest.java
@@ -208,7 +208,7 @@ public class DefaultProducerCacheTest extends ContextTestSupport {
await().atMost(3, TimeUnit.SECONDS).untilAsserted(() -> assertEquals(3, stopCounter.get()));
}
- private class MyProducerCache extends DefaultProducerCache {
+ private static class MyProducerCache extends DefaultProducerCache {
private MyServicePool myServicePool;
diff --git a/core/camel-core/src/test/java/org/apache/camel/impl/EventDrivenPollingConsumerQueueSizeTest.java b/core/camel-core/src/test/java/org/apache/camel/impl/EventDrivenPollingConsumerQueueSizeTest.java
index c0ada2c1295..b3badbe81e5 100644
--- a/core/camel-core/src/test/java/org/apache/camel/impl/EventDrivenPollingConsumerQueueSizeTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/impl/EventDrivenPollingConsumerQueueSizeTest.java
@@ -105,7 +105,7 @@ public class EventDrivenPollingConsumerQueueSizeTest extends ContextTestSupport
return false;
}
- private final class MyQueueComponent extends DefaultComponent {
+ private static final class MyQueueComponent extends DefaultComponent {
@Override
protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
diff --git a/core/camel-core/src/test/java/org/apache/camel/impl/ProducerCacheNonSingletonTest.java b/core/camel-core/src/test/java/org/apache/camel/impl/ProducerCacheNonSingletonTest.java
index a9b91b5d859..1991b3d4a06 100644
--- a/core/camel-core/src/test/java/org/apache/camel/impl/ProducerCacheNonSingletonTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/impl/ProducerCacheNonSingletonTest.java
@@ -71,7 +71,7 @@ public class ProducerCacheNonSingletonTest extends ContextTestSupport {
}
}
- public class MyDummyEndpoint extends DefaultEndpoint {
+ public static class MyDummyEndpoint extends DefaultEndpoint {
@Override
public Producer createProducer() throws Exception {
diff --git a/core/camel-core/src/test/java/org/apache/camel/impl/engine/DefaultSupervisingRouteControllerTest.java b/core/camel-core/src/test/java/org/apache/camel/impl/engine/DefaultSupervisingRouteControllerTest.java
index 05bce5e38af..e56e29851f6 100644
--- a/core/camel-core/src/test/java/org/apache/camel/impl/engine/DefaultSupervisingRouteControllerTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/impl/engine/DefaultSupervisingRouteControllerTest.java
@@ -143,7 +143,7 @@ public class DefaultSupervisingRouteControllerTest extends ContextTestSupport {
}
}
- private class MyJmsEndpoint extends SedaEndpoint {
+ private static class MyJmsEndpoint extends SedaEndpoint {
private String name;
diff --git a/core/camel-core/src/test/java/org/apache/camel/issues/Camel4857UriIssueTest.java b/core/camel-core/src/test/java/org/apache/camel/issues/Camel4857UriIssueTest.java
index 0c950ce32c7..8a939157ca1 100644
--- a/core/camel-core/src/test/java/org/apache/camel/issues/Camel4857UriIssueTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/issues/Camel4857UriIssueTest.java
@@ -70,7 +70,7 @@ public class Camel4857UriIssueTest extends ContextTestSupport {
}
}
- class MyComponent extends DefaultComponent {
+ static class MyComponent extends DefaultComponent {
@Override
protected Endpoint createEndpoint(final String uri, final String remaining, final Map<String, Object> parameters)
diff --git a/core/camel-core/src/test/java/org/apache/camel/issues/EndpointWithRawUriParameterTest.java b/core/camel-core/src/test/java/org/apache/camel/issues/EndpointWithRawUriParameterTest.java
index b49f622791b..e6e5b26fe1f 100644
--- a/core/camel-core/src/test/java/org/apache/camel/issues/EndpointWithRawUriParameterTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/issues/EndpointWithRawUriParameterTest.java
@@ -36,7 +36,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
public class EndpointWithRawUriParameterTest extends ContextTestSupport {
- public final class MyComponent extends DefaultComponent {
+ public static final class MyComponent extends DefaultComponent {
@Override
protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
diff --git a/core/camel-core/src/test/java/org/apache/camel/issues/RedeliveryPolicyOnExceptionWhileRedeliveringIssueTest.java b/core/camel-core/src/test/java/org/apache/camel/issues/RedeliveryPolicyOnExceptionWhileRedeliveringIssueTest.java
index 49b424dccd3..263a361a360 100644
--- a/core/camel-core/src/test/java/org/apache/camel/issues/RedeliveryPolicyOnExceptionWhileRedeliveringIssueTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/issues/RedeliveryPolicyOnExceptionWhileRedeliveringIssueTest.java
@@ -37,7 +37,7 @@ public class RedeliveryPolicyOnExceptionWhileRedeliveringIssueTest extends Conte
private static final long serialVersionUID = 1L;
}
- private class ExceptionThrowingProcessor implements Processor {
+ private static class ExceptionThrowingProcessor implements Processor {
@Override
public void process(Exchange exchange) throws Exception {
diff --git a/core/camel-core/src/test/java/org/apache/camel/issues/RouteStartupFailShouldStopAlsoIssueTest.java b/core/camel-core/src/test/java/org/apache/camel/issues/RouteStartupFailShouldStopAlsoIssueTest.java
index 6ab31700a85..00450cf8fde 100644
--- a/core/camel-core/src/test/java/org/apache/camel/issues/RouteStartupFailShouldStopAlsoIssueTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/issues/RouteStartupFailShouldStopAlsoIssueTest.java
@@ -92,7 +92,7 @@ public class RouteStartupFailShouldStopAlsoIssueTest extends ContextTestSupport
}
}
- private class MyEndpoint extends DefaultEndpoint {
+ private static class MyEndpoint extends DefaultEndpoint {
public MyEndpoint(String endpointUri, Component component) {
super(endpointUri, component);
diff --git a/core/camel-core/src/test/java/org/apache/camel/processor/ConsumerRouteIdAwareTest.java b/core/camel-core/src/test/java/org/apache/camel/processor/ConsumerRouteIdAwareTest.java
index 9a0881089d7..130661812fc 100644
--- a/core/camel-core/src/test/java/org/apache/camel/processor/ConsumerRouteIdAwareTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/processor/ConsumerRouteIdAwareTest.java
@@ -65,7 +65,7 @@ public class ConsumerRouteIdAwareTest extends ContextTestSupport {
}
}
- private class MyEndpoint extends DefaultEndpoint {
+ private static class MyEndpoint extends DefaultEndpoint {
public MyEndpoint(String endpointUri, Component component) {
super(endpointUri, component);
diff --git a/core/camel-core/src/test/java/org/apache/camel/processor/PipelineStepWithEventTest.java b/core/camel-core/src/test/java/org/apache/camel/processor/PipelineStepWithEventTest.java
index 0ab2014716b..4333cfba5a8 100644
--- a/core/camel-core/src/test/java/org/apache/camel/processor/PipelineStepWithEventTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/processor/PipelineStepWithEventTest.java
@@ -115,7 +115,7 @@ public class PipelineStepWithEventTest extends ContextTestSupport {
}
- private class MyStepEventListener extends ServiceSupport implements StepEventListener {
+ private static class MyStepEventListener extends ServiceSupport implements StepEventListener {
private final List<EventObject> events = new ArrayList<>();
@@ -162,7 +162,7 @@ public class PipelineStepWithEventTest extends ContextTestSupport {
}
}
- private class MyStepEventProcessor extends DelegateAsyncProcessor {
+ private static class MyStepEventProcessor extends DelegateAsyncProcessor {
private final StepEventListener listener;
private final String id;
diff --git a/core/camel-core/src/test/java/org/apache/camel/support/IntrospectionSupportTest.java b/core/camel-core/src/test/java/org/apache/camel/support/IntrospectionSupportTest.java
index 52c4ee91a33..075762ae0b3 100644
--- a/core/camel-core/src/test/java/org/apache/camel/support/IntrospectionSupportTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/support/IntrospectionSupportTest.java
@@ -141,7 +141,7 @@ public class IntrospectionSupportTest extends ContextTestSupport {
}
}
- public class MyOtherBuilderBean extends MyBuilderBean {
+ public static class MyOtherBuilderBean extends MyBuilderBean {
}
public class MyOtherOtherBuilderBean extends MyOtherBuilderBean {