You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by al...@apache.org on 2019/07/24 15:55:58 UTC

[camel] branch CAMEL-13342-JUNIT5-EXPLORATORY updated (44fdd73 -> 73b2c96)

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

aldettinger pushed a change to branch CAMEL-13342-JUNIT5-EXPLORATORY
in repository https://gitbox.apache.org/repos/asf/camel.git.


 discard 44fdd73  CAMEL-13342: Implemented a first version of a proof-of-concept for camel-test-spring/SpringExtension with JUnit 5
 discard 54abefb  CAMEL-13342: Moved further the proof-of-concept for camel-test-spring/CamelSpringTestSupport
 discard ca372d4  CAMEL-13342: Implemented a first version of a proof-of-concept for camel-testcontainers-spring with JUnit 5
 discard 4e17c51  CAMEL-13342: Implemented a first version of a proof-of-concept for camel-testcontainers with JUnit 5
 discard af308b4  CAMEL-13342: Implemented a first version of a proof-of-concept for camel-cdi-test in junit 5
 discard 197546b  CAMEL-13342: Added a JUnit 5 version of JUnit 4 test patterns
 discard b9dcb7f  CAMEL-13342: Setup SimpleMockTest with junit extension and parameter resolver
 discard bf91554  CAMEL-13342: Created CamelTest annotation and move existing tests to **test/junit4**
     add 5190b41  CAMEL-13734: camel-undertow - Fix one-way streaming for producer with tests
     add 9523d4d  Camel-Undertow: Fixed CS
     add 824c52d  CAMEL-13761: Update javadoc about startup listener
     add dd18f3b  incorect paths fixed in faq directory
     add f4cf513  more fixes for anchor not found errors
     add 07a8d8f  CAMEL-13762 - Camel-Lucene: Upgrade Lucene to 8.x
     add 350ed40  CAMEL-13762 - Fixed CS
     add 8e0610a  CAMEL-13765 - Camel-Solr: Upgrade Solr to 8.x
     add 54e660f  Camel-Solr: Restore Spring Boot integration test
     add 367a542  Upgrade Wiremock to version 2.24.0
     add 8797a9b  Upgrade Vertx to version 3.8.0
     add 2b49570  CAMEL-13759: camel3 - Debugger should not use intercept strategy but use internal processor advice as other similar features does.
     add 272ea94  Polished
     add 2e0b40f  Upgrade Braintree to version 2.101.0
     add 437ba96  Update jvm.config to print the configuration
     add 0730040  Avoid the overriding of MAVEN options on Jenkins CI
     add 56f9b35  JenkinsFile add a bit more information while building
     add c231712  Fix Jenkinsfile
     add e21294a  Run the maven commands with sh -x for debugging reason
     add 4d639e0  Jenkins: Lets skip .mavenrc config from node
     add 6be132f  JenkinsFile: Removing debugging bits
     add ad56c6b  Jenkinsfile.daily: Apply the same approach and ignore the .mavenrc from Jenkins node
     add e7fa6be  Jenkinsfile.jdk11: Apply the same approach and ignore the .mavenrc from Jenkins node
     add 81089ce  Jenkinsfile.jdk12: Apply the same approach and ignore the .mavenrc from Jenkins node
     add a281cf3  Jenkinsfile.karaf: Apply the same approach and ignore the .mavenrc from Jenkins node
     add 213477d  Jenkinsfile.karaf.jdk11: Apply the same approach and ignore the .mavenrc from Jenkins node
     add 8e8517d  Jenkinsfile.sb: Apply the same approach and ignore the .mavenrc from Jenkins node
     add 661bb7b  Jenkinsfile.sb.jdk11: Apply the same approach and ignore the .mavenrc from Jenkins node
     add 67dd7c3  Removed -XX:+PrintFlagsFinal from jvm.config
     add 29e51cd  CAMEL-13767 - Camel-elasticsearch-rest: Types are deprecated, we need to remove them and check if everything is still ok
     add c52fde1  Re-introduced Spring Boot Integration test for Camel-Elasticsearch-rest
     add c8af27c  CAMEL-13764 component connection setting
     add 3fb01b6  CAMEL-13764 - fixing javadoc with PR suggestions
     add c718950  CAMEL-13764 - Regen
     add db6ba93  Regen
     add e459c5e  Fix docs of contentCache for language component as its default true
     add a2e2acf  Polished
     add 30b93af  CAMEL-13399: Optimized ZipAggregationStrategy to use ZipFileSystem
     add 6e5cf74  CAMEL-13399: Truncate zip entry, if already exists
     add 3e285e1  CAMEL-13399: Code review
     add f2017aa  CAMEL-13750: Omit JMSCorrelationID when sending with useMessageIDAsCorrelationID
     add ae75302  Lets remove the release notes from the camel repo, because we already have this in camel-website
     add ff20ddc  Removed 2.20.0 release notes as ported to website
     add 6e0b3d2  Remove 2.20.x release notes as ported to website repo
     add cd0df2f  Regen
     add 7f02ca4  Upgrade Box SDK to version 2.35.0
     add 1a1bf67  "CAMEL-13454:camel-testcontainers - Should build if no docker"
     add e83f75f  Removed 2.19.x release notes since already ported to website repo
     add 5141b01  Increase waitTime for Spring Boot integration tests
     add a4ac6b4  "CAMEL-13454:camel-testcontainers - Should build if no docker"
     add ad30469  Updating XML Security
     add e49145b  "CAMEL-13454:camel-testcontainers - Should build if no docker forpulsar component"
     add e54df1a  fix typo
     add 8ca303a  Merge pull request #3052 from davidkarlsen/fixtypo
     add bf86722  camel-infinispan: move infinispan manger lifecycle from consumer/producer to endpoint
     add 085d28e  fixed incorrect cross references in core/camel-base
     add da3b41e  fixed incorrect cross references in core/camel-core
     add e8c9c80  fixed incorrect cross references in docs/components
     add f4624cb  Fixed cross references in camel/components
     add 90f7fb8  fixed incorrect cross references in docs/user-manual
     add 8e3139e  Regen
     add 870c356  first set of "asciidoctor: WARNING: skipping reference to missing attribute:"  fixed
     add 268d4b6  second set of asciidoctor: WARNING: skipping reference to missing attribute: fixed
     add c42d5c7  copied components from docs/components to camel/components
     add ba72d51  Fixes for CAMEL-13588
     add 1f36432  copied  appropriate .adoc files from usser-manal to camel/core/camel-core
     add 831e466  Revert "Regen"
     add 37d5fda  Upgrade Owasp maven plugin to version 5.2.0
     add 8b2431e  Removed the release notes related to 2.18.x already moved to website
     add 09d4d61  CAMEL-13776 - fixing autoclosable cursor issue
     add 68499bc  Camel-Bean-Validator: Use BindToRegistry annotation instead of JndiRegistry
     add 3bad809  Removed unused imports
     add 59a530d  Camel-Bean-Validator: Fixed CS
     add fc0e4ab  camel-caffeine-lrucache: wrap default executor to make it AOT friendly
     add e352500  CAMEL-13589: remove deprecated or replaced docs
     add d2aea30  CAMEL-11497: additional content from the wiki
     add 8d5c9df  CAMEL-13589: fixes remaining broken links
     add ac473c0  CAMEL-13589: add xref checker
     add d1de602  Camel-AHC: Use BindToRegistry annotation where possible
     add 399bee9  Removed unused imports
     add 84733a8  Camel-Caffeine: Use BindToRegistry annotation where possible
     add 38e237e  Remove unused imports
     add 4117af8  Camel-Cometd: Use BindToRegistry annotation where possible
     add a5b7df9  Removed unused imports
     add 93604da  Camel-Corda: Use BindToRegistry annotation where possible
     add 1e99406  Camel-Corda: Fixed CS
     add 1560433  Removed unused imports
     add d02bd60  Removed unused imports
     add 9938205  Camel-Crypto-cms: Use BindToRegistry where possible
     add 2574c2c  CAMEL-11497: remove release notes
     add 4872dfc  Camel 13755 (#3053)
     add 1641265  Camel-CXF: Use BindToRegistry where possible
     add 4bbc471  Removed unused imports
     add 1ceccf2  CAMEL-13589: fix broken anchors
     add 2f3edbc  CAMEL-13589: fix broken anchors
     add fff8a54  CAMEL-13753: trigger website build
     add d77169f  CAMEL-13753: trigger website build (cleanup)
     add 2e1d0d3  CAMEL-13589: fix broken links
     add f38838f  Camel-Ehcache: Use BindToRegistry annotation where possible
     add ebd6edb  Removed unused imports
     add 2d10503  Camel-Disruptor - Use BindToRegistry annotation where possible
     add eba3b85  Removed unused imports
     add 5d3506f  Camel-Ejb: Avoid JndiRegistry where possible
     add 3c8ae24  Camel-EJB: Removed unused imports
     add 4d426cb  Camel-ElSql - Use BindToRegistry annotation where possible
     add 226aab2  Removed unused imports
     add d3d1d6b  Camel-Elsql: Fixed CS
     add d7f435a  CAMEL-13753: add required `steps`
     add b6aa809  Camel-Exec: Use BindToRegistry where possible
     add 7e7e4bc  Removed unused imports
     add bd4f266  Fixed CS for Camel-Exec
     add 2db1570  Camel-Facebook: Use BindToRegistry where possible
     add b3f7059  Fixed Stuff related to bean-language.adoc
     add 3f54531  Fixed testinga.doc link
     add ec1384b  Removed the links for the moment (bean-language and test-spring adoc)
     add a607098  CAMEL-13589: restore links
     add 9de8ddf  Camel 13760 (#3050)
     add 780740d  Fixed CS for Camel-Disruptor
     add a465225  Fixed CS for Camel-Openstack
     add b3e0cb6  Camel-Openstack: Better logging configuration for tests
     add 5da0670  Maybe adding not tracked files is better
     add 4dc1278  Camel-Fhir: Use BindToRegistry annotation where possible
     new 6103c93  CAMEL-13342: Created CamelTest annotation and move existing tests to **test/junit4**
     new cff1122  CAMEL-13342: Setup SimpleMockTest with junit extension and parameter resolver
     new d118669  CAMEL-13342: Added a JUnit 5 version of JUnit 4 test patterns
     new fdecc42  CAMEL-13342: Implemented a first version of a proof-of-concept for camel-cdi-test in junit 5
     new 7c104ae  CAMEL-13342: Implemented a first version of a proof-of-concept for camel-testcontainers with JUnit 5
     new ef72ac9  CAMEL-13342: Implemented a first version of a proof-of-concept for camel-testcontainers-spring with JUnit 5
     new 443c637  CAMEL-13342: Moved further the proof-of-concept for camel-test-spring/CamelSpringTestSupport
     new c2da2eb  CAMEL-13342: Implemented a first version of a proof-of-concept for camel-test-spring/SpringExtension with JUnit 5
     new 73b2c96  CAMEL-13342: Implemented a first version of a proof-of-concept for camel-test-spring/SprintBootTest with JUnit 5

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (44fdd73)
            \
             N -- N -- N   refs/heads/CAMEL-13342-JUNIT5-EXPLORATORY (73b2c96)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 9 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:
 .mvn/jvm.config                                    |    2 +-
 Jenkinsfile                                        |   15 +
 Jenkinsfile.daily                                  |    4 +
 Jenkinsfile.jdk11                                  |    4 +
 Jenkinsfile.jdk12                                  |    4 +
 Jenkinsfile.karaf                                  |    4 +
 Jenkinsfile.karaf.jdk11                            |    4 +
 Jenkinsfile.sb                                     |    4 +
 Jenkinsfile.sb.jdk11                               |    4 +
 MIGRATION.md                                       |    6 +
 .../java/org/apache/camel/maven/ValidateMojo.java  |    2 +-
 .../src/main/docs/activemq-component.adoc          |    9 +-
 .../src/main/docs/ahc-ws-component.adoc            |    2 +-
 .../camel-ahc/src/main/docs/ahc-component.adoc     |    5 +-
 .../apache/camel/component/ahc/BaseAhcTest.java    |   25 +-
 .../camel-amqp/src/main/docs/amqp-component.adoc   |   11 +-
 .../component/amqp/AMQPConnectionDetails.java      |    5 +-
 .../camel-asn1/src/main/docs/asn1-dataformat.adoc  |    2 +-
 .../camel/attachment/DefaultAttachmentMessage.java |   10 -
 .../src/main/docs/aws-ddb-component.adoc           |    6 +-
 .../src/main/docs/aws-ddbstream-component.adoc     |    2 +-
 .../src/main/docs/aws-ec2-component.adoc           |    2 +-
 .../src/main/docs/aws-ecs-component.adoc           |    2 +-
 .../src/main/docs/aws-eks-component.adoc           |    2 +-
 .../src/main/docs/aws-iam-component.adoc           |    2 +-
 .../src/main/docs/aws-kinesis-component.adoc       |    2 +-
 .../main/docs/aws-kinesis-firehose-component.adoc  |    2 +-
 .../src/main/docs/aws-kms-component.adoc           |    2 +-
 .../src/main/docs/aws-lambda-component.adoc        |    2 +-
 .../src/main/docs/aws-mq-component.adoc            |    2 +-
 .../src/main/docs/aws-msk-component.adoc           |    2 +-
 .../src/main/docs/aws-s3-component.adoc            |    2 +-
 .../apache/camel/component/aws/s3/S3Component.java |    1 -
 .../src/main/docs/aws-sdb-component.adoc           |    2 +-
 .../src/main/docs/aws-ses-component.adoc           |    2 +-
 .../src/main/docs/aws-sns-component.adoc           |    2 +-
 .../src/main/docs/aws-sqs-component.adoc           |    2 +-
 .../src/main/docs/aws-swf-component.adoc           |    2 +-
 .../validator/BeanValidatorConfigurationTest.java  |   38 +-
 .../CustomValidationProviderResolverTest.java      |   13 +-
 .../HibernateValidationProviderResolverTest.java   |   14 +-
 .../camel-bean/src/main/docs/bean-language.adoc    |  166 ++
 .../src/main/docs/beanstalk-component.adoc         |    4 +-
 .../camel/blueprint/CamelContextFactoryBean.java   |   10 -
 .../blueprint/handler/CamelNamespaceHandler.java   |    8 +-
 .../CaffeineCacheFromScratchStatsCounterTest.java  |   13 +-
 .../caffeine/cache/CaffeineCacheTestSupport.java   |   16 +-
 .../loadcache/CaffeineLoadCacheTestSupport.java    |   20 +-
 components/camel-cdi/src/main/docs/cdi.adoc        |    2 +-
 .../camel/cdi/xml/CamelContextFactoryBean.java     |   11 -
 .../src/main/docs/cometd-component.adoc            |    2 +-
 ...tParametersInUriCometdProducerConsumerTest.java |   10 +-
 .../src/main/docs/controlbus-component.adoc        |    4 +-
 .../component/corda/CordaConsumerTestSupport.java  |   49 +-
 .../camel/component/corda/CordaTestSupport.java    |    7 -
 .../component/crypto/cms/SpringComponentTest.java  |    5 -
 .../src/main/docs/crypto-component.adoc            |    2 +-
 .../src/main/docs/cxf-transport.adoc               |    5 -
 .../camel-cxf/src/main/docs/cxf-component.adoc     |   19 +-
 .../camel-cxf/src/main/docs/cxfrs-component.adoc   |    7 -
 .../apache/camel/component/cxf/CxfConsumer.java    |   18 +-
 .../camel/component/cxf/CxfConsumerFaultTest.java  |    1 -
 .../cxf/CxfConsumerPayLoadFaultMessageTest.java    |    1 -
 .../cxf/CxfConsumerPayLoadMarshalFaultTest.java    |    1 -
 .../component/cxf/CxfCustomizedExceptionTest.java  |    8 +-
 .../cxf/CxfMessageStreamExceptionTest.java         |    1 -
 .../component/cxf/CxfProducerSessionTest.java      |   17 +-
 .../cxf/CxfSpringCustomizedExceptionTest.java      |   11 +-
 .../CxfRsBindingConfigurationSelectionTest.java    |   12 +-
 .../component/cxf/jaxrs/CxfRsConsumerTest.java     |    2 -
 .../apache/camel/non_wrapper/PersonProcessor.java  |    3 -
 .../apache/camel/wsdl_first/PersonProcessor.java   |    3 -
 .../cxf/CxfCustomizedExceptionContext.xml          |   34 +-
 .../src/main/docs/dataformat-component.adoc        |    6 +-
 .../src/main/docs/dataset-component.adoc           |    2 +-
 .../src/main/docs/dataset-test-component.adoc      |    4 +-
 .../src/main/docs/disruptor-component.adoc         |    2 +-
 .../disruptor/vm/DisruptorVmSplitterTest.java      |   12 +-
 .../ehcache/EhcacheCacheConfigurationTest.java     |   53 +-
 .../ehcache/EhcacheComponentConfigurationTest.java |   12 +-
 .../ehcache/EhcacheConfigurationTest.java          |   12 +-
 .../component/ehcache/EhcacheTestSupport.java      |   11 +-
 .../apache/camel/component/ejb/EjbComponent.java   |    5 +-
 .../camel/component/ejb/EjbRegistryBean.java       |    6 +-
 .../main/docs/elasticsearch-rest-component.adoc    |    5 +-
 .../elasticsearch/ElasticsearchConfiguration.java  |   13 -
 .../elasticsearch/ElasticsearchConstants.java      |    1 -
 .../elasticsearch/ElasticsearchProducer.java       |   11 -
 .../ElasticsearchActionRequestConverter.java       |   12 +-
 .../elasticsearch/ElasticsearchBulkTest.java       |    4 +-
 .../ElasticsearchClusterIndexTest.java             |    6 +-
 ...asticsearchGetSearchDeleteExistsUpdateTest.java |   17 +-
 .../elasticsearch/ElasticsearchIndexTest.java      |    8 +-
 .../ElasticsearchScrollSearchTest.java             |   10 +-
 .../camel-elsql/src/main/docs/elsql-component.adoc |    2 +-
 .../camel/component/elsql/ElSqlComponentTest.java  |   27 +-
 .../elsql/ElSqlConsumerDynamicParameterTest.java   |   26 +-
 .../camel/component/elsql/ElSqlConsumerTest.java   |   21 +-
 .../camel/component/elsql/ElSqlDataSourceTest.java |   27 +-
 .../component/elsql/ElSqlProducerBatchTest.java    |   45 +-
 .../elsql/ElSqlProducerBodySimpleTest.java         |   45 +-
 .../elsql/ElSqlProducerStreamListTest.java         |   47 +-
 .../camel/component/exec/ExecJavaProcessTest.java  |   14 +-
 .../src/main/docs/facebook-component.adoc          |    2 +-
 .../config/FacebookEndpointConfigurationTest.java  |   11 +-
 .../fhir/FhirCustomClientConfigurationIT.java      |   16 +-
 .../camel-file/src/main/docs/file-component.adoc   |   28 +-
 .../main/docs/google-bigquery-sql-component.adoc   |    2 +-
 .../camel-grape/src/main/docs/grape-component.adoc |    2 +-
 .../src/main/docs/groovy-language.adoc             |    5 +-
 .../src/main/docs/hipchat-component.adoc           |    2 +-
 .../camel-http4/src/main/docs/http4-component.adoc |    2 +-
 components/camel-ignite/src/main/docs/ignite.adoc  |    2 +-
 .../component/infinispan/InfinispanConsumer.java   |    6 +-
 .../component/infinispan/InfinispanEndpoint.java   |   20 +-
 .../component/infinispan/InfinispanProducer.java   |   24 +-
 .../camel-irc/src/main/docs/irc-component.adoc     |    2 +-
 components/camel-jasypt/src/main/docs/jasypt.adoc  |    2 +-
 .../SplitterAndExceptionRouteTwistIssueTest.java   |    2 -
 .../src/main/docs/jcache-component.adoc            |    2 +-
 .../camel-jdbc/src/main/docs/jdbc-component.adoc   |    2 +-
 .../camel-jetty/src/main/docs/jetty-component.adoc |   12 +-
 .../camel/component/jetty/HttpReturnFaultTest.java |   58 -
 .../camel/component/jetty/HttpRouteTest.java       |    1 -
 .../camel-jms/src/main/docs/jms-component.adoc     |   16 +-
 .../component/jms/EndpointMessageListener.java     |    7 -
 .../org/apache/camel/component/jms/JmsBinding.java |   11 +-
 .../apache/camel/component/jms/JmsComponent.java   |   18 -
 .../camel/component/jms/JmsConfiguration.java      |   23 -
 .../apache/camel/component/jms/JmsConstants.java   |    1 -
 .../apache/camel/component/jms/JmsEndpoint.java    |   10 -
 .../org/apache/camel/component/jms/JmsMessage.java |    1 -
 .../component/jms/reply/ReplyManagerSupport.java   |   11 -
 .../jms/JmsRequestReplyCorrelationTest.java        |   30 +-
 .../camel/component/jms/JmsTransferFaultTest.java  |   90 -
 .../SetFaultBodyAfterJmsRequestReplyIssueTest.java |   86 -
 .../jms/issues/BruceHandlingBeanExceptionTest.java |   10 +-
 .../src/main/docs/jsonpath-language.adoc           |    2 +-
 .../docs/kubernetes-config-maps-component.adoc     |    2 +-
 .../docs/kubernetes-deployments-component.adoc     |    2 +-
 .../src/main/docs/kubernetes-hpa-component.adoc    |    2 +-
 .../src/main/docs/kubernetes-job-component.adoc    |    2 +-
 .../main/docs/kubernetes-namespaces-component.adoc |    2 +-
 .../src/main/docs/kubernetes-nodes-component.adoc  |    2 +-
 ...rnetes-persistent-volumes-claims-component.adoc |    2 +-
 .../kubernetes-persistent-volumes-component.adoc   |    2 +-
 .../src/main/docs/kubernetes-pods-component.adoc   |    2 +-
 ...bernetes-replication-controllers-component.adoc |    2 +-
 .../docs/kubernetes-resources-quota-component.adoc |    2 +-
 .../main/docs/kubernetes-secrets-component.adoc    |    2 +-
 .../kubernetes-service-accounts-component.adoc     |    2 +-
 .../main/docs/kubernetes-services-component.adoc   |    2 +-
 .../src/main/docs/openshift-builds-component.adoc  |    2 +-
 .../src/main/docs/language-component.adoc          |    6 +-
 .../camel/component/language/LanguageEndpoint.java |    6 +-
 .../component/lucene/LuceneQueryProducer.java      |    3 +-
 .../camel/component/lucene/LuceneSearcher.java     |   12 +-
 .../processor/lucene/LuceneQueryProcessor.java     |   30 +-
 .../processor/lucene/LuceneQueryProcessorTest.java |    4 +-
 .../camel-mail/src/main/docs/mail-component.adoc   |    2 +-
 .../apache/camel/component/mail/MailMessage.java   |    1 -
 .../src/main/docs/micrometer-component.adoc        |    2 +-
 .../org/apache/camel/component/milo/Messages.java  |    1 -
 .../camel-mina2/src/main/docs/mina2-component.adoc |    4 +-
 .../mina2/Mina2TransferExchangeOptionTest.java     |    9 +-
 .../mina2/Mina2VMTransferExchangeOptionTest.java   |    9 +-
 .../camel-mock/src/main/docs/mock-component.adoc   |    4 +-
 .../src/main/docs/mongodb3-component.adoc          |    6 +-
 .../camel/component/mongodb3/MongoDbComponent.java |   27 +-
 .../component/mongodb3/MongoDbTailingThread.java   |   32 +-
 .../mongodb3/MongoDbConnectionBeansTest.java       |   14 +-
 .../MongoDbTailableCursorConsumerTest.java         |    4 -
 .../camel-mvel/src/main/docs/mvel-language.adoc    |    2 +-
 .../src/main/docs/nagios-component.adoc            |    2 +-
 .../src/main/docs/netty4-http-component.adoc       |    2 +-
 .../netty4/http/NettyHttpReturnFaultTest.java      |   58 -
 .../src/main/docs/netty4-component.adoc            |    4 +-
 .../netty4/NettyTransferExchangeOptionTest.java    |    9 +-
 .../camel-ognl/src/main/docs/ognl-language.adoc    |    2 +-
 components/camel-openstack/pom.xml                 |   16 +
 .../cinder/producer/SnapshotProducer.java          |    4 +-
 .../openstack/cinder/producer/VolumeProducer.java  |    4 +-
 .../common/AbstractOpenstackProducer.java          |    5 +-
 .../openstack/common/OpenstackException.java}      |   15 +-
 .../common/OpenstackOperationException.java}       |   32 +-
 .../component/openstack/glance/GlanceProducer.java |    2 +-
 .../keystone/producer/DomainProducer.java          |    2 +-
 .../openstack/keystone/producer/GroupProducer.java |    6 +-
 .../keystone/producer/ProjectProducer.java         |    2 +-
 .../keystone/producer/RegionProducer.java          |    2 +-
 .../openstack/keystone/producer/UserProducer.java  |    2 +-
 .../neutron/producer/NetworkProducer.java          |    2 +-
 .../openstack/neutron/producer/PortProducer.java   |    2 +-
 .../openstack/neutron/producer/RouterProducer.java |    2 +-
 .../openstack/neutron/producer/SubnetProducer.java |    2 +-
 .../openstack/nova/producer/FlavorsProducer.java   |    2 +-
 .../openstack/nova/producer/KeypairProducer.java   |    2 +-
 .../openstack/nova/producer/ServerProducer.java    |    4 +-
 .../swift/producer/ContainerProducer.java          |   13 +-
 .../openstack/swift/producer/ObjectProducer.java   |    7 +-
 .../openstack/cinder/VolumeProducerTest.java       |   19 -
 .../cinder/VolumeSnapshotProducerTest.java         |    2 -
 .../openstack/keystone/DomainProducerTest.java     |    8 -
 .../openstack/keystone/GroupProducerTest.java      |    8 -
 .../openstack/keystone/ProjectProducerTest.java    |    8 -
 .../openstack/keystone/RegionProducerTest.java     |    8 -
 .../openstack/keystone/UserProducerTest.java       |    8 -
 .../openstack/neutron/NetworkProducerTest.java     |    8 -
 .../openstack/neutron/PortProducerTest.java        |    8 -
 .../openstack/neutron/RouterProducerTest.java      |    8 -
 .../openstack/neutron/SubnetProducerTest.java      |    8 -
 .../openstack/nova/FlavorProducerTest.java         |    4 -
 .../openstack/nova/ServerProducerTest.java         |    8 -
 .../openstack/swift/ContainerProducerTest.java     |   18 -
 .../openstack/swift/ObjectProducerTest.java        |   18 -
 .../src/test/resources/log4j2.properties           |   28 +
 .../camel-paho/src/main/docs/paho-component.adoc   |    2 +-
 .../src/main/docs/properties-component.adoc        |   22 +-
 .../properties/DefaultPropertiesParser.java        |   28 +-
 .../component/properties/PropertiesComponent.java  |   48 +-
 .../component/properties/PropertiesParser.java     |    7 +-
 components/camel-pulsar/pom.xml                    |   65 -
 .../src/main/docs/quartz2-component.adoc           |    2 +-
 .../src/main/docs/rest-swagger-component.adoc      |    4 +-
 .../camel-rest/src/main/docs/rest-component.adoc   |    4 +-
 .../component/restlet/DefaultRestletBinding.java   |   18 +-
 .../camel/component/restlet/RestletFaultTest.java  |   52 -
 .../src/main/docs/sap-netweaver-component.adoc     |    2 +-
 .../src/main/docs/xquery-component.adoc            |    4 +-
 .../camel-saxon/src/main/docs/xquery-language.adoc |    4 +-
 .../src/main/docs/scheduler-component.adoc         |    2 +-
 .../src/main/docs/servicenow-component.adoc        |   60 +-
 .../src/main/docs/servlet-component.adoc           |   19 +-
 .../apache/camel/component/sjms/SjmsMessage.java   |    1 -
 .../sjms/tx/TransactedConsumerSupport.java         |    2 +-
 .../sjms/tx/TransactedQueueProducerTest.java       |   12 +-
 .../sjms/tx/TransactedTopicProducerTest.java       |   10 +-
 .../camel-solr/src/main/docs/solr-component.adoc   |    2 +-
 .../src/main/docs/spring-boot.adoc                 |    5 +-
 .../spring/boot/CamelConfigurationProperties.java  |    7 -
 .../spring/boot/mockendpoints/AdviceWithTest.java  |   11 +-
 .../MockEndpointsAndSkipDirtiesContextTest.java    |    9 +-
 .../boot/mockendpoints/MockEndpointsTest.java      |    9 +-
 .../camel/spring/boot/routefilter/BarTest.java     |    7 +-
 .../routefilter/FooExcludeRouteAnnotationTest.java |    9 +-
 .../camel/spring/boot/routefilter/FooTest.java     |    7 +-
 .../integration/adapter/CamelTargetAdapter.java    |    4 -
 .../camel-spring/src/main/docs/spel-language.adoc  |    4 +-
 .../src/main/docs/spring-event-component.adoc      |    4 +-
 components/camel-spring/src/main/docs/spring.adoc  |   24 +-
 .../camel/spring/CamelContextFactoryBean.java      |   13 -
 .../spi/BridgePropertyPlaceholderConfigurer.java   |   10 +-
 .../properties/SpringPropertiesComponent2Test.java |   29 -
 .../camel/spring/CamelContextFactoryBeanTest.java  |    2 -
 .../camel/spring/SpringConsumerTemplateTest.java   |    4 +-
 .../spring/processor/SpringSetFaultBodyTest.java   |   46 -
 .../properties/SpringPropertiesComponent2Test.xml  |   56 -
 .../spring/SpringConsumerTemplateTest-context.xml  |    6 +-
 .../apache/camel/spring/processor/faultRoute.xml   |   37 -
 .../src/main/docs/syslog-dataformat.adoc           |    2 +-
 .../camel-test-cdi/src/main/docs/test-cdi.adoc     |    6 +-
 .../src/main/docs/test-spring.adoc                 |   20 +-
 .../spring/CamelSpringBootExecutionListener.java   |   10 +
 ...utionListener.java => CamelSpringBootTest.java} |   32 +-
 ...ringTestContextLoaderTestExecutionListener.java |    9 +-
 .../spring/DisableJmxTestExecutionListener.java    |   10 +
 .../spring/StopWatchTestExecutionListener.java     |   10 +
 components/camel-testcontainers-spring/pom.xml     |   83 -
 .../spring/ContainerAwareSpringTestSupport.java    |    3 +
 components/camel-testcontainers/pom.xml            |   81 -
 .../src/main/docs/testcontainers.adoc              |    4 +-
 .../testcontainers/ContainerAwareTestSupport.java  |    3 +
 .../camel-timer/src/main/docs/timer-component.adoc |    6 +-
 .../camel-twitter/src/main/docs/twitter.adoc       |    5 -
 .../src/main/docs/undertow-component.adoc          |    4 +-
 .../component/undertow/UndertowClientCallback.java |   18 +-
 .../camel/component/undertow/UndertowProducer.java |   13 +-
 .../undertow/UndertowStreamingClientCallback.java  |   26 +-
 .../undertow/UndertowHttpStreamingTest.java        |  119 +
 .../src/main/docs/univocity-csv-dataformat.adoc    |    2 +-
 .../src/main/docs/univocity-fixed-dataformat.adoc  |    2 +-
 .../src/main/docs/univocity-tsv-dataformat.adoc    |    2 +-
 .../src/main/docs/websocket-component.adoc         |    2 +-
 .../src/main/docs/xmlsecurity-component.adoc       |    2 +-
 .../camel-xpath/src/main/docs/xpath-language.adoc  |    6 +-
 .../camel-xslt/src/main/docs/xslt-component.adoc   |    2 +-
 .../aggregate/zipfile/ZipAggregationStrategy.java  |  143 +-
 .../AggregationStrategyWithFilenameHeaderTest.java |   13 +-
 .../AggregationStrategyWithPreservationTest.java   |   28 +-
 .../ZipAggregationStrategyEmptyFileTest.java       |   16 +-
 .../zipfile/ZipAggregationStrategyTest.java        |   15 +-
 components/camel-zipkin/src/main/docs/zipkin.adoc  |    4 +-
 .../main/java/org/apache/camel/CamelContext.java   |   16 -
 .../src/main/java/org/apache/camel/Exchange.java   |    2 -
 .../java/org/apache/camel/ExchangePattern.java     |   12 -
 .../src/main/java/org/apache/camel/Message.java    |   14 -
 .../org/apache/camel/RuntimeConfiguration.java     |   14 -
 .../java/org/apache/camel/StartupListener.java     |   11 +-
 .../org/apache/camel/spi/PropertiesComponent.java  |   20 +-
 .../java/org/apache/camel/spi/Synchronization.java |    3 +-
 core/camel-base/src/main/docs/file-language.adoc   |    4 +-
 core/camel-base/src/main/docs/simple-language.adoc |   16 +-
 .../camel/impl/engine/AbstractCamelContext.java    |   56 +-
 .../impl/engine/CamelPostProcessorHelper.java      |    5 +-
 .../impl/engine/DefaultCamelBeanPostProcessor.java |    3 +-
 .../camel/impl/engine/DefaultRouteContext.java     |   14 -
 .../camel/processor/CamelInternalProcessor.java    |   43 +-
 .../apache/camel/processor/FinallyProcessor.java   |   26 +-
 .../camel/processor/OnCompletionProcessor.java     |   13 -
 .../org/apache/camel/processor/PipelineHelper.java |   14 -
 .../camel/processor/channel/DefaultChannel.java    |   18 +-
 .../processor/interceptor/BacklogDebugger.java     |    4 -
 .../apache/camel/processor/interceptor/Debug.java  |   74 -
 .../processor/interceptor/DefaultDebugger.java     |    4 +-
 .../camel/processor/interceptor/HandleFault.java   |   59 -
 .../interceptor/HandleFaultInterceptor.java        |   81 -
 .../caffeine/lrucache/CaffeineLRUCache.java        |   14 +
 .../caffeine/lrucache/CaffeineLRUSoftCache.java    |    4 +-
 .../caffeine/lrucache/CaffeineLRUWeakCache.java    |    4 +-
 .../core/xml/AbstractCamelContextFactoryBean.java  |   14 -
 .../xml/CamelPropertyPlaceholderDefinition.java    |   28 -
 core/camel-core/readme-eip.adoc                    |    5 +-
 .../src/main/docs/eips/aggregate-eip.adoc          |    2 +-
 core/camel-core/src/main/docs/eips/bean-eip.adoc   |    8 +-
 core/camel-core/src/main/docs/eips/choice-eip.adoc |    2 +-
 .../src/main/docs/eips/claimCheck-eip.adoc         |    2 +-
 .../main/docs/eips/content-based-router-eip.adoc   |   14 +-
 .../src/main/docs/eips/content-filter-eip.adoc     |   32 +-
 .../src/main/docs/eips/dynamic-router.adoc         |    6 +-
 .../src/main/docs/eips/dynamicRouter-eip.adoc      |    2 +-
 core/camel-core/src/main/docs/eips/enrich-eip.adoc |    3 +-
 .../main/docs/eips/eventDrivenConsumer-eip.adoc    |   26 +-
 core/camel-core/src/main/docs/eips/filter-eip.adoc |   10 +-
 .../src/main/docs/eips/idempotentConsumer-eip.adoc |   18 +-
 core/camel-core/src/main/docs/eips/log-eip.adoc    |    6 +-
 .../camel-core/src/main/docs/eips/process-eip.adoc |    2 +-
 .../src/main/docs/eips/requestReply-eip.adoc       |    4 +-
 core/camel-core/src/main/docs/eips/script-eip.adoc |    2 +-
 .../src/main/docs/eips/setFaultBody-eip.adoc       |   39 -
 core/camel-core/src/main/docs/eips/step-eip.adoc   |    2 +-
 core/camel-core/src/main/docs/eips/toD-eip.adoc    |    6 +-
 .../src/main/docs/eips/unmarshal-eip.adoc          |    6 +-
 .../camel-core/src/main/docs/eips/wireTap-eip.adoc |   12 +-
 .../apache/camel/model/ProcessorDefinition.java    |   12 -
 .../camel/model/ProcessorDefinitionHelper.java     |    8 +-
 .../org/apache/camel/model/RouteDefinition.java    |   36 -
 .../apache/camel/model/SetFaultBodyDefinition.java |   64 -
 .../org/apache/camel/reifier/ProcessorReifier.java |   13 +-
 .../org/apache/camel/reifier/RouteReifier.java     |   16 -
 .../apache/camel/reifier/SetFaultBodyReifier.java  |   40 -
 .../java/org/apache/camel/CamelExceptionsTest.java |    4 -
 .../camel/builder/FluentProducerTemplateTest.java  |   21 -
 .../properties/PropertiesComponentTest.java        |   30 -
 .../org/apache/camel/impl/DefaultExchangeTest.java |   18 -
 .../camel/impl/DefaultProducerTemplateTest.java    |   20 -
 .../apache/camel/issues/OnCompletionIssueTest.java |    6 +-
 .../processor/ExceptionHandlerStreamCacheTest.java |   20 +-
 .../FailOverLoadBalancerSetFaultTest.java          |    2 -
 .../FaultRetryRouteNewConfigurationTest.java       |   43 -
 .../camel/processor/FaultRetryRouteTest.java       |   83 -
 .../org/apache/camel/processor/FaultRouteTest.java |   91 -
 .../camel/processor/HandleFaultPerRouteTest.java   |   88 -
 .../org/apache/camel/processor/PipelineTest.java   |   36 -
 .../RedeliverWithExceptionAndFaultTest.java        |   98 -
 ...deliveryWithExceptionAndFaultDelayInHeader.java |   97 -
 .../org/apache/camel/processor/TransformTest.java  |    4 +-
 .../camel/processor/TransformViaDSLTest.java       |    4 +-
 .../camel/processor/TrySetFaultFinallyTest.java    |   54 -
 .../apache/camel/processor/TrySetFaultTest.java    |   70 -
 .../UnitOfWorkSynchronizationAdapterTest.java      |    6 +-
 .../org/apache/camel/processor/UnitOfWorkTest.java |   19 +-
 .../async/AsyncEndpointWithHandleFaultTest.java    |   82 -
 .../camel/processor/enricher/EnricherTest.java     |   34 +-
 .../camel/processor/enricher/FailureProcessor.java |   17 +-
 .../camel/processor/enricher/PollEnricherTest.java |    1 -
 .../endpoint/dsl/AMQPEndpointBuilderFactory.java   |  118 -
 .../dsl/ActiveMQEndpointBuilderFactory.java        |  120 -
 .../dsl/ElasticsearchEndpointBuilderFactory.java   |   11 -
 .../endpoint/dsl/JmsEndpointBuilderFactory.java    |  118 -
 .../camel/main/DefaultConfigurationConfigurer.java |    6 -
 .../camel/main/DefaultConfigurationProperties.java |   24 -
 .../camel-main-configuration-metadata.json         |    6 -
 .../management/ManagedCustomProcessorTest.java     |    4 +-
 .../org/apache/camel/support/DefaultExchange.java  |    7 +-
 .../camel/support/DefaultExchangeHolder.java       |   14 -
 .../org/apache/camel/support/DefaultMessage.java   |    9 -
 .../org/apache/camel/support/ExchangeHelper.java   |   20 +-
 .../apache/camel/support/IntrospectionSupport.java |    4 +-
 .../org/apache/camel/support/MessageSupport.java   |    1 -
 .../camel/support/builder/ExpressionBuilder.java   |   37 +-
 docs/components/modules/ROOT/nav.adoc              |    1 +
 .../modules/ROOT/pages/activemq-component.adoc     |    9 +-
 .../modules/ROOT/pages/ahc-component.adoc          |    5 +-
 .../modules/ROOT/pages/ahc-ws-component.adoc       |    2 +-
 .../modules/ROOT/pages/amqp-component.adoc         |   11 +-
 .../modules/ROOT/pages/asn1-dataformat.adoc        |    2 +-
 .../modules/ROOT/pages/aws-ddb-component.adoc      |    6 +-
 .../ROOT/pages/aws-ddbstream-component.adoc        |    2 +-
 .../modules/ROOT/pages/aws-ec2-component.adoc      |    2 +-
 .../modules/ROOT/pages/aws-ecs-component.adoc      |    2 +-
 .../modules/ROOT/pages/aws-eks-component.adoc      |    2 +-
 .../modules/ROOT/pages/aws-iam-component.adoc      |    2 +-
 .../modules/ROOT/pages/aws-kinesis-component.adoc  |    2 +-
 .../ROOT/pages/aws-kinesis-firehose-component.adoc |    2 +-
 .../modules/ROOT/pages/aws-kms-component.adoc      |    2 +-
 .../modules/ROOT/pages/aws-lambda-component.adoc   |    2 +-
 .../modules/ROOT/pages/aws-mq-component.adoc       |    2 +-
 .../modules/ROOT/pages/aws-msk-component.adoc      |    2 +-
 .../modules/ROOT/pages/aws-s3-component.adoc       |    2 +-
 .../modules/ROOT/pages/aws-sdb-component.adoc      |    2 +-
 .../modules/ROOT/pages/aws-ses-component.adoc      |    2 +-
 .../modules/ROOT/pages/aws-sns-component.adoc      |    2 +-
 .../modules/ROOT/pages/aws-sqs-component.adoc      |    2 +-
 .../modules/ROOT/pages/aws-swf-component.adoc      |    2 +-
 .../modules/ROOT/pages/bean-language.adoc          |  166 ++
 .../modules/ROOT/pages/beanstalk-component.adoc    |    4 +-
 docs/components/modules/ROOT/pages/cdi.adoc        |    2 +-
 .../modules/ROOT/pages/cometd-component.adoc       |    2 +-
 .../modules/ROOT/pages/controlbus-component.adoc   |    4 +-
 .../modules/ROOT/pages/crypto-component.adoc       |    2 +-
 .../modules/ROOT/pages/cxf-component.adoc          |   19 +-
 .../modules/ROOT/pages/cxf-transport.adoc          |    5 -
 .../modules/ROOT/pages/cxfrs-component.adoc        |    7 -
 .../modules/ROOT/pages/dataformat-component.adoc   |    6 +-
 .../modules/ROOT/pages/dataset-component.adoc      |    2 +-
 .../modules/ROOT/pages/dataset-test-component.adoc |    4 +-
 .../modules/ROOT/pages/disruptor-component.adoc    |    2 +-
 .../ROOT/pages/elasticsearch-rest-component.adoc   |    5 +-
 .../modules/ROOT/pages/elsql-component.adoc        |    2 +-
 .../modules/ROOT/pages/facebook-component.adoc     |    2 +-
 .../modules/ROOT/pages/file-component.adoc         |   28 +-
 .../ROOT/pages/google-bigquery-sql-component.adoc  |    2 +-
 .../modules/ROOT/pages/grape-component.adoc        |    2 +-
 .../modules/ROOT/pages/groovy-language.adoc        |    5 +-
 .../modules/ROOT/pages/hipchat-component.adoc      |    2 +-
 .../modules/ROOT/pages/http4-component.adoc        |    2 +-
 docs/components/modules/ROOT/pages/ignite.adoc     |    2 +-
 .../modules/ROOT/pages/irc-component.adoc          |    2 +-
 docs/components/modules/ROOT/pages/jasypt.adoc     |    2 +-
 .../modules/ROOT/pages/jcache-component.adoc       |    2 +-
 .../modules/ROOT/pages/jdbc-component.adoc         |    2 +-
 .../modules/ROOT/pages/jetty-component.adoc        |   12 +-
 .../modules/ROOT/pages/jms-component.adoc          |   16 +-
 .../modules/ROOT/pages/jsonpath-language.adoc      |    2 +-
 .../pages/kubernetes-config-maps-component.adoc    |    2 +-
 .../pages/kubernetes-deployments-component.adoc    |    2 +-
 .../ROOT/pages/kubernetes-hpa-component.adoc       |    2 +-
 .../ROOT/pages/kubernetes-job-component.adoc       |    2 +-
 .../pages/kubernetes-namespaces-component.adoc     |    2 +-
 .../ROOT/pages/kubernetes-nodes-component.adoc     |    2 +-
 ...rnetes-persistent-volumes-claims-component.adoc |    2 +-
 .../kubernetes-persistent-volumes-component.adoc   |    2 +-
 .../ROOT/pages/kubernetes-pods-component.adoc      |    2 +-
 ...bernetes-replication-controllers-component.adoc |    2 +-
 .../kubernetes-resources-quota-component.adoc      |    2 +-
 .../ROOT/pages/kubernetes-secrets-component.adoc   |    2 +-
 .../kubernetes-service-accounts-component.adoc     |    2 +-
 .../ROOT/pages/kubernetes-services-component.adoc  |    2 +-
 .../modules/ROOT/pages/language-component.adoc     |    6 +-
 .../modules/ROOT/pages/mail-component.adoc         |    2 +-
 .../modules/ROOT/pages/micrometer-component.adoc   |    2 +-
 .../modules/ROOT/pages/mina2-component.adoc        |    4 +-
 .../modules/ROOT/pages/mock-component.adoc         |    4 +-
 .../modules/ROOT/pages/mongodb3-component.adoc     |    6 +-
 .../modules/ROOT/pages/mvel-language.adoc          |    2 +-
 .../modules/ROOT/pages/nagios-component.adoc       |    2 +-
 .../modules/ROOT/pages/netty4-component.adoc       |    4 +-
 .../modules/ROOT/pages/netty4-http-component.adoc  |    2 +-
 .../modules/ROOT/pages/ognl-language.adoc          |    2 +-
 .../ROOT/pages/openshift-builds-component.adoc     |    2 +-
 .../modules/ROOT/pages/paho-component.adoc         |    2 +-
 .../modules/ROOT/pages/properties-component.adoc   |   22 +-
 .../modules/ROOT/pages/quartz2-component.adoc      |    2 +-
 .../modules/ROOT/pages/rest-component.adoc         |    4 +-
 .../modules/ROOT/pages/rest-swagger-component.adoc |    4 +-
 .../ROOT/pages/sap-netweaver-component.adoc        |    2 +-
 .../modules/ROOT/pages/scheduler-component.adoc    |    2 +-
 .../modules/ROOT/pages/servicenow-component.adoc   |   60 +-
 .../modules/ROOT/pages/servlet-component.adoc      |   19 +-
 .../modules/ROOT/pages/solr-component.adoc         |    2 +-
 .../modules/ROOT/pages/spel-language.adoc          |    4 +-
 .../components/modules/ROOT/pages/spring-boot.adoc |    5 +-
 .../modules/ROOT/pages/spring-event-component.adoc |    4 +-
 docs/components/modules/ROOT/pages/spring.adoc     |   24 +-
 .../modules/ROOT/pages/syslog-dataformat.adoc      |    2 +-
 docs/components/modules/ROOT/pages/test-cdi.adoc   |    6 +-
 .../components/modules/ROOT/pages/test-spring.adoc |   20 +-
 .../modules/ROOT/pages/testcontainers.adoc         |    4 +-
 .../modules/ROOT/pages/timer-component.adoc        |    6 +-
 docs/components/modules/ROOT/pages/twitter.adoc    |    5 -
 .../modules/ROOT/pages/undertow-component.adoc     |    4 +-
 .../ROOT/pages/univocity-csv-dataformat.adoc       |    2 +-
 .../ROOT/pages/univocity-fixed-dataformat.adoc     |    2 +-
 .../ROOT/pages/univocity-tsv-dataformat.adoc       |    2 +-
 .../modules/ROOT/pages/websocket-component.adoc    |    2 +-
 .../modules/ROOT/pages/xmlsecurity-component.adoc  |    2 +-
 .../modules/ROOT/pages/xpath-language.adoc         |    6 +-
 .../modules/ROOT/pages/xquery-component.adoc       |    4 +-
 .../modules/ROOT/pages/xquery-language.adoc        |    4 +-
 .../modules/ROOT/pages/xslt-component.adoc         |    2 +-
 docs/components/modules/ROOT/pages/zipkin.adoc     |    4 +-
 docs/package.json                                  |    2 +
 docs/pom.xml                                       |   23 +-
 docs/site.yml                                      |   15 +
 docs/user-manual-nav.adoc.template                 |   10 +-
 docs/user-manual/en/README.md                      |    7 -
 docs/user-manual/en/apache.css                     | 2464 --------------------
 docs/user-manual/en/book.json                      |   15 -
 .../apache-spark.data/camel_spark_cluster.png      |  Bin 172359 -> 0 bytes
 .../apache-spark.data/camel_spark_driver.png       |  Bin 293927 -> 0 bytes
 .../images/apache-spark.data/fabric_docker-(2).png |  Bin 37481 -> 0 bytes
 .../images/architecture.data/camel-components.png  |  Bin 229901 -> 0 bytes
 .../images/async.data/camel_async_request_only.png |  Bin 59864 -> 0 bytes
 .../async.data/camel_async_request_reply.png       |  Bin 64513 -> 0 bytes
 .../images/async.data/camel_sync_request_only.png  |  Bin 59351 -> 0 bytes
 .../images/async.data/camel_sync_request_reply.png |  Bin 61299 -> 0 bytes
 .../en/images/barcode-data-format.data/qr-code.png |  Bin 307 -> 0 bytes
 .../camel-eclipse-m2e-import-completed.png         |  Bin 73775 -> 0 bytes
 .../building.data/camel-eclipse-m2e-import.png     |  Bin 39095 -> 0 bytes
 .../en/images/camel-core.data/architecture.png     |  Bin 7767 -> 0 bytes
 .../architecture_incl_violations.png               |  Bin 23733 -> 0 bytes
 docs/user-manual/en/images/camel-logo.png          |  Bin 22001 -> 0 bytes
 docs/user-manual/en/images/debugger.data/debug.png |  Bin 212850 -> 0 bytes
 .../en/images/direct-vm.data/camel-direct-vm.png   |  Bin 129236 -> 0 bytes
 .../download.data/camel-box-v1.0-150x200.png       |  Bin 93934 -> 0 bytes
 .../enterprise-integration-patterns.data/clear.png |  Bin 26517 -> 0 bytes
 .../en/images/lifecycle.data/service_lifecycle.png |  Bin 35951 -> 0 bytes
 docs/user-manual/en/notice.md                      |   17 -
 .../en/release-notes/camel-2170-release.adoc       |  441 ----
 .../en/release-notes/camel-2171-release.adoc       |   44 -
 .../en/release-notes/camel-2172-release.adoc       |   45 -
 .../en/release-notes/camel-2173-release.adoc       |   44 -
 .../en/release-notes/camel-2174-release.adoc       |   43 -
 .../en/release-notes/camel-2175-release.adoc       |   43 -
 .../en/release-notes/camel-2176-release.adoc       |   43 -
 .../en/release-notes/camel-2177-release.adoc       |   39 -
 .../en/release-notes/camel-2180-release.adoc       |  370 ---
 .../en/release-notes/camel-2181-release.adoc       |   43 -
 .../en/release-notes/camel-2182-release.adoc       |   45 -
 .../en/release-notes/camel-2183-release.adoc       |   43 -
 .../en/release-notes/camel-2184-release.adoc       |   39 -
 .../en/release-notes/camel-2185-release.adoc       |   39 -
 .../en/release-notes/camel-2190-release.adoc       |  317 ---
 .../en/release-notes/camel-2191-release.adoc       |   40 -
 .../en/release-notes/camel-2192-release.adoc       |   39 -
 .../en/release-notes/camel-2193-release.adoc       |   39 -
 .../en/release-notes/camel-2194-release.adoc       |   39 -
 .../en/release-notes/camel-2195-release.adoc       |   39 -
 .../en/release-notes/camel-2200-release.adoc       |  271 ---
 .../en/release-notes/camel-2201-release.adoc       |   40 -
 .../en/release-notes/camel-2202-release.adoc       |   40 -
 .../en/release-notes/camel-2203-release.adoc       |   40 -
 .../en/release-notes/camel-2204-release.adoc       |   40 -
 .../en/release-notes/camel-2210-release.adoc       |  209 --
 .../en/release-notes/camel-2211-release.adoc       |   40 -
 .../en/release-notes/camel-2212-release.adoc       |   40 -
 .../en/release-notes/camel-2223-release.adoc       |   40 -
 .../en/release-notes/camel-2224-release.adoc       |   40 -
 .../en/release-notes/camel-2225-release.adoc       |   40 -
 .../en/release-notes/camel-2230-release.adoc       |   85 -
 .../en/release-notes/camel-2231-release.adoc       |   40 -
 .../en/release-notes/camel-2232-release.adoc       |   40 -
 .../en/release-notes/camel-2233-release.adoc       |   40 -
 .../en/release-notes/camel-2240-release.adoc       |   31 -
 .../attachments/Hohpe_EIP_camel_20150622.zip       |  Bin 0 -> 200378 bytes
 .../attachments/Hohpe_EIP_camel_OpenOffice.zip     |  Bin 0 -> 72094 bytes
 .../camel/spring/SpringConsumerTemplateTest.java   |    4 +-
 .../spring/SpringConsumerTemplateTest-context.xml  |   22 +-
 .../org/apache/camel/processor/TransformTest.java  |    4 +-
 .../camel/processor/TransformViaDSLTest.java       |   38 +-
 .../management/ManagedCustomProcessorTest.java     |    4 +-
 .../resources/META-INF/spring/camel-context.xml    |   39 +-
 .../example/jmstofile/CamelJmsToFileExample.java   |   20 +-
 docs/user-manual/modules/ROOT/nav.adoc             |   11 +-
 ...configuration-of-camelcontext-using-spring.adoc |  237 ++
 .../modules/ROOT/pages/aggregate-eip.adoc          |    2 +-
 .../modules/ROOT/pages/architecture.adoc           |    2 +-
 docs/user-manual/modules/ROOT/pages/async.adoc     |   45 +-
 .../ROOT/pages/asynchronous-routing-engine.adoc    |   40 +-
 .../modules/ROOT/pages/backlog-tracer.adoc         |    7 +-
 .../modules/ROOT/pages/backlogdebugger.adoc        |    2 +-
 .../modules/ROOT/pages/bam-example.adoc            |    8 +-
 .../modules/ROOT/pages/batch-consumer.adoc         |   21 +-
 .../modules/ROOT/pages/bean-binding.adoc           |  400 ++++
 docs/user-manual/modules/ROOT/pages/bean-eip.adoc  |    8 +-
 .../modules/ROOT/pages/bean-injection.adoc         |   54 +
 .../modules/ROOT/pages/bean-integration.adoc       |    6 +-
 docs/user-manual/modules/ROOT/pages/binding.adoc   |    2 +-
 .../modules/ROOT/pages/browsable-endpoint.adoc     |    8 +-
 .../user-manual/modules/ROOT/pages/camel-boot.adoc |    6 +-
 .../ROOT/pages/camel-configuration-utilities.adoc  |   18 +-
 .../ROOT/pages/camel-embedded-maven-goal.adoc      |   14 +
 .../modules/ROOT/pages/camel-maven-archetypes.adoc |  137 ++
 .../modules/ROOT/pages/camel-maven-plugin.adoc     |  129 +
 .../modules/ROOT/pages/camel-run-maven-goal.adoc   |  188 ++
 docs/user-manual/modules/ROOT/pages/cep.adoc       |    3 -
 .../user-manual/modules/ROOT/pages/choice-eip.adoc |    2 +-
 .../modules/ROOT/pages/claimCheck-eip.adoc         |    2 +-
 docs/user-manual/modules/ROOT/pages/component.adoc |    9 -
 .../modules/ROOT/pages/configuring-camel.adoc      |    4 +-
 ...ing-route-startup-ordering-and-autostartup.adoc |    4 +-
 .../modules/ROOT/pages/console-example.adoc        |   52 +
 .../ROOT/pages/content-based-router-eip.adoc       |   14 +-
 .../modules/ROOT/pages/content-enricher.adoc       |  518 ++++
 .../modules/ROOT/pages/content-filter-eip.adoc     |   32 +-
 .../modules/ROOT/pages/contributing.adoc           |  185 ++
 .../modules/ROOT/pages/correlation-identifier.adoc |   12 +-
 .../creating-a-new-spring-based-camel-route.adoc   |   37 +
 .../ROOT/pages/cronscheduledroutepolicy.adoc       |  139 ++
 .../modules/ROOT/pages/data-format.adoc            |   81 +-
 .../modules/ROOT/pages/dead-letter-channel.adoc    |   32 +-
 .../modules/ROOT/pages/defaulterrorhandler.adoc    |    6 +-
 .../modules/ROOT/pages/download-archives.adoc      |  127 -
 docs/user-manual/modules/ROOT/pages/download.adoc  |  127 -
 docs/user-manual/modules/ROOT/pages/dsl.adoc       |    2 +-
 .../modules/ROOT/pages/dynamic-router.adoc         |    6 +-
 .../modules/ROOT/pages/dynamicRouter-eip.adoc      |    2 +-
 .../modules/ROOT/pages/endpoint-annotations.adoc   |   55 +
 .../modules/ROOT/pages/endpoint-completer.adoc     |    2 +-
 .../user-manual/modules/ROOT/pages/enrich-eip.adoc |    3 +-
 .../pages/enterprise-integration-patterns.adoc     |    6 +-
 .../ROOT/pages/error-handling-in-camel.adoc        |   22 +-
 .../modules/ROOT/pages/event-message.adoc          |   10 +-
 .../ROOT/pages/eventDrivenConsumer-eip.adoc        |   26 +-
 docs/user-manual/modules/ROOT/pages/examples.adoc  |    9 +-
 .../modules/ROOT/pages/exception-clause.adoc       |   32 +-
 .../modules/ROOT/pages/exchange-pattern.adoc       |    2 +-
 .../user-manual/modules/ROOT/pages/expression.adoc |   37 +-
 docs/user-manual/modules/ROOT/pages/faq.adoc       |    6 +-
 .../pages/faq/can-i-get-commercial-support.adoc    |    2 +-
 .../pages/faq/does-camel-work-on-ibms-jdk.adoc     |    2 +-
 ...ption-javaxnamingnoinitialcontextexception.adoc |    4 +-
 ...tion-orgapachecamelnosuchendpointexception.adoc |    2 +-
 .../faq/exception-orgxmlsaxsaxparseexception.adoc  |    2 +-
 ...an-i-create-a-custom-component-or-endpoint.adoc |    8 +-
 .../pages/faq/how-can-i-get-the-source-code.adoc   |    2 +-
 .../faq/how-can-i-stop-a-route-from-a-route.adoc   |   24 +-
 .../pages/faq/how-do-i-become-a-committer.adoc     |    6 +-
 .../pages/faq/how-do-i-change-the-logging.adoc     |    2 +-
 .../ROOT/pages/faq/how-do-i-compile-the-code.adoc  |    2 +-
 .../pages/faq/how-do-i-configure-endpoints.adoc    |   24 +-
 ...-endpoints-without-the-value-being-encoded.adoc |    6 +-
 ...size-for-producercache-or-producertemplate.adoc |    2 +-
 ...ximum-endpoint-cache-size-for-camelcontext.adoc |   10 +-
 .../ROOT/pages/faq/how-do-i-debug-my-route.adoc    |    6 +-
 .../pages/faq/how-do-i-enable-debug-logging.adoc   |    2 +-
 ...en-consuming-for-example-from-a-ftp-server.adoc |   10 +-
 ...how-do-i-import-rests-from-other-xml-files.adoc |    2 +-
 ...ow-do-i-import-routes-from-other-xml-files.adoc |    2 +-
 .../faq/how-do-i-let-jetty-match-wildcards.adoc    |    4 +-
 ...ow-do-i-make-my-jms-endpoint-transactional.adoc |   12 +-
 .../pages/faq/how-do-i-restart-camelcontext.adoc   |    4 +-
 .../how-do-i-retry-failed-messages-forever.adoc    |    2 +-
 ...om-a-certain-point-back-or-an-entire-route.adoc |    2 +-
 ...-contexttestsupport-class-in-my-unit-tests.adoc |    5 +-
 ...ify-time-period-in-a-human-friendly-syntax.adoc |    4 +-
 ...h-method-to-use-when-using-beans-in-routes.adoc |    2 +-
 ...spring-property-placeholder-with-camel-xml.adoc |   10 +-
 .../how-do-i-use-uris-with-parameters-in-xml.adoc  |    4 +-
 ...om-processor-which-sends-multiple-messages.adoc |    2 +-
 ...direct-event-seda-and-vm-endpoints-compare.adoc |   10 +-
 ...-do-the-timer-and-quartz-endpoints-compare.adoc |    4 +-
 .../pages/faq/how-does-camel-compare-to-mule.adoc  |   14 +-
 .../how-does-camel-compare-to-servicemix-eip.adoc  |   10 +-
 .../faq/how-does-camel-compare-to-servicemix.adoc  |   16 +-
 .../faq/how-does-camel-compare-to-synapse.adoc     |   11 +-
 ...how-does-camel-look-up-beans-and-endpoints.adoc |   22 +-
 .../faq/how-does-camel-work-with-activemq.adoc     |   16 +-
 .../faq/how-does-camel-work-with-servicemix.adoc   |   10 +-
 .../ROOT/pages/faq/how-does-camel-work.adoc        |    2 +-
 .../faq/how-does-the-camel-api-compare-to.adoc     |   14 +-
 ...hould-i-invoke-my-pojos-or-spring-services.adoc |    4 +-
 ...kage-applications-using-camel-and-activemq.adoc |    6 +-
 ...-avoid-sending-some-or-all-message-headers.adoc |    4 +-
 ...end-the-same-message-to-multiple-endpoints.adoc |    2 +-
 .../pages/faq/how-to-use-a-dynamic-uri-in-to.adoc  |    8 +-
 ...-extra-camel-componets-in-servicemix-camel.adoc |   72 +
 ...f-i-use-servicemix-when-should-i-use-camel.adoc |   10 +-
 .../ROOT/pages/faq/is-camel-ioc-friendly.adoc      |   14 +-
 .../modules/ROOT/pages/faq/is-there-an-ide.adoc    |    8 +-
 ...when-adding-and-removing-routes-at-runtime.adoc |    4 +-
 .../ROOT/pages/faq/running-camel-standalone.adoc   |   18 +-
 ...-activemq-broker-or-in-another-application.adoc |    4 +-
 .../ROOT/pages/faq/using-camel-core-testsjar.adoc  |    2 +-
 .../using-getin-or-getout-methods-on-exchange.adoc |   24 +-
 .../ROOT/pages/faq/what-are-the-dependencies.adoc  |    2 +-
 .../modules/ROOT/pages/faq/what-is-a-router.adoc   |   18 +-
 .../modules/ROOT/pages/faq/what-is-camel.adoc      |   38 +-
 .../pages/faq/what-platforms-are-supported.adoc    |    2 +-
 ...se-when-or-otherwise-in-a-java-camel-route.adoc |   24 +-
 .../faq/why-cant-i-use-sign-in-my-password.adoc    |    6 +-
 ...o-many-noclassdeffoundexception-on-startup.adoc |    2 +-
 ...my-message-lose-its-headers-during-routing.adoc |    2 +-
 ...use-too-many-threads-with-producertemplate.adoc |    6 +-
 ...-does-ftp-component-not-download-any-files.adoc |    2 +-
 ...-file-consumer-use-the-camel-error-handler.adoc |   20 +-
 ...jms-route-only-consume-one-message-at-once.adoc |    4 +-
 ...ge-with-error-handler-not-work-as-expected.adoc |    8 +-
 ...is-my-processor-not-showing-up-in-jconsole.adoc |    9 +-
 .../modules/ROOT/pages/faq/why-the-name-camel.adoc |    4 +-
 .../pages/faq/why-use-multiple-camelcontext.adoc   |    4 +-
 .../modules/ROOT/pages/file-language.adoc          |    4 +-
 .../user-manual/modules/ROOT/pages/filter-eip.adoc |   10 +-
 .../modules/ROOT/pages/graceful-shutdown.adoc      |    8 +-
 .../user-manual/modules/ROOT/pages/groovy-dsl.adoc |    2 +-
 .../modules/ROOT/pages/guaranteed-delivery.adoc    |   16 +-
 .../modules/ROOT/pages/guice-jms-example.adoc      |   61 -
 .../modules/ROOT/pages/guice-maven-plugin.adoc     |  160 --
 docs/user-manual/modules/ROOT/pages/guice.adoc     |    8 -
 .../modules/ROOT/pages/hiding-middleware.adoc      |   43 +
 .../modules/ROOT/pages/http-session-handling.adoc  |    2 +-
 .../modules/ROOT/pages/idempotentConsumer-eip.adoc |   18 +-
 docs/user-manual/modules/ROOT/pages/index.adoc     |   29 +-
 docs/user-manual/modules/ROOT/pages/injector.adoc  |    2 +-
 docs/user-manual/modules/ROOT/pages/intercept.adoc |    2 +-
 docs/user-manual/modules/ROOT/pages/jndi.adoc      |    2 +-
 docs/user-manual/modules/ROOT/pages/json.adoc      |    7 -
 docs/user-manual/modules/ROOT/pages/languages.adoc |   36 +-
 docs/user-manual/modules/ROOT/pages/log-eip.adoc   |    6 +-
 .../modules/ROOT/pages/message-bus.adoc            |    2 +-
 .../modules/ROOT/pages/message-channel.adoc        |    4 +-
 .../modules/ROOT/pages/message-endpoint.adoc       |    4 +-
 .../modules/ROOT/pages/message-router.adoc         |    2 +-
 .../modules/ROOT/pages/message-translator.adoc     |    8 +-
 docs/user-manual/modules/ROOT/pages/message.adoc   |    4 +-
 .../ROOT/pages/parameter-binding-annotations.adoc  |  277 +++
 .../ROOT/pages/pluggable-class-resolvers.adoc      |   71 +
 .../modules/ROOT/pages/point-to-point-channel.adoc |   10 +-
 .../modules/ROOT/pages/pojo-consuming.adoc         |  202 ++
 .../modules/ROOT/pages/pojo-producing.adoc         |   78 +
 .../modules/ROOT/pages/polling-consumer.adoc       |  434 ++++
 docs/user-manual/modules/ROOT/pages/predicate.adoc |   61 +-
 .../modules/ROOT/pages/process-eip.adoc            |    2 +-
 docs/user-manual/modules/ROOT/pages/processor.adoc |    6 +-
 .../ROOT/pages/publish-subscribe-channel.adoc      |    8 +-
 .../modules/ROOT/pages/release-guide.adoc          |   94 +-
 .../modules/ROOT/pages/requestReply-eip.adoc       |    4 +-
 docs/user-manual/modules/ROOT/pages/rest-dsl.adoc  |   28 +-
 .../modules/ROOT/pages/return-address.adoc         |    2 +-
 .../modules/ROOT/pages/route-policy.adoc           |   57 +-
 .../modules/ROOT/pages/running-examples.adoc       |   64 +
 .../ROOT/pages/scala-dsl-supported-languages.adoc  |   18 +-
 .../modules/ROOT/pages/scheduledroutepolicy.adoc   |   30 +
 .../user-manual/modules/ROOT/pages/script-eip.adoc |    2 +-
 .../modules/ROOT/pages/scripting-languages.adoc    |    4 +-
 docs/user-manual/modules/ROOT/pages/security.adoc  |   30 +-
 .../modules/ROOT/pages/servicepool.adoc            |    6 +-
 .../modules/ROOT/pages/servlet-tomcat-example.adoc |   10 +-
 .../modules/ROOT/pages/setFaultBody-eip.adoc       |   39 -
 .../modules/ROOT/pages/simple-language.adoc        |   16 +-
 .../ROOT/pages/simplescheduledroutepolicy.adoc     |  153 ++
 .../modules/ROOT/pages/spring-example.adoc         |   54 +
 .../modules/ROOT/pages/spring-remoting.adoc        |  522 +++++
 .../modules/ROOT/pages/spring-testing.adoc         |   14 +-
 docs/user-manual/modules/ROOT/pages/spring.adoc    |   10 +-
 docs/user-manual/modules/ROOT/pages/step-eip.adoc  |    2 +-
 .../modules/ROOT/pages/stream-caching.adoc         |    6 +-
 .../user-manual/modules/ROOT/pages/templating.adoc |   55 +
 docs/user-manual/modules/ROOT/pages/testing.adoc   |   18 +-
 .../modules/ROOT/pages/threading-model.adoc        |   12 +-
 docs/user-manual/modules/ROOT/pages/toD-eip.adoc   |    6 +-
 docs/user-manual/modules/ROOT/pages/tracer.adoc    |  227 ++
 .../modules/ROOT/pages/transactional-client.adoc   |   24 +-
 .../ROOT/pages/transactionerrorhandler.adoc        |    2 +-
 .../modules/ROOT/pages/transformer.adoc            |    4 +-
 docs/user-manual/modules/ROOT/pages/transport.adoc |    9 -
 .../modules/ROOT/pages/try-catch-finally.adoc      |    6 +-
 .../modules/ROOT/pages/unmarshal-eip.adoc          |    6 +-
 docs/user-manual/modules/ROOT/pages/uris.adoc      |   11 -
 .../pages/using-exchange-pattern-annotations.adoc  |  128 +
 .../ROOT/pages/using-propertyplaceholder.adoc      |   22 +-
 .../modules/ROOT/pages/using-this-pattern.adoc     |    8 +
 docs/user-manual/modules/ROOT/pages/validator.adoc |    4 +-
 .../ROOT/pages/walk-through-an-example.adoc        |  102 +
 .../ROOT/pages/walk-through-another-example.adoc   |  193 ++
 .../ROOT/pages/what-are-the-dependencies.adoc      |   57 +
 .../modules/ROOT/pages/wireTap-eip.adoc            |   12 +-
 .../modules/ROOT/pages/writing-components.adoc     |    4 +-
 .../modules/ROOT/pages/xml-configuration.adoc      |    6 +-
 .../modules/ROOT/pages/xml-reference.adoc          |    2 +-
 docs/yarn.lock                                     |  522 ++++-
 examples/README.adoc                               |    4 +-
 .../resources/META-INF/spring/camel-context.xml    |    4 +-
 .../example/jmstofile/CamelJmsToFileExample.java   |   20 +-
 .../META-INF/spring-configuration-metadata.json    |    7 -
 parent/pom.xml                                     |   24 +-
 .../springboot/ActiveMQComponentConfiguration.java |   19 -
 .../springboot/AMQPComponentConfiguration.java     |   19 -
 .../jms/springboot/JmsComponentConfiguration.java  |   39 -
 .../springboot/MongoDbComponentConfiguration.java  |   14 +
 .../PropertiesComponentConfiguration.java          |   28 -
 .../springboot/CamelElasticsearchRestTest.java     |    7 +-
 .../camel/itest/springboot/CamelSolrTest.java      |    3 -
 .../container/ManagedSEContainerConfiguration.java |    2 +-
 .../camel/itest/greeter/JmsPrepareResponse.java    |    4 +-
 .../apt/CoreEipAnnotationProcessorHelper.java      |    5 -
 .../trgt/classes/org/apache/camel/model/aop.json   |    2 +-
 .../test/resources/integration/camel-spring.xsd    |    1 -
 .../src/test/resources/json/aop.json               |    2 +-
 .../apache/camel/main/parser/MyConfiguration.java  |   14 -
 .../main/parser/MyConfigurationParserTest.java     |    2 +-
 801 files changed, 8415 insertions(+), 11935 deletions(-)
 create mode 100644 components/camel-bean/src/main/docs/bean-language.adoc
 delete mode 100644 components/camel-jetty/src/test/java/org/apache/camel/component/jetty/HttpReturnFaultTest.java
 delete mode 100644 components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsTransferFaultTest.java
 delete mode 100644 components/camel-jms/src/test/java/org/apache/camel/component/jms/SetFaultBodyAfterJmsRequestReplyIssueTest.java
 delete mode 100644 components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/NettyHttpReturnFaultTest.java
 rename components/{camel-spring/src/test/java/org/apache/camel/spring/processor/SpringHandleFaultPerRouteTest.java => camel-openstack/src/main/java/org/apache/camel/component/openstack/common/OpenstackException.java} (62%)
 rename components/{camel-spring/src/test/java/org/apache/camel/spring/processor/SpringFaultRouteTest.java => camel-openstack/src/main/java/org/apache/camel/component/openstack/common/OpenstackOperationException.java} (55%)
 create mode 100644 components/camel-openstack/src/test/resources/log4j2.properties
 delete mode 100644 components/camel-restlet/src/test/java/org/apache/camel/component/restlet/RestletFaultTest.java
 delete mode 100644 components/camel-spring/src/test/java/org/apache/camel/component/properties/SpringPropertiesComponent2Test.java
 delete mode 100644 components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringSetFaultBodyTest.java
 delete mode 100644 components/camel-spring/src/test/resources/org/apache/camel/component/properties/SpringPropertiesComponent2Test.xml
 delete mode 100644 components/camel-spring/src/test/resources/org/apache/camel/spring/processor/faultRoute.xml
 copy components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/{DisableJmxTestExecutionListener.java => CamelSpringBootTest.java} (50%)
 create mode 100644 components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowHttpStreamingTest.java
 delete mode 100644 core/camel-base/src/main/java/org/apache/camel/processor/interceptor/Debug.java
 delete mode 100644 core/camel-base/src/main/java/org/apache/camel/processor/interceptor/HandleFault.java
 delete mode 100644 core/camel-base/src/main/java/org/apache/camel/processor/interceptor/HandleFaultInterceptor.java
 delete mode 100644 core/camel-core/src/main/docs/eips/setFaultBody-eip.adoc
 delete mode 100644 core/camel-core/src/main/java/org/apache/camel/model/SetFaultBodyDefinition.java
 delete mode 100644 core/camel-core/src/main/java/org/apache/camel/reifier/SetFaultBodyReifier.java
 delete mode 100644 core/camel-core/src/test/java/org/apache/camel/processor/FaultRetryRouteNewConfigurationTest.java
 delete mode 100644 core/camel-core/src/test/java/org/apache/camel/processor/FaultRetryRouteTest.java
 delete mode 100644 core/camel-core/src/test/java/org/apache/camel/processor/FaultRouteTest.java
 delete mode 100644 core/camel-core/src/test/java/org/apache/camel/processor/HandleFaultPerRouteTest.java
 delete mode 100644 core/camel-core/src/test/java/org/apache/camel/processor/RedeliverWithExceptionAndFaultTest.java
 delete mode 100644 core/camel-core/src/test/java/org/apache/camel/processor/RedeliveryWithExceptionAndFaultDelayInHeader.java
 delete mode 100644 core/camel-core/src/test/java/org/apache/camel/processor/TrySetFaultFinallyTest.java
 delete mode 100644 core/camel-core/src/test/java/org/apache/camel/processor/TrySetFaultTest.java
 delete mode 100644 core/camel-core/src/test/java/org/apache/camel/processor/async/AsyncEndpointWithHandleFaultTest.java
 create mode 100644 docs/components/modules/ROOT/pages/bean-language.adoc
 create mode 100644 docs/site.yml
 delete mode 100644 docs/user-manual/en/README.md
 delete mode 100644 docs/user-manual/en/apache.css
 delete mode 100644 docs/user-manual/en/book.json
 delete mode 100644 docs/user-manual/en/images/apache-spark.data/camel_spark_cluster.png
 delete mode 100644 docs/user-manual/en/images/apache-spark.data/camel_spark_driver.png
 delete mode 100644 docs/user-manual/en/images/apache-spark.data/fabric_docker-(2).png
 delete mode 100644 docs/user-manual/en/images/architecture.data/camel-components.png
 delete mode 100644 docs/user-manual/en/images/async.data/camel_async_request_only.png
 delete mode 100644 docs/user-manual/en/images/async.data/camel_async_request_reply.png
 delete mode 100644 docs/user-manual/en/images/async.data/camel_sync_request_only.png
 delete mode 100644 docs/user-manual/en/images/async.data/camel_sync_request_reply.png
 delete mode 100644 docs/user-manual/en/images/barcode-data-format.data/qr-code.png
 delete mode 100644 docs/user-manual/en/images/building.data/camel-eclipse-m2e-import-completed.png
 delete mode 100644 docs/user-manual/en/images/building.data/camel-eclipse-m2e-import.png
 delete mode 100644 docs/user-manual/en/images/camel-core.data/architecture.png
 delete mode 100644 docs/user-manual/en/images/camel-core.data/architecture_incl_violations.png
 delete mode 100644 docs/user-manual/en/images/camel-logo.png
 delete mode 100644 docs/user-manual/en/images/debugger.data/debug.png
 delete mode 100644 docs/user-manual/en/images/direct-vm.data/camel-direct-vm.png
 delete mode 100644 docs/user-manual/en/images/download.data/camel-box-v1.0-150x200.png
 delete mode 100644 docs/user-manual/en/images/enterprise-integration-patterns.data/clear.png
 delete mode 100644 docs/user-manual/en/images/lifecycle.data/service_lifecycle.png
 delete mode 100644 docs/user-manual/en/notice.md
 delete mode 100644 docs/user-manual/en/release-notes/camel-2170-release.adoc
 delete mode 100644 docs/user-manual/en/release-notes/camel-2171-release.adoc
 delete mode 100644 docs/user-manual/en/release-notes/camel-2172-release.adoc
 delete mode 100644 docs/user-manual/en/release-notes/camel-2173-release.adoc
 delete mode 100644 docs/user-manual/en/release-notes/camel-2174-release.adoc
 delete mode 100644 docs/user-manual/en/release-notes/camel-2175-release.adoc
 delete mode 100644 docs/user-manual/en/release-notes/camel-2176-release.adoc
 delete mode 100644 docs/user-manual/en/release-notes/camel-2177-release.adoc
 delete mode 100644 docs/user-manual/en/release-notes/camel-2180-release.adoc
 delete mode 100644 docs/user-manual/en/release-notes/camel-2181-release.adoc
 delete mode 100644 docs/user-manual/en/release-notes/camel-2182-release.adoc
 delete mode 100644 docs/user-manual/en/release-notes/camel-2183-release.adoc
 delete mode 100644 docs/user-manual/en/release-notes/camel-2184-release.adoc
 delete mode 100644 docs/user-manual/en/release-notes/camel-2185-release.adoc
 delete mode 100644 docs/user-manual/en/release-notes/camel-2190-release.adoc
 delete mode 100644 docs/user-manual/en/release-notes/camel-2191-release.adoc
 delete mode 100644 docs/user-manual/en/release-notes/camel-2192-release.adoc
 delete mode 100644 docs/user-manual/en/release-notes/camel-2193-release.adoc
 delete mode 100644 docs/user-manual/en/release-notes/camel-2194-release.adoc
 delete mode 100644 docs/user-manual/en/release-notes/camel-2195-release.adoc
 delete mode 100644 docs/user-manual/en/release-notes/camel-2200-release.adoc
 delete mode 100644 docs/user-manual/en/release-notes/camel-2201-release.adoc
 delete mode 100644 docs/user-manual/en/release-notes/camel-2202-release.adoc
 delete mode 100644 docs/user-manual/en/release-notes/camel-2203-release.adoc
 delete mode 100644 docs/user-manual/en/release-notes/camel-2204-release.adoc
 delete mode 100644 docs/user-manual/en/release-notes/camel-2210-release.adoc
 delete mode 100644 docs/user-manual/en/release-notes/camel-2211-release.adoc
 delete mode 100644 docs/user-manual/en/release-notes/camel-2212-release.adoc
 delete mode 100644 docs/user-manual/en/release-notes/camel-2223-release.adoc
 delete mode 100644 docs/user-manual/en/release-notes/camel-2224-release.adoc
 delete mode 100644 docs/user-manual/en/release-notes/camel-2225-release.adoc
 delete mode 100644 docs/user-manual/en/release-notes/camel-2230-release.adoc
 delete mode 100644 docs/user-manual/en/release-notes/camel-2231-release.adoc
 delete mode 100644 docs/user-manual/en/release-notes/camel-2232-release.adoc
 delete mode 100644 docs/user-manual/en/release-notes/camel-2233-release.adoc
 delete mode 100644 docs/user-manual/en/release-notes/camel-2240-release.adoc
 create mode 100644 docs/user-manual/modules/ROOT/assets/attachments/Hohpe_EIP_camel_20150622.zip
 create mode 100644 docs/user-manual/modules/ROOT/assets/attachments/Hohpe_EIP_camel_OpenOffice.zip
 copy {components => docs/user-manual/modules/ROOT/examples/components}/camel-spring/src/test/java/org/apache/camel/spring/SpringConsumerTemplateTest.java (98%)
 rename components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringSetFaultBodyTest.xml => docs/user-manual/modules/ROOT/examples/components/camel-spring/src/test/resources/org/apache/camel/spring/SpringConsumerTemplateTest-context.xml (74%)
 copy {core => docs/user-manual/modules/ROOT/examples/core}/camel-core/src/test/java/org/apache/camel/processor/TransformTest.java (96%)
 rename core/camel-core/src/test/java/org/apache/camel/processor/intercept/InterceptSendToFaultTest.java => docs/user-manual/modules/ROOT/examples/core/camel-core/src/test/java/org/apache/camel/processor/TransformViaDSLTest.java (54%)
 copy {core => docs/user-manual/modules/ROOT/examples/core}/camel-management-impl/src/test/java/org/apache/camel/management/ManagedCustomProcessorTest.java (98%)
 rename components/camel-spring/src/test/resources/org/apache/camel/spring/processor/handlefaultperroute.xml => docs/user-manual/modules/ROOT/examples/examples/camel-example-console/src/main/resources/META-INF/spring/camel-context.xml (62%)
 copy {examples => docs/user-manual/modules/ROOT/examples/examples}/camel-example-jms-file/src/main/java/org/apache/camel/example/jmstofile/CamelJmsToFileExample.java (91%)
 create mode 100644 docs/user-manual/modules/ROOT/pages/advanced-configuration-of-camelcontext-using-spring.adoc
 create mode 100644 docs/user-manual/modules/ROOT/pages/bean-binding.adoc
 create mode 100644 docs/user-manual/modules/ROOT/pages/bean-injection.adoc
 create mode 100644 docs/user-manual/modules/ROOT/pages/camel-embedded-maven-goal.adoc
 create mode 100644 docs/user-manual/modules/ROOT/pages/camel-maven-archetypes.adoc
 create mode 100644 docs/user-manual/modules/ROOT/pages/camel-maven-plugin.adoc
 create mode 100644 docs/user-manual/modules/ROOT/pages/camel-run-maven-goal.adoc
 create mode 100644 docs/user-manual/modules/ROOT/pages/console-example.adoc
 create mode 100644 docs/user-manual/modules/ROOT/pages/content-enricher.adoc
 create mode 100644 docs/user-manual/modules/ROOT/pages/contributing.adoc
 create mode 100644 docs/user-manual/modules/ROOT/pages/creating-a-new-spring-based-camel-route.adoc
 create mode 100644 docs/user-manual/modules/ROOT/pages/cronscheduledroutepolicy.adoc
 delete mode 100644 docs/user-manual/modules/ROOT/pages/download-archives.adoc
 delete mode 100644 docs/user-manual/modules/ROOT/pages/download.adoc
 create mode 100644 docs/user-manual/modules/ROOT/pages/endpoint-annotations.adoc
 create mode 100644 docs/user-manual/modules/ROOT/pages/faq/how-to-use-extra-camel-componets-in-servicemix-camel.adoc
 delete mode 100644 docs/user-manual/modules/ROOT/pages/guice-jms-example.adoc
 delete mode 100644 docs/user-manual/modules/ROOT/pages/guice-maven-plugin.adoc
 create mode 100644 docs/user-manual/modules/ROOT/pages/hiding-middleware.adoc
 create mode 100644 docs/user-manual/modules/ROOT/pages/parameter-binding-annotations.adoc
 create mode 100644 docs/user-manual/modules/ROOT/pages/pluggable-class-resolvers.adoc
 create mode 100644 docs/user-manual/modules/ROOT/pages/pojo-consuming.adoc
 create mode 100644 docs/user-manual/modules/ROOT/pages/pojo-producing.adoc
 create mode 100644 docs/user-manual/modules/ROOT/pages/polling-consumer.adoc
 create mode 100644 docs/user-manual/modules/ROOT/pages/running-examples.adoc
 create mode 100644 docs/user-manual/modules/ROOT/pages/scheduledroutepolicy.adoc
 delete mode 100644 docs/user-manual/modules/ROOT/pages/setFaultBody-eip.adoc
 create mode 100644 docs/user-manual/modules/ROOT/pages/simplescheduledroutepolicy.adoc
 create mode 100644 docs/user-manual/modules/ROOT/pages/spring-example.adoc
 create mode 100644 docs/user-manual/modules/ROOT/pages/spring-remoting.adoc
 create mode 100644 docs/user-manual/modules/ROOT/pages/templating.adoc
 create mode 100644 docs/user-manual/modules/ROOT/pages/tracer.adoc
 create mode 100644 docs/user-manual/modules/ROOT/pages/using-exchange-pattern-annotations.adoc
 create mode 100644 docs/user-manual/modules/ROOT/pages/using-this-pattern.adoc
 create mode 100644 docs/user-manual/modules/ROOT/pages/walk-through-an-example.adoc
 create mode 100644 docs/user-manual/modules/ROOT/pages/walk-through-another-example.adoc
 create mode 100644 docs/user-manual/modules/ROOT/pages/what-are-the-dependencies.adoc


[camel] 03/09: CAMEL-13342: Added a JUnit 5 version of JUnit 4 test patterns

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

aldettinger pushed a commit to branch CAMEL-13342-JUNIT5-EXPLORATORY
in repository https://gitbox.apache.org/repos/asf/camel.git

commit d1186693798c4c87f035cfefdfa73f086915226a
Author: aldettinger <al...@gmail.com>
AuthorDate: Thu Jun 6 15:27:20 2019 +0200

    CAMEL-13342: Added a JUnit 5 version of JUnit 4 test patterns
---
 .../test/junit5/CamelTestParameterResolver.java    |   16 +
 .../apache/camel/test/junit5/CamelTestSupport.java | 1214 ++++++++++++++++++++
 .../org/apache/camel/test/junit5/TestSupport.java  |  553 +++++++++
 .../junit5/patterns/AdviceWithNotStartedTest.java  |   74 ++
 .../test/junit5/patterns/AsyncSendMockTest.java    |   47 +
 .../test/junit5/patterns/DebugJUnit5Test.java      |   86 ++
 .../patterns/DebugNoLazyTypeConverterTest.java     |   91 ++
 .../camel/test/junit5/patterns/DebugTest.java      |   86 ++
 .../FilterCreateCamelContextPerClassTest.java      |   65 ++
 .../junit5/patterns/FilterFluentTemplateTest.java  |   75 ++
 .../test/junit5/patterns/FilterJUnit5Test.java     |   69 ++
 .../camel/test/junit5/patterns/FilterTest.java     |   75 ++
 .../patterns/IsMockEndpointsAndSkipJUnit5Test.java |   65 ++
 .../junit5/patterns/IsMockEndpointsFileTest.java   |   68 ++
 .../junit5/patterns/IsMockEndpointsJUnit5Test.java |   72 ++
 .../test/junit5/patterns/IsMockEndpointsTest.java  |   65 ++
 .../patterns/MockEndpointFailNoHeaderTest.java     |   63 +
 .../camel/test/junit5/patterns/MyProduceBean.java  |   32 +
 .../camel/test/junit5/patterns/MySender.java       |   25 +
 .../ProduceBeanTest.java}                          |   34 +-
 .../RouteBuilderConfigureExceptionTest.java        |   54 +
 .../RouteProcessorDumpRouteCoverageTest.java}      |   44 +-
 .../SimpleMockEndpointsTest.java}                  |   35 +-
 .../test/junit5/{ => patterns}/SimpleMockTest.java |   27 +-
 .../SimpleMockUsingExtensionTest.java}             |   13 +-
 .../SimpleNotifyBuilderTest.java}                  |   46 +-
 .../SimpleWeaveAddMockLastTest.java}               |   44 +-
 ...rridePropertiesWithPropertiesComponentTest.java |   78 ++
 28 files changed, 3094 insertions(+), 122 deletions(-)

diff --git a/components/camel-test/src/main/java/org/apache/camel/test/junit5/CamelTestParameterResolver.java b/components/camel-test/src/main/java/org/apache/camel/test/junit5/CamelTestParameterResolver.java
index ce58940..21a8d7b 100644
--- a/components/camel-test/src/main/java/org/apache/camel/test/junit5/CamelTestParameterResolver.java
+++ b/components/camel-test/src/main/java/org/apache/camel/test/junit5/CamelTestParameterResolver.java
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.camel.test.junit5;
 
 import org.apache.camel.ConsumerTemplate;
diff --git a/components/camel-test/src/main/java/org/apache/camel/test/junit5/CamelTestSupport.java b/components/camel-test/src/main/java/org/apache/camel/test/junit5/CamelTestSupport.java
new file mode 100644
index 0000000..0ff4509
--- /dev/null
+++ b/components/camel-test/src/main/java/org/apache/camel/test/junit5/CamelTestSupport.java
@@ -0,0 +1,1214 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5;
+
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.lang.annotation.Annotation;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.stream.Collectors;
+
+import javax.management.AttributeNotFoundException;
+import javax.management.InstanceNotFoundException;
+import javax.management.MBeanException;
+import javax.management.MBeanServer;
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
+import javax.management.ReflectionException;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.ConsumerTemplate;
+import org.apache.camel.Endpoint;
+import org.apache.camel.Exchange;
+import org.apache.camel.Expression;
+import org.apache.camel.ExtendedCamelContext;
+import org.apache.camel.FluentProducerTemplate;
+import org.apache.camel.Message;
+import org.apache.camel.NamedNode;
+import org.apache.camel.NoSuchEndpointException;
+import org.apache.camel.Predicate;
+import org.apache.camel.Processor;
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.Route;
+import org.apache.camel.RoutesBuilder;
+import org.apache.camel.Service;
+import org.apache.camel.ServiceStatus;
+import org.apache.camel.api.management.JmxSystemPropertyKeys;
+import org.apache.camel.api.management.ManagedCamelContext;
+import org.apache.camel.api.management.mbean.ManagedCamelContextMBean;
+import org.apache.camel.api.management.mbean.ManagedProcessorMBean;
+import org.apache.camel.api.management.mbean.ManagedRouteMBean;
+import org.apache.camel.builder.AdviceWithRouteBuilder;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.component.properties.PropertiesComponent;
+import org.apache.camel.impl.DefaultCamelContext;
+import org.apache.camel.impl.JndiRegistry;
+import org.apache.camel.impl.engine.DefaultCamelBeanPostProcessor;
+import org.apache.camel.impl.engine.InterceptSendToMockEndpointStrategy;
+import org.apache.camel.model.Model;
+import org.apache.camel.model.ModelCamelContext;
+import org.apache.camel.model.ProcessorDefinition;
+import org.apache.camel.processor.interceptor.BreakpointSupport;
+import org.apache.camel.processor.interceptor.DefaultDebugger;
+import org.apache.camel.reifier.RouteReifier;
+import org.apache.camel.spi.Language;
+import org.apache.camel.spi.Registry;
+import org.apache.camel.support.EndpointHelper;
+import org.apache.camel.util.IOHelper;
+import org.apache.camel.util.StopWatch;
+import org.apache.camel.util.StringHelper;
+import org.apache.camel.util.TimeUtils;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.extension.AfterTestExecutionCallback;
+import org.junit.jupiter.api.extension.BeforeEachCallback;
+import org.junit.jupiter.api.extension.BeforeTestExecutionCallback;
+import org.junit.jupiter.api.extension.ExtensionContext;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+
+/**
+ * A useful base class which creates a {@link org.apache.camel.CamelContext}
+ * with some routes along with a {@link org.apache.camel.ProducerTemplate} for
+ * use in the test case Do <tt>not</tt> use this class for Spring Boot testing,
+ * instead use <code>@RunWith(CamelSpringBootRunner.class)</code>.
+ */
+public class CamelTestSupport extends TestSupport implements BeforeEachCallback, BeforeTestExecutionCallback, AfterTestExecutionCallback {
+
+    /**
+     * JVM system property which can be set to true to turn on dumping route
+     * coverage statistics.
+     */
+    public static final String ROUTE_COVERAGE_ENABLED = "CamelTestRouteCoverage";
+
+    private static final Logger LOG = LoggerFactory.getLogger(CamelTestSupport.class);
+    private static ThreadLocal<ModelCamelContext> threadCamelContext = new ThreadLocal<>();
+    private static ThreadLocal<ProducerTemplate> threadTemplate = new ThreadLocal<>();
+    private static ThreadLocal<FluentProducerTemplate> threadFluentTemplate = new ThreadLocal<>();
+    private static ThreadLocal<ConsumerTemplate> threadConsumer = new ThreadLocal<>();
+    private static ThreadLocal<Service> threadService = new ThreadLocal<>();
+    protected volatile ModelCamelContext context;
+    protected volatile ProducerTemplate template;
+    protected volatile FluentProducerTemplate fluentTemplate;
+    protected volatile ConsumerTemplate consumer;
+    protected volatile Service camelContextService;
+    protected boolean dumpRouteStats;
+    @RegisterExtension
+    protected CamelTestSupport camelTestSupportExtension = this;
+    private boolean useRouteBuilder = true;
+    private final DebugBreakpoint breakpoint = new DebugBreakpoint();
+    private final StopWatch watch = new StopWatch();
+    private final Map<String, String> fromEndpoints = new HashMap<>();
+    private final AtomicInteger tests = new AtomicInteger(0);
+    private String currentTestName;
+
+    @Override
+    public void afterTestExecution(ExtensionContext context) throws Exception {
+        watch.taken();
+    }
+
+    @Override
+    public void beforeTestExecution(ExtensionContext context) throws Exception {
+        watch.restart();
+    }
+
+    public long timeTaken() {
+        return watch.taken();
+    }
+
+    @Override
+    public void beforeEach(ExtensionContext context) throws Exception {
+        currentTestName = context.getDisplayName();
+    }
+
+    /**
+     * Use the RouteBuilder or not
+     * 
+     * @return <tt>true</tt> then {@link CamelContext} will be auto started,
+     *         <tt>false</tt> then {@link CamelContext} will <b>not</b> be auto
+     *         started (you will have to start it manually)
+     */
+    public boolean isUseRouteBuilder() {
+        return useRouteBuilder;
+    }
+
+    public void setUseRouteBuilder(boolean useRouteBuilder) {
+        this.useRouteBuilder = useRouteBuilder;
+    }
+
+    /**
+     * Whether to dump route coverage stats at the end of the test.
+     * <p/>
+     * This allows tooling or manual inspection of the stats, so you can
+     * generate a route trace diagram of which EIPs have been in use and which
+     * have not. Similar concepts as a code coverage report.
+     * <p/>
+     * You can also turn on route coverage globally via setting JVM system
+     * property <tt>CamelTestRouteCoverage=true</tt>.
+     *
+     * @return <tt>true</tt> to write route coverage status in an xml file in
+     *         the <tt>target/camel-route-coverage</tt> directory after the test
+     *         has finished.
+     */
+    public boolean isDumpRouteCoverage() {
+        return false;
+    }
+
+    /**
+     * Override when using
+     * <a href="http://camel.apache.org/advicewith.html">advice with</a> and
+     * return <tt>true</tt>. This helps knowing advice with is to be used, and
+     * {@link CamelContext} will not be started before the advice with takes
+     * place. This helps by ensuring the advice with has been property setup
+     * before the {@link CamelContext} is started
+     * <p/>
+     * <b>Important:</b> Its important to start {@link CamelContext} manually
+     * from the unit test after you are done doing all the advice with.
+     *
+     * @return <tt>true</tt> if you use advice with in your unit tests.
+     */
+    public boolean isUseAdviceWith() {
+        return false;
+    }
+
+    /**
+     * Override to control whether {@link CamelContext} should be setup per test
+     * or per class.
+     * <p/>
+     * By default it will be setup/teardown per test (per test method). If you
+     * want to re-use {@link CamelContext} between test methods you can override
+     * this method and return <tt>true</tt>
+     * <p/>
+     * <b>Important:</b> Use this with care as the {@link CamelContext} will
+     * carry over state from previous tests, such as endpoints, components etc.
+     * So you cannot use this in all your tests.
+     * <p/>
+     * Setting up {@link CamelContext} uses the {@link #doPreSetup()},
+     * {@link #doSetUp()}, and {@link #doPostSetup()} methods in that given
+     * order.
+     *
+     * @return <tt>true</tt> per class, <tt>false</tt> per test.
+     */
+    public boolean isCreateCamelContextPerClass() {
+        return false;
+    }
+
+    /**
+     * Override to enable auto mocking endpoints based on the pattern.
+     * <p/>
+     * Return <tt>*</tt> to mock all endpoints.
+     *
+     * @see EndpointHelper#matchEndpoint(CamelContext, String, String)
+     */
+    public String isMockEndpoints() {
+        return null;
+    }
+
+    /**
+     * Override to enable auto mocking endpoints based on the pattern, and
+     * <b>skip</b> sending to original endpoint.
+     * <p/>
+     * Return <tt>*</tt> to mock all endpoints.
+     *
+     * @see EndpointHelper#matchEndpoint(CamelContext, String, String)
+     */
+    public String isMockEndpointsAndSkip() {
+        return null;
+    }
+
+    public void replaceRouteFromWith(String routeId, String fromEndpoint) {
+        fromEndpoints.put(routeId, fromEndpoint);
+    }
+
+    /**
+     * Used for filtering routes routes matching the given pattern, which
+     * follows the following rules: - Match by route id - Match by route input
+     * endpoint uri The matching is using exact match, by wildcard and regular
+     * expression. For example to only include routes which starts with foo in
+     * their route id's, use: include=foo&#42; And to exclude routes which
+     * starts from JMS endpoints, use: exclude=jms:&#42; Multiple patterns can
+     * be separated by comma, for example to exclude both foo and bar routes,
+     * use: exclude=foo&#42;,bar&#42; Exclude takes precedence over include.
+     */
+    public String getRouteFilterIncludePattern() {
+        return null;
+    }
+
+    /**
+     * Used for filtering routes routes matching the given pattern, which
+     * follows the following rules: - Match by route id - Match by route input
+     * endpoint uri The matching is using exact match, by wildcard and regular
+     * expression. For example to only include routes which starts with foo in
+     * their route id's, use: include=foo&#42; And to exclude routes which
+     * starts from JMS endpoints, use: exclude=jms:&#42; Multiple patterns can
+     * be separated by comma, for example to exclude both foo and bar routes,
+     * use: exclude=foo&#42;,bar&#42; Exclude takes precedence over include.
+     */
+    public String getRouteFilterExcludePattern() {
+        return null;
+    }
+
+    /**
+     * Override to enable debugger
+     * <p/>
+     * Is default <tt>false</tt>
+     */
+    public boolean isUseDebugger() {
+        return false;
+    }
+
+    public Service getCamelContextService() {
+        return camelContextService;
+    }
+
+    public Service camelContextService() {
+        return camelContextService;
+    }
+
+    public CamelContext context() {
+        return context;
+    }
+
+    public ProducerTemplate template() {
+        return template;
+    }
+
+    public FluentProducerTemplate fluentTemplate() {
+        return fluentTemplate;
+    }
+
+    public ConsumerTemplate consumer() {
+        return consumer;
+    }
+
+    /**
+     * Allows a service to be registered a separate lifecycle service to start
+     * and stop the context; such as for Spring when the ApplicationContext is
+     * started and stopped, rather than directly stopping the CamelContext
+     */
+    public void setCamelContextService(Service service) {
+        camelContextService = service;
+        threadService.set(camelContextService);
+    }
+
+    @BeforeEach
+    public void setUp() throws Exception {
+        log.info("********************************************************************************");
+        log.info("Testing: " + currentTestName + "(" + getClass().getName() + ")");
+        log.info("********************************************************************************");
+
+        if (isCreateCamelContextPerClass()) {
+            while (true) {
+                int v = tests.get();
+                if (tests.compareAndSet(v, v + 1)) {
+                    if (v == 0) {
+                        // test is per class, so only setup once (the first
+                        // time)
+                        doSpringBootCheck();
+                        setupResources();
+                        doPreSetup();
+                        doSetUp();
+                        doPostSetup();
+                    } else {
+                        // and in between tests we must do IoC and reset mocks
+                        postProcessTest();
+                        resetMocks();
+                    }
+
+                    break;
+                }
+            }
+        } else {
+            // test is per test so always setup
+            doSpringBootCheck();
+            setupResources();
+            doPreSetup();
+            doSetUp();
+            doPostSetup();
+        }
+
+        // only start timing after all the setup
+        watch.restart();
+    }
+
+    /**
+     * Strategy to perform any pre setup, before {@link CamelContext} is created
+     */
+    protected void doPreSetup() throws Exception {
+        // noop
+    }
+
+    /**
+     * Strategy to perform any post setup after {@link CamelContext} is created
+     */
+    protected void doPostSetup() throws Exception {
+        // noop
+    }
+
+    /**
+     * Detects if this is a Spring-Boot test and throws an exception, as these
+     * base classes is not intended for testing Camel on Spring Boot.
+     */
+    protected void doSpringBootCheck() {
+        boolean springBoot = hasClassAnnotation("org.springframework.boot.test.context.SpringBootTest");
+        if (springBoot) {
+            throw new RuntimeException("Spring Boot detected: The CamelTestSupport/CamelSpringTestSupport class is not intended for Camel testing with Spring Boot."
+                                       + " Prefer to not extend this class, but use @RunWith(CamelSpringBootRunner.class) instead.");
+        }
+    }
+
+    private void doSetUp() throws Exception {
+        log.debug("setUp test");
+        // jmx is enabled if we have configured to use it, or if dump route
+        // coverage is enabled (it requires JMX)
+        boolean jmx = useJmx() || isRouteCoverageEnabled();
+        if (jmx) {
+            enableJMX();
+        } else {
+            disableJMX();
+        }
+
+        context = (ModelCamelContext)createCamelContext();
+        threadCamelContext.set(context);
+
+        assertNotNull(context, "No context found!");
+
+        // add custom beans
+        bindToRegistry(context.getRegistry());
+
+        // reduce default shutdown timeout to avoid waiting for 300 seconds
+        context.getShutdownStrategy().setTimeout(getShutdownTimeout());
+
+        // set debugger if enabled
+        if (isUseDebugger()) {
+            if (context.getStatus().equals(ServiceStatus.Started)) {
+                log.info("Cannot setting the Debugger to the starting CamelContext, stop the CamelContext now.");
+                // we need to stop the context first to setup the debugger
+                context.stop();
+            }
+            context.setDebugger(new DefaultDebugger());
+            context.getDebugger().addBreakpoint(breakpoint);
+            // note: when stopping CamelContext it will automatic remove the
+            // breakpoint
+        }
+
+        template = context.createProducerTemplate();
+        template.start();
+        fluentTemplate = context.createFluentProducerTemplate();
+        fluentTemplate.start();
+        consumer = context.createConsumerTemplate();
+        consumer.start();
+
+        threadTemplate.set(template);
+        threadFluentTemplate.set(fluentTemplate);
+        threadConsumer.set(consumer);
+
+        // enable auto mocking if enabled
+        String pattern = isMockEndpoints();
+        if (pattern != null) {
+            context.adapt(ExtendedCamelContext.class).registerEndpointCallback(new InterceptSendToMockEndpointStrategy(pattern));
+        }
+        pattern = isMockEndpointsAndSkip();
+        if (pattern != null) {
+            context.adapt(ExtendedCamelContext.class).registerEndpointCallback(new InterceptSendToMockEndpointStrategy(pattern, true));
+        }
+
+        // configure properties component (mandatory for testing)
+        PropertiesComponent pc = context.getComponent("properties", PropertiesComponent.class);
+        Properties extra = useOverridePropertiesWithPropertiesComponent();
+        if (extra != null && !extra.isEmpty()) {
+            pc.setOverrideProperties(extra);
+        }
+        Boolean ignore = ignoreMissingLocationWithPropertiesComponent();
+        if (ignore != null) {
+            pc.setIgnoreMissingLocation(ignore);
+        }
+
+        String include = getRouteFilterIncludePattern();
+        String exclude = getRouteFilterExcludePattern();
+        if (include != null || exclude != null) {
+            log.info("Route filtering pattern: include={}, exclude={}", include, exclude);
+            context.getExtension(Model.class).setRouteFilterPattern(include, exclude);
+        }
+
+        // prepare for in-between tests
+        postProcessTest();
+
+        if (isUseRouteBuilder()) {
+            RoutesBuilder[] builders = createRouteBuilders();
+            for (RoutesBuilder builder : builders) {
+                log.debug("Using created route builder: " + builder);
+                context.addRoutes(builder);
+            }
+            replaceFromEndpoints();
+            boolean skip = "true".equalsIgnoreCase(System.getProperty("skipStartingCamelContext"));
+            if (skip) {
+                log.info("Skipping starting CamelContext as system property skipStartingCamelContext is set to be true.");
+            } else if (isUseAdviceWith()) {
+                log.info("Skipping starting CamelContext as isUseAdviceWith is set to true.");
+            } else {
+                startCamelContext();
+            }
+        } else {
+            replaceFromEndpoints();
+            log.debug("Using route builder from the created context: " + context);
+        }
+        log.debug("Routing Rules are: " + context.getRoutes());
+
+        assertValidContext(context);
+    }
+
+    private void replaceFromEndpoints() throws Exception {
+        for (final Map.Entry<String, String> entry : fromEndpoints.entrySet()) {
+            RouteReifier.adviceWith(context.getRouteDefinition(entry.getKey()), context, new AdviceWithRouteBuilder() {
+                @Override
+                public void configure() throws Exception {
+                    replaceFromWith(entry.getValue());
+                }
+            });
+        }
+    }
+
+    private boolean isRouteCoverageEnabled() {
+        return System.getProperty(ROUTE_COVERAGE_ENABLED, "false").equalsIgnoreCase("true") || isDumpRouteCoverage();
+    }
+
+    @AfterEach
+    public void tearDown() throws Exception {
+        long time = watch.taken();
+
+        log.info("********************************************************************************");
+        log.info("Testing done: " + currentTestName + "(" + getClass().getName() + ")");
+        log.info("Took: " + TimeUtils.printDuration(time) + " (" + time + " millis)");
+
+        // if we should dump route stats, then write that to a file
+        if (isRouteCoverageEnabled()) {
+            String className = this.getClass().getSimpleName();
+            String dir = "target/camel-route-coverage";
+            String name = className + "-" + StringHelper.before(currentTestName, "(") + ".xml";
+
+            ManagedCamelContext mc = context != null ? context.getExtension(ManagedCamelContext.class) : null;
+            ManagedCamelContextMBean managedCamelContext = mc != null ? mc.getManagedCamelContext() : null;
+            if (managedCamelContext == null) {
+                log.warn("Cannot dump route coverage to file as JMX is not enabled. "
+                         + "Add camel-management-impl JAR as dependency and/or override useJmx() method to enable JMX in the unit test classes.");
+            } else {
+                logCoverageSummary(managedCamelContext);
+
+                String xml = managedCamelContext.dumpRoutesCoverageAsXml();
+                String combined = "<camelRouteCoverage>\n" + gatherTestDetailsAsXml() + xml + "\n</camelRouteCoverage>";
+
+                File file = new File(dir);
+                // ensure dir exists
+                file.mkdirs();
+                file = new File(dir, name);
+
+                log.info("Dumping route coverage to file: {}", file);
+                InputStream is = new ByteArrayInputStream(combined.getBytes());
+                OutputStream os = new FileOutputStream(file, false);
+                IOHelper.copyAndCloseInput(is, os);
+                IOHelper.close(os);
+            }
+        }
+        log.info("********************************************************************************");
+
+        if (isCreateCamelContextPerClass()) {
+            while (true) {
+                int v = tests.get();
+                if (v <= 0) {
+                    LOG.warn("Test already teared down");
+                    break;
+                }
+
+                if (tests.compareAndSet(v, v - 1)) {
+                    if (v == 1) {
+                        LOG.debug("tearDown test");
+                        doStopTemplates(threadConsumer.get(), threadTemplate.get(), threadFluentTemplate.get());
+                        doStopCamelContext(threadCamelContext.get(), threadService.get());
+                        doPostTearDown();
+                        cleanupResources();
+                    }
+
+                    break;
+                }
+            }
+        } else {
+            LOG.debug("tearDown test");
+            doStopTemplates(consumer, template, fluentTemplate);
+            doStopCamelContext(context, camelContextService);
+            doPostTearDown();
+            cleanupResources();
+        }
+    }
+
+    /**
+     * Strategy to perform any post action, after {@link CamelContext} is
+     * stopped
+     */
+    protected void doPostTearDown() throws Exception {
+        // noop
+    }
+
+    /**
+     * Strategy to perform resources setup, before {@link CamelContext} is
+     * created
+     */
+    protected void setupResources() throws Exception {
+        // noop
+    }
+
+    /**
+     * Strategy to perform resources cleanup, after {@link CamelContext} is
+     * stopped
+     */
+    protected void cleanupResources() throws Exception {
+        // noop
+    }
+
+    /**
+     * Logs route coverage summary: - which routes are uncovered - what is the
+     * coverage of each processor in each route
+     */
+    private void logCoverageSummary(ManagedCamelContextMBean managedCamelContext) throws Exception {
+        StringBuilder builder = new StringBuilder("\nCoverage summary\n");
+
+        int routes = managedCamelContext.getTotalRoutes();
+
+        long contextExchangesTotal = managedCamelContext.getExchangesTotal();
+
+        List<String> uncoveredRoutes = new ArrayList<>();
+
+        StringBuilder routesSummary = new StringBuilder();
+        routesSummary.append("\tProcessor coverage\n");
+
+        MBeanServer server = context.getManagementStrategy().getManagementAgent().getMBeanServer();
+
+        Map<String, List<ManagedProcessorMBean>> processorsForRoute = findProcessorsForEachRoute(server);
+
+        // log processor coverage for each route
+        for (Route route : context.getRoutes()) {
+            ManagedRouteMBean managedRoute = context.getExtension(ManagedCamelContext.class).getManagedRoute(route.getId());
+            if (managedRoute.getExchangesTotal() == 0) {
+                uncoveredRoutes.add(route.getId());
+            }
+
+            long routeCoveragePercentage = Math.round((double)managedRoute.getExchangesTotal() / contextExchangesTotal * 100);
+            routesSummary.append("\t\tRoute ").append(route.getId()).append(" total: ").append(managedRoute.getExchangesTotal()).append(" (").append(routeCoveragePercentage)
+                .append("%)\n");
+
+            if (server != null) {
+                List<ManagedProcessorMBean> processors = processorsForRoute.get(route.getId());
+                if (processors != null) {
+                    for (ManagedProcessorMBean managedProcessor : processors) {
+                        String processorId = managedProcessor.getProcessorId();
+                        long processorExchangesTotal = managedProcessor.getExchangesTotal();
+                        long processorCoveragePercentage = Math.round((double)processorExchangesTotal / contextExchangesTotal * 100);
+                        routesSummary.append("\t\t\tProcessor ").append(processorId).append(" total: ").append(processorExchangesTotal).append(" (")
+                            .append(processorCoveragePercentage).append("%)\n");
+                    }
+                }
+            }
+        }
+
+        int used = routes - uncoveredRoutes.size();
+
+        long contextPercentage = Math.round((double)used / routes * 100);
+        builder.append("\tRoute coverage: ").append(used).append(" out of ").append(routes).append(" routes used (").append(contextPercentage).append("%)\n");
+        builder.append("\t\tCamelContext (").append(managedCamelContext.getCamelId()).append(") total: ").append(contextExchangesTotal).append("\n");
+
+        if (uncoveredRoutes.size() > 0) {
+            builder.append("\t\tUncovered routes: ").append(uncoveredRoutes.stream().collect(Collectors.joining(", "))).append("\n");
+        }
+
+        builder.append(routesSummary);
+        log.info(builder.toString());
+    }
+
+    /**
+     * Groups all processors from Camel context by route id
+     */
+    private Map<String, List<ManagedProcessorMBean>> findProcessorsForEachRoute(MBeanServer server)
+        throws MalformedObjectNameException, MBeanException, AttributeNotFoundException, InstanceNotFoundException, ReflectionException {
+        String domain = context.getManagementStrategy().getManagementAgent().getMBeanServerDefaultDomain();
+
+        Map<String, List<ManagedProcessorMBean>> processorsForRoute = new HashMap<>();
+
+        ObjectName processorsObjectName = new ObjectName(domain + ":context=" + context.getManagementName() + ",type=processors,name=*");
+        Set<ObjectName> objectNames = server.queryNames(processorsObjectName, null);
+
+        for (ObjectName objectName : objectNames) {
+            String routeId = server.getAttribute(objectName, "RouteId").toString();
+            String name = objectName.getKeyProperty("name");
+            name = ObjectName.unquote(name);
+
+            ManagedProcessorMBean managedProcessor = context.getExtension(ManagedCamelContext.class).getManagedProcessor(name);
+
+            if (managedProcessor != null) {
+                if (processorsForRoute.get(routeId) == null) {
+                    List<ManagedProcessorMBean> processorsList = new ArrayList<>();
+                    processorsList.add(managedProcessor);
+
+                    processorsForRoute.put(routeId, processorsList);
+                } else {
+                    processorsForRoute.get(routeId).add(managedProcessor);
+                }
+            }
+        }
+
+        // sort processors by position in route definition
+        for (Map.Entry<String, List<ManagedProcessorMBean>> entry : processorsForRoute.entrySet()) {
+            Collections.sort(entry.getValue(), Comparator.comparing(ManagedProcessorMBean::getIndex));
+        }
+
+        return processorsForRoute;
+    }
+
+    /**
+     * Gathers test details as xml
+     */
+    private String gatherTestDetailsAsXml() {
+        StringBuilder sb = new StringBuilder();
+        sb.append("<test>\n");
+        sb.append("  <class>").append(getClass().getName()).append("</class>\n");
+        sb.append("  <method>").append(currentTestName).append("</method>\n");
+        sb.append("  <time>").append(timeTaken()).append("</time>\n");
+        sb.append("</test>\n");
+        return sb.toString();
+    }
+
+    /**
+     * Returns the timeout to use when shutting down (unit in seconds).
+     * <p/>
+     * Will default use 10 seconds.
+     *
+     * @return the timeout to use
+     */
+    protected int getShutdownTimeout() {
+        return 10;
+    }
+
+    /**
+     * Whether or not JMX should be used during testing.
+     *
+     * @return <tt>false</tt> by default.
+     */
+    protected boolean useJmx() {
+        return false;
+    }
+
+    /**
+     * Whether or not type converters should be lazy loaded (notice core
+     * converters is always loaded)
+     *
+     * @return <tt>false</tt> by default.
+     */
+    @Deprecated
+    protected boolean isLazyLoadingTypeConverter() {
+        return false;
+    }
+
+    /**
+     * Override this method to include and override properties with the Camel
+     * {@link PropertiesComponent}.
+     *
+     * @return additional properties to add/override.
+     */
+    protected Properties useOverridePropertiesWithPropertiesComponent() {
+        return null;
+    }
+
+    /**
+     * Whether to ignore missing locations with the {@link PropertiesComponent}.
+     * For example when unit testing you may want to ignore locations that are
+     * not available in the environment you use for testing.
+     *
+     * @return <tt>true</tt> to ignore, <tt>false</tt> to not ignore, and
+     *         <tt>null</tt> to leave as configured on the
+     *         {@link PropertiesComponent}
+     */
+    protected Boolean ignoreMissingLocationWithPropertiesComponent() {
+        return null;
+    }
+
+    protected void postProcessTest() throws Exception {
+        context = threadCamelContext.get();
+        template = threadTemplate.get();
+        fluentTemplate = threadFluentTemplate.get();
+        consumer = threadConsumer.get();
+        camelContextService = threadService.get();
+        applyCamelPostProcessor();
+    }
+
+    /**
+     * Applies the {@link DefaultCamelBeanPostProcessor} to this instance.
+     * Derived classes using IoC / DI frameworks may wish to turn this into a
+     * NoOp such as for CDI we would just use CDI to inject this
+     */
+    protected void applyCamelPostProcessor() throws Exception {
+        // use the default bean post processor from camel-core if the test class
+        // is not dependency injected already by Spring
+        boolean spring = hasClassAnnotation("org.springframework.boot.test.context.SpringBootTest", "org.springframework.context.annotation.ComponentScan");
+        if (!spring) {
+            DefaultCamelBeanPostProcessor processor = new DefaultCamelBeanPostProcessor(context);
+            processor.postProcessBeforeInitialization(this, getClass().getName());
+            processor.postProcessAfterInitialization(this, getClass().getName());
+        }
+    }
+
+    /**
+     * Does this test class have any of the following annotations on the
+     * class-level.
+     */
+    protected boolean hasClassAnnotation(String... names) {
+        for (String name : names) {
+            for (Annotation ann : getClass().getAnnotations()) {
+                String annName = ann.annotationType().getName();
+                if (annName.equals(name)) {
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
+
+    protected void stopCamelContext() throws Exception {
+        doStopCamelContext(context, camelContextService);
+    }
+
+    private static void doStopCamelContext(CamelContext context, Service camelContextService) throws Exception {
+        if (camelContextService != null) {
+            if (camelContextService == threadService.get()) {
+                threadService.remove();
+            }
+            camelContextService.stop();
+        } else {
+            if (context != null) {
+                if (context == threadCamelContext.get()) {
+                    threadCamelContext.remove();
+                }
+                context.stop();
+            }
+        }
+    }
+
+    private static void doStopTemplates(ConsumerTemplate consumer, ProducerTemplate template, FluentProducerTemplate fluentTemplate) throws Exception {
+        if (consumer != null) {
+            if (consumer == threadConsumer.get()) {
+                threadConsumer.remove();
+            }
+            consumer.stop();
+        }
+        if (template != null) {
+            if (template == threadTemplate.get()) {
+                threadTemplate.remove();
+            }
+            template.stop();
+        }
+        if (fluentTemplate != null) {
+            if (fluentTemplate == threadFluentTemplate.get()) {
+                threadFluentTemplate.remove();
+            }
+            fluentTemplate.stop();
+        }
+    }
+
+    protected void startCamelContext() throws Exception {
+        if (camelContextService != null) {
+            camelContextService.start();
+        } else {
+            if (context instanceof DefaultCamelContext) {
+                DefaultCamelContext defaultCamelContext = (DefaultCamelContext)context;
+                if (!defaultCamelContext.isStarted()) {
+                    defaultCamelContext.start();
+                }
+            } else {
+                context.start();
+            }
+        }
+    }
+
+    protected CamelContext createCamelContext() throws Exception {
+        // for backwards compatibility
+        Registry registry = createRegistry();
+        if (registry instanceof FakeJndiRegistry) {
+            boolean inUse = ((FakeJndiRegistry)registry).isInUse();
+            if (!inUse) {
+                registry = null;
+            }
+        }
+        if (registry != null) {
+            String msg = "createRegistry() from camel-test is deprecated. Use createCamelRegistry if you want to control which registry to use, however"
+                         + " if you need to bind beans to the registry then this is possible already with the bind method on registry,"
+                         + " and there is no need to override this method.";
+            LOG.warn(msg);
+        } else {
+            registry = createCamelRegistry();
+        }
+
+        CamelContext context;
+        if (registry != null) {
+            context = new DefaultCamelContext(registry);
+        } else {
+            context = new DefaultCamelContext();
+        }
+        return context;
+    }
+
+    /**
+     * Allows to bind custom beans to the Camel {@link Registry}.
+     */
+    protected void bindToRegistry(Registry registry) throws Exception {
+        // noop
+    }
+
+    /**
+     * Override to use a custom {@link Registry}. However if you need to bind
+     * beans to the registry then this is possible already with the bind method
+     * on registry," and there is no need to override this method.
+     */
+    protected Registry createCamelRegistry() throws Exception {
+        return null;
+    }
+
+    /**
+     * @deprecated use createCamelRegistry if you want to control which registry
+     *             to use, however if you need to bind beans to the registry
+     *             then this is possible already with the bind method on
+     *             registry, and there is no need to override this method.
+     */
+    @Deprecated
+    protected JndiRegistry createRegistry() throws Exception {
+        return new FakeJndiRegistry(createJndiContext());
+    }
+
+    /**
+     * @deprecated use createCamelRegistry if you want to control which registry
+     *             to use, however if you need to bind beans to the registry
+     *             then this is possible already with the bind method on
+     *             registry, and there is no need to use JndiRegistry and
+     *             override this method.
+     */
+    @Deprecated
+    protected Context createJndiContext() throws Exception {
+        LOG.warn("The method createJndiContext() in camel-test is deprecated. You can bind beans directly from Camel Registry instead");
+        Properties properties = new Properties();
+
+        // jndi.properties is optional
+        InputStream in = getClass().getClassLoader().getResourceAsStream("jndi.properties");
+        if (in != null) {
+            log.debug("Using jndi.properties from classpath root");
+            properties.load(in);
+        } else {
+            properties.put("java.naming.factory.initial", "org.apache.camel.support.jndi.CamelInitialContextFactory");
+        }
+        return new InitialContext(new Hashtable<>(properties));
+    }
+
+    private class FakeJndiRegistry extends JndiRegistry {
+
+        private boolean inUse;
+
+        public FakeJndiRegistry(Context context) {
+            super(context);
+        }
+
+        @Override
+        public void bind(String name, Object object) {
+            super.bind(name, object);
+            inUse = true;
+        }
+
+        public boolean isInUse() {
+            // only if the end user bind beans then its in use
+            return inUse;
+        }
+    }
+
+    /**
+     * Factory method which derived classes can use to create a
+     * {@link RouteBuilder} to define the routes for testing
+     */
+    protected RoutesBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() {
+                // no routes added by default
+            }
+        };
+    }
+
+    /**
+     * Factory method which derived classes can use to create an array of
+     * {@link org.apache.camel.builder.RouteBuilder}s to define the routes for
+     * testing
+     *
+     * @see #createRouteBuilder()
+     */
+    protected RoutesBuilder[] createRouteBuilders() throws Exception {
+        return new RoutesBuilder[] {createRouteBuilder()};
+    }
+
+    /**
+     * Resolves a mandatory endpoint for the given URI or an exception is thrown
+     *
+     * @param uri the Camel <a href="">URI</a> to use to create or resolve an
+     *            endpoint
+     * @return the endpoint
+     */
+    protected Endpoint resolveMandatoryEndpoint(String uri) {
+        return resolveMandatoryEndpoint(context, uri);
+    }
+
+    /**
+     * Resolves a mandatory endpoint for the given URI and expected type or an
+     * exception is thrown
+     *
+     * @param uri the Camel <a href="">URI</a> to use to create or resolve an
+     *            endpoint
+     * @return the endpoint
+     */
+    protected <T extends Endpoint> T resolveMandatoryEndpoint(String uri, Class<T> endpointType) {
+        return resolveMandatoryEndpoint(context, uri, endpointType);
+    }
+
+    /**
+     * Resolves the mandatory Mock endpoint using a URI of the form
+     * <code>mock:someName</code>
+     *
+     * @param uri the URI which typically starts with "mock:" and has some name
+     * @return the mandatory mock endpoint or an exception is thrown if it could
+     *         not be resolved
+     */
+    protected MockEndpoint getMockEndpoint(String uri) {
+        return getMockEndpoint(uri, true);
+    }
+
+    /**
+     * Resolves the {@link MockEndpoint} using a URI of the form
+     * <code>mock:someName</code>, optionally creating it if it does not exist.
+     *
+     * @param uri the URI which typically starts with "mock:" and has some name
+     * @param create whether or not to allow the endpoint to be created if it
+     *            doesn't exist
+     * @return the mock endpoint or an {@link NoSuchEndpointException} is thrown
+     *         if it could not be resolved
+     * @throws NoSuchEndpointException is the mock endpoint does not exists
+     */
+    protected MockEndpoint getMockEndpoint(String uri, boolean create) throws NoSuchEndpointException {
+        if (create) {
+            return resolveMandatoryEndpoint(uri, MockEndpoint.class);
+        } else {
+            Endpoint endpoint = context.hasEndpoint(uri);
+            if (endpoint instanceof MockEndpoint) {
+                return (MockEndpoint)endpoint;
+            }
+            throw new NoSuchEndpointException(String.format("MockEndpoint %s does not exist.", uri));
+        }
+    }
+
+    /**
+     * Sends a message to the given endpoint URI with the body value
+     *
+     * @param endpointUri the URI of the endpoint to send to
+     * @param body the body for the message
+     */
+    protected void sendBody(String endpointUri, final Object body) {
+        template.send(endpointUri, new Processor() {
+            public void process(Exchange exchange) {
+                Message in = exchange.getIn();
+                in.setBody(body);
+            }
+        });
+    }
+
+    /**
+     * Sends a message to the given endpoint URI with the body value and
+     * specified headers
+     *
+     * @param endpointUri the URI of the endpoint to send to
+     * @param body the body for the message
+     * @param headers any headers to set on the message
+     */
+    protected void sendBody(String endpointUri, final Object body, final Map<String, Object> headers) {
+        template.send(endpointUri, new Processor() {
+            public void process(Exchange exchange) {
+                Message in = exchange.getIn();
+                in.setBody(body);
+                for (Map.Entry<String, Object> entry : headers.entrySet()) {
+                    in.setHeader(entry.getKey(), entry.getValue());
+                }
+            }
+        });
+    }
+
+    /**
+     * Sends messages to the given endpoint for each of the specified bodies
+     *
+     * @param endpointUri the endpoint URI to send to
+     * @param bodies the bodies to send, one per message
+     */
+    protected void sendBodies(String endpointUri, Object... bodies) {
+        for (Object body : bodies) {
+            sendBody(endpointUri, body);
+        }
+    }
+
+    /**
+     * Creates an exchange with the given body
+     */
+    protected Exchange createExchangeWithBody(Object body) {
+        return createExchangeWithBody(context, body);
+    }
+
+    /**
+     * Asserts that the given language name and expression evaluates to the
+     * given value on a specific exchange
+     */
+    protected void assertExpression(Exchange exchange, String languageName, String expressionText, Object expectedValue) {
+        Language language = assertResolveLanguage(languageName);
+
+        Expression expression = language.createExpression(expressionText);
+        assertNotNull(expression, "No Expression could be created for text: " + expressionText + " language: " + language);
+
+        assertExpression(expression, exchange, expectedValue);
+    }
+
+    /**
+     * Asserts that the given language name and predicate expression evaluates
+     * to the expected value on the message exchange
+     */
+    protected void assertPredicate(String languageName, String expressionText, Exchange exchange, boolean expected) {
+        Language language = assertResolveLanguage(languageName);
+
+        Predicate predicate = language.createPredicate(expressionText);
+        assertNotNull(predicate, "No Predicate could be created for text: " + expressionText + " language: " + language);
+
+        assertPredicate(predicate, exchange, expected);
+    }
+
+    /**
+     * Asserts that the language name can be resolved
+     */
+    protected Language assertResolveLanguage(String languageName) {
+        Language language = context.resolveLanguage(languageName);
+        assertNotNull(language, "No language found for name: " + languageName);
+        return language;
+    }
+
+    /**
+     * Asserts that all the expectations of the Mock endpoints are valid
+     */
+    protected void assertMockEndpointsSatisfied() throws InterruptedException {
+        MockEndpoint.assertIsSatisfied(context);
+    }
+
+    /**
+     * Asserts that all the expectations of the Mock endpoints are valid
+     */
+    protected void assertMockEndpointsSatisfied(long timeout, TimeUnit unit) throws InterruptedException {
+        MockEndpoint.assertIsSatisfied(context, timeout, unit);
+    }
+
+    /**
+     * Reset all Mock endpoints.
+     */
+    protected void resetMocks() {
+        MockEndpoint.resetMocks(context);
+    }
+
+    protected void assertValidContext(CamelContext context) {
+        assertNotNull(context, "No context found!");
+    }
+
+    protected <T extends Endpoint> T getMandatoryEndpoint(String uri, Class<T> type) {
+        T endpoint = context.getEndpoint(uri, type);
+        assertNotNull(endpoint, "No endpoint found for uri: " + uri);
+        return endpoint;
+    }
+
+    protected Endpoint getMandatoryEndpoint(String uri) {
+        Endpoint endpoint = context.getEndpoint(uri);
+        assertNotNull(endpoint, "No endpoint found for uri: " + uri);
+        return endpoint;
+    }
+
+    /**
+     * Disables the JMX agent. Must be called before the {@link #setUp()}
+     * method.
+     */
+    protected void disableJMX() {
+        System.setProperty(JmxSystemPropertyKeys.DISABLED, "true");
+    }
+
+    /**
+     * Enables the JMX agent. Must be called before the {@link #setUp()} method.
+     */
+    protected void enableJMX() {
+        System.setProperty(JmxSystemPropertyKeys.DISABLED, "false");
+    }
+
+    /**
+     * Single step debugs and Camel invokes this method before entering the
+     * given processor
+     */
+    protected void debugBefore(Exchange exchange, Processor processor, ProcessorDefinition<?> definition, String id, String label) {
+    }
+
+    /**
+     * Single step debugs and Camel invokes this method after processing the
+     * given processor
+     */
+    protected void debugAfter(Exchange exchange, Processor processor, ProcessorDefinition<?> definition, String id, String label, long timeTaken) {
+    }
+
+    /**
+     * To easily debug by overriding the <tt>debugBefore</tt> and
+     * <tt>debugAfter</tt> methods.
+     */
+    private class DebugBreakpoint extends BreakpointSupport {
+
+        @Override
+        public void beforeProcess(Exchange exchange, Processor processor, NamedNode definition) {
+            CamelTestSupport.this.debugBefore(exchange, processor, (ProcessorDefinition)definition, definition.getId(), definition.getLabel());
+        }
+
+        @Override
+        public void afterProcess(Exchange exchange, Processor processor, NamedNode definition, long timeTaken) {
+            CamelTestSupport.this.debugAfter(exchange, processor, (ProcessorDefinition)definition, definition.getId(), definition.getLabel(), timeTaken);
+        }
+    }
+
+}
diff --git a/components/camel-test/src/main/java/org/apache/camel/test/junit5/TestSupport.java b/components/camel-test/src/main/java/org/apache/camel/test/junit5/TestSupport.java
new file mode 100644
index 0000000..a24ca42
--- /dev/null
+++ b/components/camel-test/src/main/java/org/apache/camel/test/junit5/TestSupport.java
@@ -0,0 +1,553 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5;
+
+import java.io.File;
+import java.util.Collection;
+import java.util.List;
+import java.util.Locale;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.Endpoint;
+import org.apache.camel.Exchange;
+import org.apache.camel.Expression;
+import org.apache.camel.InvalidPayloadException;
+import org.apache.camel.Message;
+import org.apache.camel.Predicate;
+import org.apache.camel.Route;
+import org.apache.camel.builder.Builder;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.builder.ValueBuilder;
+import org.apache.camel.impl.DefaultCamelContext;
+import org.apache.camel.support.DefaultExchange;
+import org.apache.camel.support.PredicateAssertHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+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;
+
+/**
+ * A bunch of useful testing methods
+ */
+public abstract class TestSupport {
+
+    protected static final String LS = System.lineSeparator();
+    private static final Logger LOG = LoggerFactory.getLogger(TestSupport.class);
+    protected Logger log = LoggerFactory.getLogger(getClass());
+
+    // Builder methods for expressions used when testing
+    // -------------------------------------------------------------------------
+
+    /**
+     * Returns a value builder for the given header
+     */
+    public static ValueBuilder header(String name) {
+        return Builder.header(name);
+    }
+
+    /**
+     * Returns a value builder for the given property
+     * 
+     * @deprecated use {@link #exchangeProperty(String)}
+     */
+    @Deprecated
+    public static ValueBuilder property(String name) {
+        return Builder.exchangeProperty(name);
+    }
+
+    /**
+     * Returns a value builder for the given exchange property
+     */
+    public static ValueBuilder exchangeProperty(String name) {
+        return Builder.exchangeProperty(name);
+    }
+
+    /**
+     * Returns a predicate and value builder for the inbound body on an exchange
+     */
+    public static ValueBuilder body() {
+        return Builder.body();
+    }
+
+    /**
+     * Returns a predicate and value builder for the inbound message body as a
+     * specific type
+     */
+    public static <T> ValueBuilder bodyAs(Class<T> type) {
+        return Builder.bodyAs(type);
+    }
+
+    /**
+     * Returns a value builder for the given system property
+     */
+    public static ValueBuilder systemProperty(String name) {
+        return Builder.systemProperty(name);
+    }
+
+    /**
+     * Returns a value builder for the given system property
+     */
+    public static ValueBuilder systemProperty(String name, String defaultValue) {
+        return Builder.systemProperty(name, defaultValue);
+    }
+
+    // Assertions
+    // -----------------------------------------------------------------------
+
+    public static <T> T assertIsInstanceOf(Class<T> expectedType, Object value) {
+        assertNotNull(value, "Expected an instance of type: " + expectedType.getName() + " but was null");
+        assertTrue(expectedType.isInstance(value), "Object should be of type " + expectedType.getName() + " but was: " + value + " with the type: " + value.getClass().getName());
+        return expectedType.cast(value);
+    }
+
+    public static void assertEndpointUri(Endpoint endpoint, String uri) {
+        assertNotNull(endpoint, "Endpoint is null when expecting endpoint for: " + uri);
+        assertEquals(uri, endpoint.getEndpointUri(), "Endpoint uri for: " + endpoint);
+    }
+
+    /**
+     * Asserts the In message on the exchange contains the expected value
+     */
+    public static Object assertInMessageHeader(Exchange exchange, String name, Object expected) {
+        return assertMessageHeader(exchange.getIn(), name, expected);
+    }
+
+    /**
+     * Asserts the Out message on the exchange contains the expected value
+     */
+    public static Object assertOutMessageHeader(Exchange exchange, String name, Object expected) {
+        return assertMessageHeader(exchange.getOut(), name, expected);
+    }
+
+    /**
+     * Asserts that the given exchange has an OUT message of the given body
+     * value
+     *
+     * @param exchange the exchange which should have an OUT message
+     * @param expected the expected value of the OUT message
+     * @throws InvalidPayloadException is thrown if the payload is not the
+     *             expected class type
+     */
+    public static void assertInMessageBodyEquals(Exchange exchange, Object expected) throws InvalidPayloadException {
+        assertNotNull(exchange, "Should have a response exchange!");
+
+        Object actual;
+        if (expected == null) {
+            actual = exchange.getIn().getMandatoryBody();
+            assertEquals(expected, actual, "in body of: " + exchange);
+        } else {
+            actual = exchange.getIn().getMandatoryBody(expected.getClass());
+        }
+        assertEquals(expected, actual, "in body of: " + exchange);
+
+        LOG.debug("Received response: " + exchange + " with in: " + exchange.getIn());
+    }
+
+    /**
+     * Asserts that the given exchange has an OUT message of the given body
+     * value
+     *
+     * @param exchange the exchange which should have an OUT message
+     * @param expected the expected value of the OUT message
+     * @throws InvalidPayloadException is thrown if the payload is not the
+     *             expected class type
+     */
+    public static void assertOutMessageBodyEquals(Exchange exchange, Object expected) throws InvalidPayloadException {
+        assertNotNull(exchange, "Should have a response exchange!");
+
+        Object actual;
+        if (expected == null) {
+            actual = exchange.getOut().getMandatoryBody();
+            assertEquals(expected, actual, "output body of: " + exchange);
+        } else {
+            actual = exchange.getOut().getMandatoryBody(expected.getClass());
+        }
+        assertEquals(expected, actual, "output body of: " + exchange);
+
+        LOG.debug("Received response: " + exchange + " with out: " + exchange.getOut());
+    }
+
+    public static Object assertMessageHeader(Message message, String name, Object expected) {
+        Object value = message.getHeader(name);
+        assertEquals(expected, value, "Header: " + name + " on Message: " + message);
+        return value;
+    }
+
+    /**
+     * Asserts that the given expression when evaluated returns the given answer
+     */
+    public static Object assertExpression(Expression expression, Exchange exchange, Object expected) {
+        Object value;
+        if (expected != null) {
+            value = expression.evaluate(exchange, expected.getClass());
+        } else {
+            value = expression.evaluate(exchange, Object.class);
+        }
+
+        LOG.debug("Evaluated expression: " + expression + " on exchange: " + exchange + " result: " + value);
+
+        assertEquals(expected, value, "Expression: " + expression + " on Exchange: " + exchange);
+        return value;
+    }
+
+    /**
+     * Asserts that the predicate returns the expected value on the exchange
+     */
+    public static void assertPredicateMatches(Predicate predicate, Exchange exchange) {
+        assertPredicate(predicate, exchange, true);
+    }
+
+    /**
+     * Asserts that the predicate returns the expected value on the exchange
+     */
+    public static void assertPredicateDoesNotMatch(Predicate predicate, Exchange exchange) {
+        try {
+            PredicateAssertHelper.assertMatches(predicate, "Predicate should match: ", exchange);
+        } catch (AssertionError e) {
+            LOG.debug("Caught expected assertion error: " + e);
+        }
+        assertPredicate(predicate, exchange, false);
+    }
+
+    /**
+     * Asserts that the predicate returns the expected value on the exchange
+     */
+    public static boolean assertPredicate(final Predicate predicate, Exchange exchange, boolean expected) {
+        if (expected) {
+            PredicateAssertHelper.assertMatches(predicate, "Predicate failed: ", exchange);
+        }
+        boolean value = predicate.matches(exchange);
+
+        LOG.debug("Evaluated predicate: " + predicate + " on exchange: " + exchange + " result: " + value);
+
+        assertEquals(expected, value, "Predicate: " + predicate + " on Exchange: " + exchange);
+        return value;
+    }
+
+    /**
+     * Resolves an endpoint and asserts that it is found
+     */
+    public static Endpoint resolveMandatoryEndpoint(CamelContext context, String uri) {
+        Endpoint endpoint = context.getEndpoint(uri);
+
+        assertNotNull(endpoint, "No endpoint found for URI: " + uri);
+
+        return endpoint;
+    }
+
+    /**
+     * Resolves an endpoint and asserts that it is found
+     */
+    public static <T extends Endpoint> T resolveMandatoryEndpoint(CamelContext context, String uri, Class<T> endpointType) {
+        T endpoint = context.getEndpoint(uri, endpointType);
+
+        assertNotNull(endpoint, "No endpoint found for URI: " + uri);
+
+        return endpoint;
+    }
+
+    /**
+     * Creates an exchange with the given body
+     */
+    protected Exchange createExchangeWithBody(CamelContext camelContext, Object body) {
+        Exchange exchange = new DefaultExchange(camelContext);
+        Message message = exchange.getIn();
+        message.setHeader("testClass", getClass().getName());
+        message.setBody(body);
+        return exchange;
+    }
+
+    public static <T> T assertOneElement(List<T> list) {
+        assertEquals(1, list.size(), "Size of list should be 1: " + list);
+        return list.get(0);
+    }
+
+    /**
+     * Asserts that a list is of the given size
+     */
+    public static <T> List<T> assertListSize(List<T> list, int size) {
+        return assertListSize("List", list, size);
+    }
+
+    /**
+     * Asserts that a list is of the given size
+     */
+    public static <T> List<T> assertListSize(String message, List<T> list, int size) {
+        assertEquals(size, list.size(), message + " should be of size: " + size + " but is: " + list);
+        return list;
+    }
+
+    /**
+     * Asserts that a list is of the given size
+     */
+    public static <T> Collection<T> assertCollectionSize(Collection<T> list, int size) {
+        return assertCollectionSize("List", list, size);
+    }
+
+    /**
+     * Asserts that a list is of the given size
+     */
+    public static <T> Collection<T> assertCollectionSize(String message, Collection<T> list, int size) {
+        assertEquals(size, list.size(), message + " should be of size: " + size + " but is: " + list);
+        return list;
+    }
+
+    /**
+     * A helper method to create a list of Route objects for a given route
+     * builder
+     */
+    public static List<Route> getRouteList(RouteBuilder builder) throws Exception {
+        CamelContext context = new DefaultCamelContext();
+        context.addRoutes(builder);
+        context.start();
+        List<Route> answer = context.getRoutes();
+        context.stop();
+        return answer;
+    }
+
+    /**
+     * Asserts that the text contains the given string
+     *
+     * @param text the text to compare
+     * @param containedText the text which must be contained inside the other
+     *            text parameter
+     */
+    public static void assertStringContains(String text, String containedText) {
+        assertNotNull("Text should not be null!", text);
+        assertTrue(text.contains(containedText), "Text: " + text + " does not contain: " + containedText);
+    }
+
+    /**
+     * Recursively delete a directory, useful to zapping test data
+     *
+     * @param file the directory to be deleted
+     * @return <tt>false</tt> if error deleting directory
+     */
+    public static boolean deleteDirectory(String file) {
+        return deleteDirectory(new File(file));
+    }
+
+    /**
+     * Recursively delete a directory, useful to zapping test data
+     *
+     * @param file the directory to be deleted
+     * @return <tt>false</tt> if error deleting directory
+     */
+    public static boolean deleteDirectory(File file) {
+        int tries = 0;
+        int maxTries = 5;
+        boolean exists = true;
+        while (exists && (tries < maxTries)) {
+            recursivelyDeleteDirectory(file);
+            tries++;
+            exists = file.exists();
+            if (exists) {
+                try {
+                    Thread.sleep(1000);
+                } catch (InterruptedException e) {
+                    // Ignore
+                }
+            }
+        }
+        return !exists;
+    }
+
+    private static void recursivelyDeleteDirectory(File file) {
+        if (!file.exists()) {
+            return;
+        }
+
+        if (file.isDirectory()) {
+            File[] files = file.listFiles();
+            for (File child : files) {
+                recursivelyDeleteDirectory(child);
+            }
+        }
+        boolean success = file.delete();
+        if (!success) {
+            LOG.warn("Deletion of file: " + file.getAbsolutePath() + " failed");
+        }
+    }
+
+    /**
+     * create the directory
+     *
+     * @param file the directory to be created
+     */
+    public static void createDirectory(String file) {
+        File dir = new File(file);
+        dir.mkdirs();
+    }
+
+    /**
+     * To be used for folder/directory comparison that works across different
+     * platforms such as Window, Mac and Linux.
+     */
+    public static void assertDirectoryEquals(String expected, String actual) {
+        assertDirectoryEquals(null, expected, actual);
+    }
+
+    /**
+     * To be used for folder/directory comparison that works across different
+     * platforms such as Window, Mac and Linux.
+     */
+    public static void assertDirectoryEquals(String message, String expected, String actual) {
+        // must use single / as path separators
+        String expectedPath = expected.replace('\\', '/');
+        String actualPath = actual.replace('\\', '/');
+
+        if (message != null) {
+            assertEquals(message, expectedPath, actualPath);
+        } else {
+            assertEquals(expectedPath, actualPath);
+        }
+    }
+
+    /**
+     * To be used to check is a directory is found in the file system
+     */
+    public static void assertDirectoryExists(String filename) {
+        File file = new File(filename);
+        assertTrue(file.exists(), "Directory " + filename + " should exist");
+        assertTrue(file.isDirectory(), "Directory " + filename + " should be a directory");
+    }
+
+    /**
+     * To be used to check is a file is found in the file system
+     */
+    public static void assertFileExists(String filename) {
+        File file = new File(filename);
+        assertTrue(file.exists(), "File " + filename + " should exist");
+        assertTrue(file.isFile(), "File " + filename + " should be a file");
+    }
+
+    /**
+     * To be used to check is a file is <b>not</b> found in the file system
+     */
+    public static void assertFileNotExists(String filename) {
+        File file = new File(filename);
+        assertFalse(file.exists(), "File " + filename + " should not exist");
+    }
+
+    /**
+     * Is this OS the given platform.
+     * <p/>
+     * Uses <tt>os.name</tt> from the system properties to determine the OS.
+     *
+     * @param platform such as Windows
+     * @return <tt>true</tt> if its that platform.
+     */
+    public static boolean isPlatform(String platform) {
+        String osName = System.getProperty("os.name").toLowerCase(Locale.US);
+        return osName.contains(platform.toLowerCase(Locale.US));
+    }
+
+    /**
+     * Is this Java by the given vendor.
+     * <p/>
+     * Uses <tt>java.vendor</tt> from the system properties to determine the
+     * vendor.
+     *
+     * @param vendor such as IBM
+     * @return <tt>true</tt> if its that vendor.
+     */
+    public static boolean isJavaVendor(String vendor) {
+        String javaVendor = System.getProperty("java.vendor").toLowerCase(Locale.US);
+        return javaVendor.contains(vendor.toLowerCase(Locale.US));
+    }
+
+    /**
+     * Is this Java 1.5
+     *
+     * @return <tt>true</tt> if its Java 1.5, <tt>false</tt> if its not (for
+     *         example Java 1.6 or better)
+     * @deprecated will be removed in the future as Camel requires JDK1.8+
+     */
+    @Deprecated
+    public static boolean isJava15() {
+        return getJavaMajorVersion() == 5;
+    }
+
+    /**
+     * Is this Java 1.6
+     *
+     * @return <tt>true</tt> if its Java 1.6, <tt>false</tt> if its not (for
+     *         example Java 1.7 or better)
+     * @deprecated will be removed in the future as Camel requires JDK1.8+
+     */
+    @Deprecated
+    public static boolean isJava16() {
+        return getJavaMajorVersion() == 6;
+
+    }
+
+    /**
+     * Is this Java 1.7
+     *
+     * @return <tt>true</tt> if its Java 1.7, <tt>false</tt> if its not (for
+     *         example Java 1.6 or older)
+     * @deprecated will be removed in the future as Camel requires JDK1.8+
+     */
+    @Deprecated
+    public static boolean isJava17() {
+        return getJavaMajorVersion() == 7;
+
+    }
+
+    /**
+     * Is this Java 1.8
+     *
+     * @return <tt>true</tt> if its Java 1.8, <tt>false</tt> if its not (for
+     *         example Java 1.7 or older)
+     */
+    public static boolean isJava18() {
+        return getJavaMajorVersion() == 8;
+
+    }
+
+    /**
+     * Is this Java 1.9
+     *
+     * @return <tt>true</tt> if its Java 1.9, <tt>false</tt> if its not (for
+     *         example Java 1.8 or older)
+     */
+    public static boolean isJava19() {
+        return getJavaMajorVersion() == 9;
+
+    }
+
+    /**
+     * Returns the current major Java version e.g 8.
+     * <p/>
+     * Uses <tt>java.specification.version</tt> from the system properties to
+     * determine the major version.
+     * 
+     * @return the current major Java version.
+     */
+    public static int getJavaMajorVersion() {
+        String javaSpecVersion = System.getProperty("java.specification.version");
+        if (javaSpecVersion.contains(".")) { // before jdk 9
+            return Integer.parseInt(javaSpecVersion.split("\\.")[1]);
+        } else {
+            return Integer.parseInt(javaSpecVersion);
+        }
+    }
+
+}
diff --git a/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/AdviceWithNotStartedTest.java b/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/AdviceWithNotStartedTest.java
new file mode 100644
index 0000000..55e0a54
--- /dev/null
+++ b/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/AdviceWithNotStartedTest.java
@@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.patterns;
+
+import java.util.concurrent.RejectedExecutionException;
+
+import org.apache.camel.CamelExecutionException;
+import org.apache.camel.RoutesBuilder;
+import org.apache.camel.builder.AdviceWithRouteBuilder;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.reifier.RouteReifier;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.fail;
+
+public class AdviceWithNotStartedTest extends CamelTestSupport {
+
+    @Override
+    public boolean isUseAdviceWith() {
+        return true;
+    }
+
+    @Test
+    public void testNotStarted() throws Exception {
+        RouteReifier.adviceWith(context.getRouteDefinition("foo"), context, new AdviceWithRouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+                weaveAddLast().to("mock:result");
+            }
+        });
+
+        getMockEndpoint("mock:result").expectedMessageCount(1);
+
+        try {
+            template.sendBody("direct:start", "Hello World");
+            fail("Should throw exception");
+        } catch (CamelExecutionException e) {
+            assertIsInstanceOf(RejectedExecutionException.class, e.getCause());
+        }
+
+        // start Camel
+        context.start();
+
+        template.sendBody("direct:start", "Bye World");
+
+        assertMockEndpointsSatisfied();
+    }
+
+    @Override
+    protected RoutesBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+                from("direct:start").routeId("foo")
+                        .to("log:foo");
+            }
+        };
+    }
+}
diff --git a/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/AsyncSendMockTest.java b/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/AsyncSendMockTest.java
new file mode 100644
index 0000000..f1f8ca9
--- /dev/null
+++ b/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/AsyncSendMockTest.java
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.patterns;
+
+import org.apache.camel.support.DefaultExchange;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+public class AsyncSendMockTest extends CamelTestSupport {
+    @Override
+    public String isMockEndpoints() {
+        return "seda*";
+    }
+
+    @Test
+    public void testmakeAsyncApiCall() {
+        try {
+            getMockEndpoint("mock:seda:start").expectedHeaderReceived("username", "admin123");
+            getMockEndpoint("mock:seda:start").expectedBodiesReceived("Hello");
+            DefaultExchange dfex = new DefaultExchange(context);
+            dfex.getIn().setHeader("username", "admin123");
+            dfex.getIn().setHeader("password", "admin");
+            dfex.getIn().setBody("Hello");
+            template.asyncSend("seda:start", dfex);
+            assertMockEndpointsSatisfied();
+        } catch (Exception e) {
+            e.printStackTrace();
+            assertTrue(false, "Failed to make async call to api");
+        }
+    }
+}
diff --git a/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/DebugJUnit5Test.java b/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/DebugJUnit5Test.java
new file mode 100644
index 0000000..0d6c600
--- /dev/null
+++ b/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/DebugJUnit5Test.java
@@ -0,0 +1,86 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.patterns;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.model.ProcessorDefinition;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.Test;
+
+public class DebugJUnit5Test extends CamelTestSupport {
+
+    // START SNIPPET: e1
+    @Override
+    public boolean isUseDebugger() {
+        // must enable debugger
+        return true;
+    }
+
+    @Override
+    protected void debugBefore(Exchange exchange, Processor processor,
+                               ProcessorDefinition<?> definition, String id, String shortName) {
+        // this method is invoked before we are about to enter the given processor
+        // from your Java editor you can just add a breakpoint in the code line below
+        log.info("Before " + definition + " with body " + exchange.getIn().getBody());
+    }
+    // END SNIPPET: e1
+
+    @Test
+    public void testDebugger() throws Exception {
+        // set mock expectations
+        getMockEndpoint("mock:a").expectedMessageCount(1);
+        getMockEndpoint("mock:b").expectedMessageCount(1);
+
+        // send a message
+        template.sendBody("direct:start", "World");
+
+        // assert mocks
+        assertMockEndpointsSatisfied();
+    }
+
+    @Test
+    public void testTwo() throws Exception {
+        // set mock expectations
+        getMockEndpoint("mock:a").expectedMessageCount(2);
+        getMockEndpoint("mock:b").expectedMessageCount(2);
+
+        // send a message
+        template.sendBody("direct:start", "World");
+        template.sendBody("direct:start", "Camel");
+
+        // assert mocks
+        assertMockEndpointsSatisfied();
+    }
+
+    // START SNIPPET: e2
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+                // this is the route we want to debug
+                from("direct:start")
+                    .to("mock:a")
+                    .transform(body().prepend("Hello "))
+                    .to("mock:b");
+            }
+        };
+    }
+    // END SNIPPET: e2
+}
diff --git a/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/DebugNoLazyTypeConverterTest.java b/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/DebugNoLazyTypeConverterTest.java
new file mode 100644
index 0000000..0aac087
--- /dev/null
+++ b/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/DebugNoLazyTypeConverterTest.java
@@ -0,0 +1,91 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.patterns;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.model.ProcessorDefinition;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.Test;
+
+public class DebugNoLazyTypeConverterTest extends CamelTestSupport {
+
+    @Override
+    protected boolean isLazyLoadingTypeConverter() {
+        return false;
+    }
+
+    // START SNIPPET: e1
+    @Override
+    public boolean isUseDebugger() {
+        // must enable debugger
+        return true;
+    }
+
+    @Override
+    protected void debugBefore(Exchange exchange, Processor processor,
+                               ProcessorDefinition<?> definition, String id, String shortName) {
+        // this method is invoked before we are about to enter the given processor
+        // from your Java editor you can just add a breakpoint in the code line below
+        log.info("Before " + definition + " with body " + exchange.getIn().getBody());
+    }
+    // END SNIPPET: e1
+
+    @Test
+    public void testDebugger() throws Exception {
+        // set mock expectations
+        getMockEndpoint("mock:a").expectedMessageCount(1);
+        getMockEndpoint("mock:b").expectedMessageCount(1);
+
+        // send a message
+        template.sendBody("direct:start", "World");
+
+        // assert mocks
+        assertMockEndpointsSatisfied();
+    }
+
+    @Test
+    public void testTwo() throws Exception {
+        // set mock expectations
+        getMockEndpoint("mock:a").expectedMessageCount(2);
+        getMockEndpoint("mock:b").expectedMessageCount(2);
+
+        // send a message
+        template.sendBody("direct:start", "World");
+        template.sendBody("direct:start", "Camel");
+
+        // assert mocks
+        assertMockEndpointsSatisfied();
+    }
+
+    // START SNIPPET: e2
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+                // this is the route we want to debug
+                from("direct:start")
+                    .to("mock:a")
+                    .transform(body().prepend("Hello "))
+                    .to("mock:b");
+            }
+        };
+    }
+    // END SNIPPET: e2
+}
diff --git a/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/DebugTest.java b/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/DebugTest.java
new file mode 100644
index 0000000..401bdac
--- /dev/null
+++ b/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/DebugTest.java
@@ -0,0 +1,86 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.patterns;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.model.ProcessorDefinition;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.Test;
+
+public class DebugTest extends CamelTestSupport {
+
+    // START SNIPPET: e1
+    @Override
+    public boolean isUseDebugger() {
+        // must enable debugger
+        return true;
+    }
+
+    @Override
+    protected void debugBefore(Exchange exchange, Processor processor,
+                               ProcessorDefinition<?> definition, String id, String shortName) {
+        // this method is invoked before we are about to enter the given processor
+        // from your Java editor you can just add a breakpoint in the code line below
+        log.info("Before " + definition + " with body " + exchange.getIn().getBody());
+    }
+    // END SNIPPET: e1
+
+    @Test
+    public void testDebugger() throws Exception {
+        // set mock expectations
+        getMockEndpoint("mock:a").expectedMessageCount(1);
+        getMockEndpoint("mock:b").expectedMessageCount(1);
+
+        // send a message
+        template.sendBody("direct:start", "World");
+
+        // assert mocks
+        assertMockEndpointsSatisfied();
+    }
+
+    @Test
+    public void testTwo() throws Exception {
+        // set mock expectations
+        getMockEndpoint("mock:a").expectedMessageCount(2);
+        getMockEndpoint("mock:b").expectedMessageCount(2);
+
+        // send a message
+        template.sendBody("direct:start", "World");
+        template.sendBody("direct:start", "Camel");
+
+        // assert mocks
+        assertMockEndpointsSatisfied();
+    }
+
+    // START SNIPPET: e2
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+                // this is the route we want to debug
+                from("direct:start")
+                    .to("mock:a")
+                    .transform(body().prepend("Hello "))
+                    .to("mock:b");
+            }
+        };
+    }
+    // END SNIPPET: e2
+}
diff --git a/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/FilterCreateCamelContextPerClassTest.java b/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/FilterCreateCamelContextPerClassTest.java
new file mode 100644
index 0000000..37144bc
--- /dev/null
+++ b/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/FilterCreateCamelContextPerClassTest.java
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.patterns;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.Test;
+
+/**
+ * Tests filtering using Camel Test
+ */
+// START SNIPPET: example
+public class FilterCreateCamelContextPerClassTest extends CamelTestSupport {
+
+    @Override
+    public boolean isCreateCamelContextPerClass() {
+        // we override this method and return true, to tell Camel test-kit that
+        // it should only create CamelContext once (per class), so we will
+        // re-use the CamelContext between each test method in this class
+        return true;
+    }
+
+    @Test
+    public void testSendMatchingMessage() throws Exception {
+        String expectedBody = "<matched/>";
+
+        getMockEndpoint("mock:result").expectedBodiesReceived(expectedBody);
+
+        template.sendBodyAndHeader("direct:start", expectedBody, "foo", "bar");
+
+        assertMockEndpointsSatisfied();
+    }
+
+    @Test
+    public void testSendNotMatchingMessage() throws Exception {
+        getMockEndpoint("mock:result").expectedMessageCount(0);
+
+        template.sendBodyAndHeader("direct:start", "<notMatched/>", "foo", "notMatchedHeaderValue");
+
+        assertMockEndpointsSatisfied();
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() {
+        return new RouteBuilder() {
+            public void configure() {
+                from("direct:start").filter(header("foo").isEqualTo("bar")).to("mock:result");
+            }
+        };
+    }
+}
\ No newline at end of file
diff --git a/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/FilterFluentTemplateTest.java b/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/FilterFluentTemplateTest.java
new file mode 100644
index 0000000..e4cef04
--- /dev/null
+++ b/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/FilterFluentTemplateTest.java
@@ -0,0 +1,75 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.patterns;
+
+import org.apache.camel.EndpointInject;
+import org.apache.camel.FluentProducerTemplate;
+import org.apache.camel.Produce;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.Test;
+
+/**
+ * Tests filtering using Camel Test
+ */
+// START SNIPPET: example
+// tag::example[]
+public class FilterFluentTemplateTest extends CamelTestSupport {
+
+    @EndpointInject("mock:result")
+    protected MockEndpoint resultEndpoint;
+
+    @Produce("direct:start")
+    protected FluentProducerTemplate fluentTemplate;
+
+    @Override
+    public boolean isDumpRouteCoverage() {
+        return true;
+    }
+
+    @Test
+    public void testSendMatchingMessage() throws Exception {
+        String expectedBody = "<matched/>";
+
+        resultEndpoint.expectedBodiesReceived(expectedBody);
+
+        fluentTemplate.withBody(expectedBody).withHeader("foo", "bar").send();
+
+        resultEndpoint.assertIsSatisfied();
+    }
+
+    @Test
+    public void testSendNotMatchingMessage() throws Exception {
+        resultEndpoint.expectedMessageCount(0);
+
+        fluentTemplate.withBody("<notMatched/>").withHeader("foo", "notMatchedHeaderValue").send();
+
+        resultEndpoint.assertIsSatisfied();
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() {
+        return new RouteBuilder() {
+            public void configure() {
+                from("direct:start").filter(header("foo").isEqualTo("bar")).to("mock:result");
+            }
+        };
+    }
+}
+// end::example[]
+// END SNIPPET: example
diff --git a/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/FilterJUnit5Test.java b/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/FilterJUnit5Test.java
new file mode 100644
index 0000000..e946d6b
--- /dev/null
+++ b/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/FilterJUnit5Test.java
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.patterns;
+
+import org.apache.camel.EndpointInject;
+import org.apache.camel.Produce;
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.Test;
+
+/**
+ * Tests filtering using Camel Test
+ */
+// START SNIPPET: example
+public class FilterJUnit5Test extends CamelTestSupport {
+
+    @EndpointInject("mock:result")
+    protected MockEndpoint resultEndpoint;
+
+    @Produce("direct:start")
+    protected ProducerTemplate template;
+
+    @Test
+    public void testSendMatchingMessage() throws Exception {
+        String expectedBody = "<matched/>";
+
+        resultEndpoint.expectedBodiesReceived(expectedBody);
+
+        template.sendBodyAndHeader(expectedBody, "foo", "bar");
+
+        resultEndpoint.assertIsSatisfied();
+    }
+
+    @Test
+    public void testSendNotMatchingMessage() throws Exception {
+        resultEndpoint.expectedMessageCount(0);
+
+        template.sendBodyAndHeader("<notMatched/>", "foo", "notMatchedHeaderValue");
+
+        resultEndpoint.assertIsSatisfied();
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() {
+        return new RouteBuilder() {
+            public void configure() {
+                from("direct:start").filter(header("foo").isEqualTo("bar")).to("mock:result");
+            }
+        };
+    }
+
+}
+// END SNIPPET: example
diff --git a/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/FilterTest.java b/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/FilterTest.java
new file mode 100644
index 0000000..a2455ce
--- /dev/null
+++ b/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/FilterTest.java
@@ -0,0 +1,75 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.patterns;
+
+import org.apache.camel.EndpointInject;
+import org.apache.camel.Produce;
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.Test;
+
+/**
+ * Tests filtering using Camel Test
+ */
+// START SNIPPET: example
+// tag::example[]
+public class FilterTest extends CamelTestSupport {
+
+    @EndpointInject("mock:result")
+    protected MockEndpoint resultEndpoint;
+
+    @Produce("direct:start")
+    protected ProducerTemplate template;
+
+    @Override
+    public boolean isDumpRouteCoverage() {
+        return true;
+    }
+
+    @Test
+    public void testSendMatchingMessage() throws Exception {
+        String expectedBody = "<matched/>";
+
+        resultEndpoint.expectedBodiesReceived(expectedBody);
+
+        template.sendBodyAndHeader(expectedBody, "foo", "bar");
+
+        resultEndpoint.assertIsSatisfied();
+    }
+
+    @Test
+    public void testSendNotMatchingMessage() throws Exception {
+        resultEndpoint.expectedMessageCount(0);
+
+        template.sendBodyAndHeader("<notMatched/>", "foo", "notMatchedHeaderValue");
+
+        resultEndpoint.assertIsSatisfied();
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() {
+        return new RouteBuilder() {
+            public void configure() {
+                from("direct:start").filter(header("foo").isEqualTo("bar")).to("mock:result");
+            }
+        };
+    }
+}
+// end::example[]
+// END SNIPPET: example
diff --git a/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/IsMockEndpointsAndSkipJUnit5Test.java b/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/IsMockEndpointsAndSkipJUnit5Test.java
new file mode 100644
index 0000000..11c4bea
--- /dev/null
+++ b/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/IsMockEndpointsAndSkipJUnit5Test.java
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.patterns;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.seda.SedaEndpoint;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+// START SNIPPET: e1
+// tag::e1[]
+public class IsMockEndpointsAndSkipJUnit5Test extends CamelTestSupport {
+
+    @Override
+    public String isMockEndpointsAndSkip() {
+        // override this method and return the pattern for which endpoints to mock,
+        // and skip sending to the original endpoint.
+        return "direct:foo";
+    }
+
+    @Test
+    public void testMockEndpointAndSkip() throws Exception {
+        // notice we have automatic mocked the direct:foo endpoints and the name of the endpoints is "mock:uri"
+        getMockEndpoint("mock:result").expectedBodiesReceived("Hello World");
+        getMockEndpoint("mock:direct:foo").expectedMessageCount(1);
+
+        template.sendBody("direct:start", "Hello World");
+
+        assertMockEndpointsSatisfied();
+
+        // the message was not send to the direct:foo route and thus not sent to the seda endpoint
+        SedaEndpoint seda = context.getEndpoint("seda:foo", SedaEndpoint.class);
+        assertEquals(0, seda.getCurrentQueueSize());
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+                from("direct:start").to("direct:foo").to("mock:result");
+
+                from("direct:foo").transform(constant("Bye World")).to("seda:foo");
+            }
+        };
+    }
+}
+// end::e1[]
+// END SNIPPET: e1
diff --git a/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/IsMockEndpointsFileTest.java b/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/IsMockEndpointsFileTest.java
new file mode 100644
index 0000000..6bedaa2
--- /dev/null
+++ b/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/IsMockEndpointsFileTest.java
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.patterns;
+import org.apache.camel.Exchange;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+public class IsMockEndpointsFileTest extends CamelTestSupport {
+
+    @Override
+    @BeforeEach
+    public void setUp() throws Exception {
+        deleteDirectory("target/input");
+        deleteDirectory("target/messages");
+        super.setUp();
+    }
+
+    @Override
+    public String isMockEndpoints() {
+        // override this method and return the pattern for which endpoints to mock.
+        return "file:target*";
+    }
+
+    @Test
+    public void testMockFileEndpoints() throws Exception {
+        // notice we have automatic mocked all endpoints and the name of the endpoints is "mock:uri"
+        MockEndpoint camel = getMockEndpoint("mock:file:target/messages/camel");
+        camel.expectedMessageCount(1);
+
+        MockEndpoint other = getMockEndpoint("mock:file:target/messages/others");
+        other.expectedMessageCount(1);
+
+        template.sendBodyAndHeader("file:target/input", "Hello Camel", Exchange.FILE_NAME, "camel.txt");
+        template.sendBodyAndHeader("file:target/input", "Hello World", Exchange.FILE_NAME, "world.txt");
+
+        assertMockEndpointsSatisfied();
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+                from("file:target/input")
+                    .choice()
+                        .when(bodyAs(String.class).contains("Camel")).to("file:target/messages/camel")
+                        .otherwise().to("file:target/messages/others");
+            }
+        };
+    }
+}
diff --git a/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/IsMockEndpointsJUnit5Test.java b/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/IsMockEndpointsJUnit5Test.java
new file mode 100644
index 0000000..e8a9e27
--- /dev/null
+++ b/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/IsMockEndpointsJUnit5Test.java
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.patterns;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+
+// START SNIPPET: e1
+// tag::e1[]
+public class IsMockEndpointsJUnit5Test extends CamelTestSupport {
+
+    @Override
+    public String isMockEndpoints() {
+        // override this method and return the pattern for which endpoints to mock.
+        // use * to indicate all
+        return "*";
+    }
+
+    @Test
+    public void testMockAllEndpoints() throws Exception {
+        // notice we have automatic mocked all endpoints and the name of the endpoints is "mock:uri"
+        getMockEndpoint("mock:direct:start").expectedBodiesReceived("Hello World");
+        getMockEndpoint("mock:direct:foo").expectedBodiesReceived("Hello World");
+        getMockEndpoint("mock:log:foo").expectedBodiesReceived("Bye World");
+        getMockEndpoint("mock:result").expectedBodiesReceived("Bye World");
+
+        template.sendBody("direct:start", "Hello World");
+
+        assertMockEndpointsSatisfied();
+
+        // additional test to ensure correct endpoints in registry
+        assertNotNull(context.hasEndpoint("direct:start"));
+        assertNotNull(context.hasEndpoint("direct:foo"));
+        assertNotNull(context.hasEndpoint("log:foo"));
+        assertNotNull(context.hasEndpoint("mock:result"));
+        // all the endpoints was mocked
+        assertNotNull(context.hasEndpoint("mock:direct:start"));
+        assertNotNull(context.hasEndpoint("mock:direct:foo"));
+        assertNotNull(context.hasEndpoint("mock:log:foo"));
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+                from("direct:start").to("direct:foo").to("log:foo").to("mock:result");
+
+                from("direct:foo").transform(constant("Bye World"));
+            }
+        };
+    }
+}
+// end::e1[]
+// END SNIPPET: e1
diff --git a/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/IsMockEndpointsTest.java b/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/IsMockEndpointsTest.java
new file mode 100644
index 0000000..9bc4707
--- /dev/null
+++ b/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/IsMockEndpointsTest.java
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.patterns;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+
+public class IsMockEndpointsTest extends CamelTestSupport {
+
+    @Override
+    public String isMockEndpoints() {
+        return "*";
+    }
+    
+    @Test
+    public void testMockAllEndpoints() throws Exception {
+        getMockEndpoint("mock:direct:start").expectedBodiesReceived("Hello World");
+        getMockEndpoint("mock:direct:foo").expectedBodiesReceived("Hello World");
+        getMockEndpoint("mock:log:foo").expectedBodiesReceived("Bye World");
+        getMockEndpoint("mock:result").expectedBodiesReceived("Bye World");
+
+        template.sendBody("direct:start", "Hello World");
+
+        assertMockEndpointsSatisfied();
+
+        // additional test to ensure correct endpoints in registry
+        assertNotNull(context.hasEndpoint("direct:start"));
+        assertNotNull(context.hasEndpoint("direct:foo"));
+        assertNotNull(context.hasEndpoint("log:foo"));
+        assertNotNull(context.hasEndpoint("mock:result"));
+        // all the endpoints was mocked
+        assertNotNull(context.hasEndpoint("mock:direct:start"));
+        assertNotNull(context.hasEndpoint("mock:direct:foo"));
+        assertNotNull(context.hasEndpoint("mock:log:foo"));
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+                from("direct:start").to("direct:foo").to("log:foo").to("mock:result");
+
+                from("direct:foo").transform(constant("Bye World"));
+            }
+        };
+    }
+}
diff --git a/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/MockEndpointFailNoHeaderTest.java b/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/MockEndpointFailNoHeaderTest.java
new file mode 100644
index 0000000..8746df2
--- /dev/null
+++ b/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/MockEndpointFailNoHeaderTest.java
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.patterns;
+
+import org.apache.camel.EndpointInject;
+import org.apache.camel.Produce;
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.Test;
+
+public class MockEndpointFailNoHeaderTest extends CamelTestSupport {
+
+    @EndpointInject("mock:result")
+    protected MockEndpoint resultEndpoint;
+
+    @Produce("direct:start")
+    protected ProducerTemplate template;
+
+    @Override
+    public boolean isDumpRouteCoverage() {
+        return true;
+    }
+
+    @Test
+    public void withHeaderTestCase() throws InterruptedException {
+        String expectedBody = "<matched/>";
+        resultEndpoint.expectedHeaderReceived("foo", "bar");
+        template.sendBodyAndHeader(expectedBody, "foo", "bar");
+        resultEndpoint.assertIsSatisfied();
+    }
+
+    @Test
+    public void noHeaderTestCase() throws InterruptedException {
+        resultEndpoint.expectedHeaderReceived("foo", "bar");
+        resultEndpoint.setResultWaitTime(1); // speedup test
+        resultEndpoint.assertIsNotSatisfied();
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() {
+        return new RouteBuilder() {
+            public void configure() {
+                from("direct:start").filter(header("foo").isEqualTo("bar")).to("mock:result");
+            }
+        };
+    }
+}
diff --git a/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/MyProduceBean.java b/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/MyProduceBean.java
new file mode 100644
index 0000000..95d7263
--- /dev/null
+++ b/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/MyProduceBean.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.patterns;
+
+import org.apache.camel.Produce;
+
+/**
+ *
+ */
+public class MyProduceBean {
+
+    @Produce("mock:result")
+    MySender sender;
+
+    public void doSomething(String body) {
+        sender.send(body);
+    }
+}
diff --git a/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/MySender.java b/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/MySender.java
new file mode 100644
index 0000000..0188296
--- /dev/null
+++ b/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/MySender.java
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.patterns;
+
+/**
+ *
+ */
+public interface MySender {
+
+    void send(String body);
+}
diff --git a/components/camel-test/src/test/java/org/apache/camel/test/junit5/SimpleMockTest.java b/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/ProduceBeanTest.java
similarity index 55%
copy from components/camel-test/src/test/java/org/apache/camel/test/junit5/SimpleMockTest.java
copy to components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/ProduceBeanTest.java
index 33987ac..0b7969b 100644
--- a/components/camel-test/src/test/java/org/apache/camel/test/junit5/SimpleMockTest.java
+++ b/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/ProduceBeanTest.java
@@ -14,39 +14,33 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.test.junit5;
+package org.apache.camel.test.junit5.patterns;
 
-import org.apache.camel.ProducerTemplate;
-import org.apache.camel.RoutesBuilder;
 import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.model.ModelCamelContext;
+import org.apache.camel.test.junit5.CamelTestSupport;
 import org.junit.jupiter.api.Test;
 
-@CamelTest
-public class SimpleMockTest {
+/**
+ *
+ */
+public class ProduceBeanTest extends CamelTestSupport {
 
     @Test
-    public void testMock(ProducerTemplate template, ModelCamelContext ctx) throws Exception {
-        MockEndpoint mockResult = ctx.getEndpoint("mock:result", MockEndpoint.class);
-        mockResult.expectedBodiesReceived("Hello World");
-        template.sendBody("direct:start", "Hello World");
-        MockEndpoint.assertIsSatisfied(ctx);
-    }
+    public void testProduceBean() throws Exception {
+        getMockEndpoint("mock:result").expectedMessageCount(1);
 
-    /* Same test is shorter with junit4
-    @Test
-    public void testMock() throws Exception {
-        getMockEndpoint("mock:result").expectedBodiesReceived("Hello World");
         template.sendBody("direct:start", "Hello World");
+
         assertMockEndpointsSatisfied();
-    }*/
+    }
 
-    protected RoutesBuilder createRouteBuilder() throws Exception {
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
         return new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                from("direct:start").to("mock:result");
+                from("direct:start")
+                    .bean(MyProduceBean.class, "doSomething");
             }
         };
     }
diff --git a/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/RouteBuilderConfigureExceptionTest.java b/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/RouteBuilderConfigureExceptionTest.java
new file mode 100644
index 0000000..46954b6
--- /dev/null
+++ b/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/RouteBuilderConfigureExceptionTest.java
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.patterns;
+
+import org.apache.camel.Predicate;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.fail;
+
+public class RouteBuilderConfigureExceptionTest extends CamelTestSupport {
+
+    private Predicate iAmNull;
+
+    @Override
+    @BeforeEach
+    public void setUp() throws Exception {
+        try {
+            super.setUp();
+            fail("Should have thrown exception");
+        } catch (Exception e) {
+            // expected
+        }
+    }
+
+    @Test
+    public void testFoo() throws Exception {
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() {
+        return new RouteBuilder() {
+            public void configure() {
+                from("direct:start").choice().when(iAmNull).to("mock:dead");
+            }
+        };
+    }
+}
diff --git a/components/camel-test/src/test/java/org/apache/camel/test/junit5/SimpleMockTest.java b/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/RouteProcessorDumpRouteCoverageTest.java
similarity index 54%
copy from components/camel-test/src/test/java/org/apache/camel/test/junit5/SimpleMockTest.java
copy to components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/RouteProcessorDumpRouteCoverageTest.java
index 33987ac..53150c0 100644
--- a/components/camel-test/src/test/java/org/apache/camel/test/junit5/SimpleMockTest.java
+++ b/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/RouteProcessorDumpRouteCoverageTest.java
@@ -14,40 +14,46 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.test.junit5;
+package org.apache.camel.test.junit5.patterns;
 
-import org.apache.camel.ProducerTemplate;
 import org.apache.camel.RoutesBuilder;
 import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.model.ModelCamelContext;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.Test;
 
-@CamelTest
-public class SimpleMockTest {
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
-    @Test
-    public void testMock(ProducerTemplate template, ModelCamelContext ctx) throws Exception {
-        MockEndpoint mockResult = ctx.getEndpoint("mock:result", MockEndpoint.class);
-        mockResult.expectedBodiesReceived("Hello World");
-        template.sendBody("direct:start", "Hello World");
-        MockEndpoint.assertIsSatisfied(ctx);
+public class RouteProcessorDumpRouteCoverageTest extends CamelTestSupport {
+
+    @Override
+    public boolean isDumpRouteCoverage() {
+        return true;
     }
 
-    /* Same test is shorter with junit4
     @Test
-    public void testMock() throws Exception {
-        getMockEndpoint("mock:result").expectedBodiesReceived("Hello World");
-        template.sendBody("direct:start", "Hello World");
-        assertMockEndpointsSatisfied();
-    }*/
+    public void testProcessorJunit5() throws Exception {
+        String out = template.requestBody("direct:start", "Hello World", String.class);
+        assertEquals("Bye World", out);
+    }
 
+    @Override
+    @AfterEach
+    public void tearDown() throws Exception {
+        super.tearDown();
+        // should create that file when test is done
+        assertFileExists("target/camel-route-coverage/RouteProcessorDumpRouteCoverageTest-testProcessorJunit5.xml");
+    }
+
+    @Override
     protected RoutesBuilder createRouteBuilder() throws Exception {
         return new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                from("direct:start").to("mock:result");
+                from("direct:start")
+                    .process(exchange -> exchange.getOut().setBody("Bye World"));
             }
         };
     }
+
 }
diff --git a/components/camel-test/src/test/java/org/apache/camel/test/junit5/SimpleMockTest.java b/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/SimpleMockEndpointsTest.java
similarity index 58%
copy from components/camel-test/src/test/java/org/apache/camel/test/junit5/SimpleMockTest.java
copy to components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/SimpleMockEndpointsTest.java
index 33987ac..6f32ff8 100644
--- a/components/camel-test/src/test/java/org/apache/camel/test/junit5/SimpleMockTest.java
+++ b/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/SimpleMockEndpointsTest.java
@@ -14,40 +14,39 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.test.junit5;
+package org.apache.camel.test.junit5.patterns;
 
-import org.apache.camel.ProducerTemplate;
 import org.apache.camel.RoutesBuilder;
 import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.model.ModelCamelContext;
+import org.apache.camel.test.junit5.CamelTestSupport;
 import org.junit.jupiter.api.Test;
 
-@CamelTest
-public class SimpleMockTest {
+public class SimpleMockEndpointsTest extends CamelTestSupport {
 
-    @Test
-    public void testMock(ProducerTemplate template, ModelCamelContext ctx) throws Exception {
-        MockEndpoint mockResult = ctx.getEndpoint("mock:result", MockEndpoint.class);
-        mockResult.expectedBodiesReceived("Hello World");
-        template.sendBody("direct:start", "Hello World");
-        MockEndpoint.assertIsSatisfied(ctx);
+    @Override
+    public String isMockEndpointsAndSkip() {
+        return "seda:queue";
     }
 
-    /* Same test is shorter with junit4
     @Test
-    public void testMock() throws Exception {
-        getMockEndpoint("mock:result").expectedBodiesReceived("Hello World");
-        template.sendBody("direct:start", "Hello World");
+    public void testMockAndSkip() throws Exception {
+        getMockEndpoint("mock:seda:queue").expectedBodiesReceived("Bye Camel");
+
+        template.sendBody("seda:start", "Camel");
+
         assertMockEndpointsSatisfied();
-    }*/
+    }
 
+    @Override
     protected RoutesBuilder createRouteBuilder() throws Exception {
         return new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                from("direct:start").to("mock:result");
+                from("seda:start")
+                    .transform(simple("Bye ${body}"))
+                    .to("seda:queue");
             }
         };
     }
+
 }
diff --git a/components/camel-test/src/test/java/org/apache/camel/test/junit5/SimpleMockTest.java b/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/SimpleMockTest.java
similarity index 67%
copy from components/camel-test/src/test/java/org/apache/camel/test/junit5/SimpleMockTest.java
copy to components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/SimpleMockTest.java
index 33987ac..beaa4c9 100644
--- a/components/camel-test/src/test/java/org/apache/camel/test/junit5/SimpleMockTest.java
+++ b/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/SimpleMockTest.java
@@ -14,40 +14,33 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.test.junit5;
+package org.apache.camel.test.junit5.patterns;
 
-import org.apache.camel.ProducerTemplate;
 import org.apache.camel.RoutesBuilder;
 import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.model.ModelCamelContext;
+import org.apache.camel.test.junit5.CamelTestSupport;
 import org.junit.jupiter.api.Test;
 
-@CamelTest
-public class SimpleMockTest {
+public class SimpleMockTest extends CamelTestSupport {
 
     @Test
-    public void testMock(ProducerTemplate template, ModelCamelContext ctx) throws Exception {
-        MockEndpoint mockResult = ctx.getEndpoint("mock:result", MockEndpoint.class);
-        mockResult.expectedBodiesReceived("Hello World");
-        template.sendBody("direct:start", "Hello World");
-        MockEndpoint.assertIsSatisfied(ctx);
-    }
-
-    /* Same test is shorter with junit4
-    @Test
     public void testMock() throws Exception {
         getMockEndpoint("mock:result").expectedBodiesReceived("Hello World");
+
         template.sendBody("direct:start", "Hello World");
+
         assertMockEndpointsSatisfied();
-    }*/
+    }
 
+    @Override
     protected RoutesBuilder createRouteBuilder() throws Exception {
         return new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                from("direct:start").to("mock:result");
+                from("direct:start")
+                        .to("mock:result");
             }
         };
     }
+
 }
diff --git a/components/camel-test/src/test/java/org/apache/camel/test/junit5/SimpleMockTest.java b/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/SimpleMockUsingExtensionTest.java
similarity index 83%
copy from components/camel-test/src/test/java/org/apache/camel/test/junit5/SimpleMockTest.java
copy to components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/SimpleMockUsingExtensionTest.java
index 33987ac..9b8d2d2 100644
--- a/components/camel-test/src/test/java/org/apache/camel/test/junit5/SimpleMockTest.java
+++ b/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/SimpleMockUsingExtensionTest.java
@@ -14,17 +14,18 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.test.junit5;
+package org.apache.camel.test.junit5.patterns;
 
 import org.apache.camel.ProducerTemplate;
 import org.apache.camel.RoutesBuilder;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.model.ModelCamelContext;
+import org.apache.camel.test.junit5.CamelTest;
 import org.junit.jupiter.api.Test;
 
 @CamelTest
-public class SimpleMockTest {
+public class SimpleMockUsingExtensionTest {
 
     @Test
     public void testMock(ProducerTemplate template, ModelCamelContext ctx) throws Exception {
@@ -34,14 +35,6 @@ public class SimpleMockTest {
         MockEndpoint.assertIsSatisfied(ctx);
     }
 
-    /* Same test is shorter with junit4
-    @Test
-    public void testMock() throws Exception {
-        getMockEndpoint("mock:result").expectedBodiesReceived("Hello World");
-        template.sendBody("direct:start", "Hello World");
-        assertMockEndpointsSatisfied();
-    }*/
-
     protected RoutesBuilder createRouteBuilder() throws Exception {
         return new RouteBuilder() {
             @Override
diff --git a/components/camel-test/src/test/java/org/apache/camel/test/junit5/SimpleMockTest.java b/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/SimpleNotifyBuilderTest.java
similarity index 56%
copy from components/camel-test/src/test/java/org/apache/camel/test/junit5/SimpleMockTest.java
copy to components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/SimpleNotifyBuilderTest.java
index 33987ac..ba91a1a 100644
--- a/components/camel-test/src/test/java/org/apache/camel/test/junit5/SimpleMockTest.java
+++ b/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/SimpleNotifyBuilderTest.java
@@ -14,40 +14,46 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.test.junit5;
+package org.apache.camel.test.junit5.patterns;
+
+import java.util.concurrent.TimeUnit;
 
-import org.apache.camel.ProducerTemplate;
 import org.apache.camel.RoutesBuilder;
+import org.apache.camel.builder.NotifyBuilder;
 import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.model.ModelCamelContext;
+import org.apache.camel.test.junit5.CamelTestSupport;
 import org.junit.jupiter.api.Test;
 
-@CamelTest
-public class SimpleMockTest {
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
-    @Test
-    public void testMock(ProducerTemplate template, ModelCamelContext ctx) throws Exception {
-        MockEndpoint mockResult = ctx.getEndpoint("mock:result", MockEndpoint.class);
-        mockResult.expectedBodiesReceived("Hello World");
-        template.sendBody("direct:start", "Hello World");
-        MockEndpoint.assertIsSatisfied(ctx);
-    }
+public class SimpleNotifyBuilderTest extends CamelTestSupport {
 
-    /* Same test is shorter with junit4
     @Test
-    public void testMock() throws Exception {
-        getMockEndpoint("mock:result").expectedBodiesReceived("Hello World");
-        template.sendBody("direct:start", "Hello World");
-        assertMockEndpointsSatisfied();
-    }*/
+    public void testNotifyBuilder() throws Exception {
+        NotifyBuilder notify = new NotifyBuilder(context)
+                .from("seda:start")
+                .wereSentTo("seda:queue")
+                .whenDone(10)
+                .create();
+
+        for (int i = 0; i < 10; i++) {
+            template.sendBody("seda:start", "Camel" + i);
+        }
 
+        boolean matches = notify.matches(10, TimeUnit.SECONDS);
+        assertTrue(matches);
+    }
+
+    @Override
     protected RoutesBuilder createRouteBuilder() throws Exception {
         return new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                from("direct:start").to("mock:result");
+                from("seda:start")
+                    .transform(simple("Bye ${body}"))
+                    .to("seda:queue");
             }
         };
     }
+
 }
diff --git a/components/camel-test/src/test/java/org/apache/camel/test/junit5/SimpleMockTest.java b/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/SimpleWeaveAddMockLastTest.java
similarity index 55%
rename from components/camel-test/src/test/java/org/apache/camel/test/junit5/SimpleMockTest.java
rename to components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/SimpleWeaveAddMockLastTest.java
index 33987ac..aaf8800 100644
--- a/components/camel-test/src/test/java/org/apache/camel/test/junit5/SimpleMockTest.java
+++ b/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/SimpleWeaveAddMockLastTest.java
@@ -14,40 +14,48 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.test.junit5;
+package org.apache.camel.test.junit5.patterns;
 
-import org.apache.camel.ProducerTemplate;
 import org.apache.camel.RoutesBuilder;
+import org.apache.camel.builder.AdviceWithRouteBuilder;
 import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.model.ModelCamelContext;
+import org.apache.camel.reifier.RouteReifier;
+import org.apache.camel.test.junit5.CamelTestSupport;
 import org.junit.jupiter.api.Test;
 
-@CamelTest
-public class SimpleMockTest {
+public class SimpleWeaveAddMockLastTest extends CamelTestSupport {
 
-    @Test
-    public void testMock(ProducerTemplate template, ModelCamelContext ctx) throws Exception {
-        MockEndpoint mockResult = ctx.getEndpoint("mock:result", MockEndpoint.class);
-        mockResult.expectedBodiesReceived("Hello World");
-        template.sendBody("direct:start", "Hello World");
-        MockEndpoint.assertIsSatisfied(ctx);
+    public boolean isUseAdviceWith() {
+        return true;
     }
 
-    /* Same test is shorter with junit4
     @Test
-    public void testMock() throws Exception {
-        getMockEndpoint("mock:result").expectedBodiesReceived("Hello World");
-        template.sendBody("direct:start", "Hello World");
+    public void testWeaveAddMockLast() throws Exception {
+        RouteReifier.adviceWith(context.getRouteDefinitions().get(0), context, new AdviceWithRouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+                weaveAddLast().to("mock:result");
+            }
+        });
+        context.start();
+
+        getMockEndpoint("mock:result").expectedBodiesReceived("Bye Camel");
+
+        template.sendBody("seda:start", "Camel");
+
         assertMockEndpointsSatisfied();
-    }*/
+    }
 
+    @Override
     protected RoutesBuilder createRouteBuilder() throws Exception {
         return new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                from("direct:start").to("mock:result");
+                from("seda:start")
+                    .transform(simple("Bye ${body}"))
+                    .to("seda:queue");
             }
         };
     }
+
 }
diff --git a/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/UseOverridePropertiesWithPropertiesComponentTest.java b/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/UseOverridePropertiesWithPropertiesComponentTest.java
new file mode 100644
index 0000000..d4a4719
--- /dev/null
+++ b/components/camel-test/src/test/java/org/apache/camel/test/junit5/patterns/UseOverridePropertiesWithPropertiesComponentTest.java
@@ -0,0 +1,78 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.patterns;
+
+import java.util.Properties;
+
+import org.apache.camel.builder.AdviceWithRouteBuilder;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.reifier.RouteReifier;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+public class UseOverridePropertiesWithPropertiesComponentTest extends CamelTestSupport {
+
+    @Override
+    public boolean isUseAdviceWith() {
+        return true;
+    }
+
+    @BeforeEach
+    public void doSomethingBefore() throws Exception {
+        AdviceWithRouteBuilder mocker = new AdviceWithRouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+                replaceFromWith("direct:sftp");
+
+                interceptSendToEndpoint("file:*")
+                        .skipSendToOriginalEndpoint()
+                        .to("mock:file");
+            }
+        };
+        RouteReifier.adviceWith(context.getRouteDefinition("myRoute"), context, mocker);
+    }
+
+    @Override
+    protected Properties useOverridePropertiesWithPropertiesComponent() {
+        Properties pc = new Properties();
+        pc.put("ftp.username", "scott");
+        pc.put("ftp.password", "tiger");
+        return pc;
+    }
+
+    @Test
+    public void testOverride() throws Exception {
+        context.start();
+
+        getMockEndpoint("mock:file").expectedMessageCount(1);
+
+        template.sendBody("direct:sftp", "Hello World");
+
+        assertMockEndpointsSatisfied();
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() {
+        return new RouteBuilder() {
+            public void configure() {
+                from("ftp:somepath?username={{ftp.username}}&password={{ftp.password}}").routeId("myRoute")
+                    .to("file:target/out");
+            }
+        };
+    }
+}


[camel] 06/09: CAMEL-13342: Implemented a first version of a proof-of-concept for camel-testcontainers-spring with JUnit 5

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

aldettinger pushed a commit to branch CAMEL-13342-JUNIT5-EXPLORATORY
in repository https://gitbox.apache.org/repos/asf/camel.git

commit ef72ac9d4811772f3b60c878492aa358dc614302
Author: aldettinger <al...@gmail.com>
AuthorDate: Thu Jul 11 10:12:37 2019 +0200

    CAMEL-13342: Implemented a first version of a proof-of-concept for camel-testcontainers-spring with JUnit 5
---
 .../SpringConsulDefaultServiceCallRouteTest.java   |  12 +-
 ...SpringConsulExpressionServiceCallRouteTest.java |  12 +-
 .../SpringConsulRibbonServiceCallRouteTest.java    |  12 +-
 .../cloud/SpringConsulServiceCallRouteTest.java    |   8 +-
 .../junit5/spring/CamelAnnotationsHandler.java     | 367 ++++++++++++++
 .../spring/CamelSpringBootExecutionListener.java   |  95 ++++
 .../spring/CamelSpringBootJUnit4ClassRunner.java   |  33 ++
 .../test/junit5/spring/CamelSpringBootRunner.java  |  87 ++++
 .../CamelSpringDelegatingTestContextLoader.java    | 138 ++++++
 .../test/junit5/spring/CamelSpringRunner.java      |  83 ++++
 .../spring/CamelSpringTestContextLoader.java       | 551 +++++++++++++++++++++
 ...ringTestContextLoaderTestExecutionListener.java |  50 ++
 .../test/junit5/spring/CamelSpringTestHelper.java  | 109 ++++
 .../test/junit5/spring/CamelSpringTestSupport.java | 212 ++++++++
 .../spring/CamelTestContextBootstrapper.java       |  31 ++
 .../camel/test/junit5/spring/DisableJmx.java       |  43 ++
 .../spring/DisableJmxTestExecutionListener.java    |  39 ++
 .../test/junit5/spring/EnableRouteCoverage.java    |  41 ++
 .../camel/test/junit5/spring/ExcludeRoutes.java    |  44 ++
 .../camel/test/junit5/spring/MockEndpoints.java    |  43 ++
 .../test/junit5/spring/MockEndpointsAndSkip.java   |  43 ++
 .../test/junit5/spring/ProvidesBreakpoint.java     |  36 ++
 .../test/junit5/spring/RouteCoverageDumper.java    |  82 +++
 .../junit5/spring/RouteCoverageEventNotifier.java  |  51 ++
 .../camel/test/junit5/spring/ShutdownTimeout.java  |  49 ++
 .../spring/StopWatchTestExecutionListener.java     |  62 +++
 .../camel/test/junit5/spring/UseAdviceWith.java    |  49 ++
 ...eOverridePropertiesWithPropertiesComponent.java |  34 ++
 .../spring/ContainerAwareSpringTestSupport.java    | 112 +++++
 .../spring/ContainerAwareSpringTestSupportIT.java  |  61 +++
 30 files changed, 2567 insertions(+), 22 deletions(-)

diff --git a/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/SpringConsulDefaultServiceCallRouteTest.java b/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/SpringConsulDefaultServiceCallRouteTest.java
index e0cbcb9..bbe67f2 100644
--- a/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/SpringConsulDefaultServiceCallRouteTest.java
+++ b/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/SpringConsulDefaultServiceCallRouteTest.java
@@ -20,8 +20,8 @@ import java.util.List;
 
 import org.apache.camel.component.ribbon.cloud.RibbonServiceLoadBalancer;
 import org.apache.camel.impl.cloud.DefaultServiceCallProcessor;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
 import org.springframework.context.support.AbstractApplicationContext;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 
@@ -35,9 +35,9 @@ public class SpringConsulDefaultServiceCallRouteTest extends SpringConsulService
     public void testServiceCallConfiguration() throws Exception {
         List<DefaultServiceCallProcessor> processors = findServiceCallProcessors();
 
-        Assert.assertFalse(processors.isEmpty());
-        Assert.assertEquals(2, processors.size());
-        Assert.assertFalse(processors.get(0).getLoadBalancer() instanceof RibbonServiceLoadBalancer);
-        Assert.assertFalse(processors.get(1).getLoadBalancer() instanceof RibbonServiceLoadBalancer);
+        Assertions.assertFalse(processors.isEmpty());
+        Assertions.assertEquals(2, processors.size());
+        Assertions.assertFalse(processors.get(0).getLoadBalancer() instanceof RibbonServiceLoadBalancer);
+        Assertions.assertFalse(processors.get(1).getLoadBalancer() instanceof RibbonServiceLoadBalancer);
     }
 }
diff --git a/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/SpringConsulExpressionServiceCallRouteTest.java b/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/SpringConsulExpressionServiceCallRouteTest.java
index 21995d7..f1f937f 100644
--- a/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/SpringConsulExpressionServiceCallRouteTest.java
+++ b/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/SpringConsulExpressionServiceCallRouteTest.java
@@ -20,8 +20,8 @@ import java.util.List;
 
 import org.apache.camel.component.ribbon.cloud.RibbonServiceLoadBalancer;
 import org.apache.camel.impl.cloud.DefaultServiceCallProcessor;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
 import org.springframework.context.support.AbstractApplicationContext;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 
@@ -35,9 +35,9 @@ public class SpringConsulExpressionServiceCallRouteTest extends SpringConsulServ
     public void testServiceCallConfiguration() throws Exception {
         List<DefaultServiceCallProcessor> processors = findServiceCallProcessors();
 
-        Assert.assertFalse(processors.isEmpty());
-        Assert.assertEquals(2, processors.size());
-        Assert.assertFalse(processors.get(0).getLoadBalancer() instanceof RibbonServiceLoadBalancer);
-        Assert.assertFalse(processors.get(1).getLoadBalancer() instanceof RibbonServiceLoadBalancer);
+        Assertions.assertFalse(processors.isEmpty());
+        Assertions.assertEquals(2, processors.size());
+        Assertions.assertFalse(processors.get(0).getLoadBalancer() instanceof RibbonServiceLoadBalancer);
+        Assertions.assertFalse(processors.get(1).getLoadBalancer() instanceof RibbonServiceLoadBalancer);
     }
 }
diff --git a/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/SpringConsulRibbonServiceCallRouteTest.java b/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/SpringConsulRibbonServiceCallRouteTest.java
index 230d178..b8cd79b 100644
--- a/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/SpringConsulRibbonServiceCallRouteTest.java
+++ b/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/SpringConsulRibbonServiceCallRouteTest.java
@@ -20,8 +20,8 @@ import java.util.List;
 
 import org.apache.camel.component.ribbon.cloud.RibbonServiceLoadBalancer;
 import org.apache.camel.impl.cloud.DefaultServiceCallProcessor;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
 import org.springframework.context.support.AbstractApplicationContext;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 
@@ -35,9 +35,9 @@ public class SpringConsulRibbonServiceCallRouteTest extends SpringConsulServiceC
     public void testServiceCallConfiguration() throws Exception {
         List<DefaultServiceCallProcessor> processors = findServiceCallProcessors();
 
-        Assert.assertFalse(processors.isEmpty());
-        Assert.assertEquals(2, processors.size());
-        Assert.assertTrue(processors.get(0).getLoadBalancer() instanceof RibbonServiceLoadBalancer);
-        Assert.assertTrue(processors.get(1).getLoadBalancer() instanceof RibbonServiceLoadBalancer);
+        Assertions.assertFalse(processors.isEmpty());
+        Assertions.assertEquals(2, processors.size());
+        Assertions.assertTrue(processors.get(0).getLoadBalancer() instanceof RibbonServiceLoadBalancer);
+        Assertions.assertTrue(processors.get(1).getLoadBalancer() instanceof RibbonServiceLoadBalancer);
     }
 }
diff --git a/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/SpringConsulServiceCallRouteTest.java b/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/SpringConsulServiceCallRouteTest.java
index 68de60c..83a4608 100644
--- a/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/SpringConsulServiceCallRouteTest.java
+++ b/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/SpringConsulServiceCallRouteTest.java
@@ -31,9 +31,9 @@ import org.apache.camel.component.consul.ConsulTestSupport;
 import org.apache.camel.impl.cloud.DefaultServiceCallProcessor;
 import org.apache.camel.processor.ChoiceProcessor;
 import org.apache.camel.processor.FilterProcessor;
-import org.apache.camel.test.testcontainers.spring.ContainerAwareSpringTestSupport;
-import org.junit.Assert;
-import org.junit.Test;
+import org.apache.camel.test.junit5.testcontainers.spring.ContainerAwareSpringTestSupport;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
 import org.testcontainers.containers.GenericContainer;
 
 public abstract class SpringConsulServiceCallRouteTest extends ContainerAwareSpringTestSupport {
@@ -130,7 +130,7 @@ public abstract class SpringConsulServiceCallRouteTest extends ContainerAwareSpr
     protected List<DefaultServiceCallProcessor> findServiceCallProcessors() {
         Route route = context().getRoute("scall");
 
-        Assert.assertNotNull("ServiceCall Route should be present", route);
+        Assertions.assertNotNull(route, "ServiceCall Route should be present");
 
         return findServiceCallProcessors(new ArrayList<>(), route.navigate());
     }
diff --git a/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelAnnotationsHandler.java b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelAnnotationsHandler.java
new file mode 100644
index 0000000..8bc45b2
--- /dev/null
+++ b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelAnnotationsHandler.java
@@ -0,0 +1,367 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.spring;
+
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Properties;
+import java.util.concurrent.TimeUnit;
+import java.util.function.Function;
+
+import org.apache.camel.ExtendedCamelContext;
+import org.apache.camel.api.management.JmxSystemPropertyKeys;
+import org.apache.camel.api.management.ManagedCamelContext;
+import org.apache.camel.api.management.mbean.ManagedCamelContextMBean;
+import org.apache.camel.component.properties.PropertiesComponent;
+import org.apache.camel.impl.engine.InterceptSendToMockEndpointStrategy;
+import org.apache.camel.processor.interceptor.DefaultDebugger;
+import org.apache.camel.spi.Breakpoint;
+import org.apache.camel.spi.Debugger;
+import org.apache.camel.spi.EventNotifier;
+import org.apache.camel.spring.SpringCamelContext;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.apache.camel.util.CollectionStringBuffer;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.context.ConfigurableApplicationContext;
+import org.springframework.core.annotation.AnnotationUtils;
+
+import static org.apache.camel.test.spring.CamelSpringTestHelper.getAllMethods;
+
+public final class CamelAnnotationsHandler {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(CamelAnnotationsHandler.class);
+
+    private CamelAnnotationsHandler() {
+    }
+
+    /**
+     * Handles @ExcludeRoutes to make it easier to exclude other routes when testing with Spring Boot.
+     *
+     * @param testClass the test class being executed
+     */
+    public static void handleExcludeRoutesForSpringBoot(Class<?> testClass) {
+        if (testClass.isAnnotationPresent(ExcludeRoutes.class)) {
+            Class[] routes = testClass.getAnnotation(ExcludeRoutes.class).value();
+            // need to setup this as a JVM system property
+            CollectionStringBuffer csb = new CollectionStringBuffer(",");
+            for (Class clazz : routes) {
+                csb.append(clazz.getName());
+            }
+            String key = "CamelTestSpringExcludeRoutes";
+            String value = csb.toString();
+
+            String exists = System.getProperty(key);
+            if (exists != null) {
+                LOGGER.warn("Cannot use @ExcludeRoutes as JVM property " + key + " has already been set.");
+            } else {
+                LOGGER.info("@ExcludeRoutes annotation found. Setting up JVM property {}={}", key, value);
+                System.setProperty(key, value);
+            }
+        }
+    }
+
+    /**
+     * Handles disabling of JMX on Camel contexts based on {@link DisableJmx}.
+     *
+     * @param context the initialized Spring context
+     * @param testClass the test class being executed
+     */
+    public static void handleDisableJmx(ConfigurableApplicationContext context, Class<?> testClass) {
+        CamelSpringTestHelper.setOriginalJmxDisabledValue(System.getProperty(JmxSystemPropertyKeys.DISABLED));
+
+        if (testClass.isAnnotationPresent(DisableJmx.class)) {
+            if (testClass.getAnnotation(DisableJmx.class).value()) {
+                LOGGER.info("Disabling Camel JMX globally as DisableJmx annotation was found and disableJmx is set to true.");
+                System.setProperty(JmxSystemPropertyKeys.DISABLED, "true");
+
+            } else {
+                LOGGER.info("Enabling Camel JMX as DisableJmx annotation was found and disableJmx is set to false.");
+                System.clearProperty(JmxSystemPropertyKeys.DISABLED);
+            }
+        } else {
+            LOGGER.info("Disabling Camel JMX globally for tests by default. Use the DisableJMX annotation to override the default setting.");
+            System.setProperty(JmxSystemPropertyKeys.DISABLED, "true");
+        }
+    }
+
+    /**
+     * Handles disabling of JMX on Camel contexts based on {@link DisableJmx}.
+     *
+     * @param context the initialized Spring context
+     * @param testClass the test class being executed
+     */
+    public static void handleRouteCoverage(ConfigurableApplicationContext context, Class<?> testClass, Function testMethod) throws Exception {
+        if (testClass.isAnnotationPresent(EnableRouteCoverage.class)) {
+            System.setProperty(CamelTestSupport.ROUTE_COVERAGE_ENABLED, "true");
+
+            CamelSpringTestHelper.doToSpringCamelContexts(context, new CamelSpringTestHelper.DoToSpringCamelContextsStrategy() {
+
+                @Override
+                public void execute(String contextName, SpringCamelContext camelContext) throws Exception {
+                    LOGGER.info("Enabling RouteCoverage");
+                    EventNotifier notifier = new RouteCoverageEventNotifier(testClass.getName(), testMethod);
+                    camelContext.addService(notifier, true);
+                    camelContext.getManagementStrategy().addEventNotifier(notifier);
+                }
+            });
+        }
+    }
+
+    public static void handleRouteCoverageDump(ConfigurableApplicationContext context, Class<?> testClass, Function testMethod) throws Exception {
+        if (testClass.isAnnotationPresent(EnableRouteCoverage.class)) {
+            CamelSpringTestHelper.doToSpringCamelContexts(context, new CamelSpringTestHelper.DoToSpringCamelContextsStrategy() {
+
+                @Override
+                public void execute(String contextName, SpringCamelContext camelContext) throws Exception {
+                    LOGGER.debug("Dumping RouteCoverage");
+
+                    String testMethodName = (String) testMethod.apply(this);
+                    RouteCoverageDumper.dumpRouteCoverage(camelContext, testClass.getName(), testMethodName);
+
+                    // reset JMX statistics
+                    ManagedCamelContextMBean managedCamelContext = camelContext.getExtension(ManagedCamelContext.class).getManagedCamelContext();
+                    if (managedCamelContext != null) {
+                        LOGGER.debug("Resetting JMX statistics for RouteCoverage");
+                        managedCamelContext.reset(true);
+                    }
+
+                    // turn off dumping one more time by removing the event listener (which would dump as well when Camel is stopping)
+                    // but this method was explicit invoked to dump such as from afterTest callbacks from JUnit.
+                    RouteCoverageEventNotifier eventNotifier = camelContext.hasService(RouteCoverageEventNotifier.class);
+                    if (eventNotifier != null) {
+                        camelContext.getManagementStrategy().removeEventNotifier(eventNotifier);
+                        camelContext.removeService(eventNotifier);
+                    }
+                }
+            });
+        }
+    }
+
+    public static void handleProvidesBreakpoint(ConfigurableApplicationContext context, Class<?> testClass) throws Exception {
+        Collection<Method> methods = getAllMethods(testClass);
+        final List<Breakpoint> breakpoints = new LinkedList<>();
+
+        for (Method method : methods) {
+            if (AnnotationUtils.findAnnotation(method, ProvidesBreakpoint.class) != null) {
+                Class<?>[] argTypes = method.getParameterTypes();
+                if (argTypes.length != 0) {
+                    throw new IllegalArgumentException("Method [" + method.getName()
+                            + "] is annotated with ProvidesBreakpoint but is not a no-argument method.");
+                } else if (!Breakpoint.class.isAssignableFrom(method.getReturnType())) {
+                    throw new IllegalArgumentException("Method [" + method.getName()
+                            + "] is annotated with ProvidesBreakpoint but does not return a Breakpoint.");
+                } else if (!Modifier.isStatic(method.getModifiers())) {
+                    throw new IllegalArgumentException("Method [" + method.getName()
+                            + "] is annotated with ProvidesBreakpoint but is not static.");
+                } else if (!Modifier.isPublic(method.getModifiers())) {
+                    throw new IllegalArgumentException("Method [" + method.getName()
+                            + "] is annotated with ProvidesBreakpoint but is not public.");
+                }
+
+                try {
+                    breakpoints.add((Breakpoint) method.invoke(null));
+                } catch (Exception e) {
+                    throw new RuntimeException("Method [" + method.getName()
+                            + "] threw exception during evaluation.", e);
+                }
+            }
+        }
+
+        if (breakpoints.size() != 0) {
+            CamelSpringTestHelper.doToSpringCamelContexts(context, new CamelSpringTestHelper.DoToSpringCamelContextsStrategy() {
+
+                public void execute(String contextName, SpringCamelContext camelContext)
+                        throws Exception {
+                    Debugger debugger = camelContext.getDebugger();
+                    if (debugger == null) {
+                        debugger = new DefaultDebugger();
+                        camelContext.setDebugger(debugger);
+                    }
+
+                    for (Breakpoint breakpoint : breakpoints) {
+                        LOGGER.info("Adding Breakpoint [{}] to CamelContext with name [{}].", breakpoint, contextName);
+                        debugger.addBreakpoint(breakpoint);
+                    }
+                }
+            });
+        }
+    }
+
+    /**
+     * Handles updating shutdown timeouts on Camel contexts based on {@link ShutdownTimeout}.
+     *
+     * @param context the initialized Spring context
+     * @param testClass the test class being executed
+     */
+    public static void handleShutdownTimeout(ConfigurableApplicationContext context, Class<?> testClass) throws Exception {
+        final int shutdownTimeout;
+        final TimeUnit shutdownTimeUnit;
+        if (testClass.isAnnotationPresent(ShutdownTimeout.class)) {
+            shutdownTimeout = testClass.getAnnotation(ShutdownTimeout.class).value();
+            shutdownTimeUnit = testClass.getAnnotation(ShutdownTimeout.class).timeUnit();
+        } else {
+            shutdownTimeout = 10;
+            shutdownTimeUnit = TimeUnit.SECONDS;
+        }
+
+        CamelSpringTestHelper.doToSpringCamelContexts(context, new CamelSpringTestHelper.DoToSpringCamelContextsStrategy() {
+
+            public void execute(String contextName, SpringCamelContext camelContext)
+                    throws Exception {
+                LOGGER.info("Setting shutdown timeout to [{} {}] on CamelContext with name [{}].", shutdownTimeout, shutdownTimeUnit, contextName);
+                camelContext.getShutdownStrategy().setTimeout(shutdownTimeout);
+                camelContext.getShutdownStrategy().setTimeUnit(shutdownTimeUnit);
+            }
+        });
+    }
+
+    /**
+     * Handles auto-intercepting of endpoints with mocks based on {@link MockEndpoints}.
+     *
+     * @param context the initialized Spring context
+     * @param testClass the test class being executed
+     */
+    public static void handleMockEndpoints(ConfigurableApplicationContext context, Class<?> testClass) throws Exception {
+        if (testClass.isAnnotationPresent(MockEndpoints.class)) {
+            final String mockEndpoints = testClass.getAnnotation(MockEndpoints.class).value();
+            CamelSpringTestHelper.doToSpringCamelContexts(context, new CamelSpringTestHelper.DoToSpringCamelContextsStrategy() {
+
+                public void execute(String contextName, SpringCamelContext camelContext)
+                        throws Exception {
+                    LOGGER.info("Enabling auto mocking of endpoints matching pattern [{}] on CamelContext with name [{}].", mockEndpoints, contextName);
+                    camelContext.adapt(ExtendedCamelContext.class).registerEndpointCallback(new InterceptSendToMockEndpointStrategy(mockEndpoints));
+                }
+            });
+        }
+    }
+
+    /**
+     * Handles auto-intercepting of endpoints with mocks based on {@link MockEndpointsAndSkip} and skipping the
+     * original endpoint.
+     *
+     * @param context the initialized Spring context
+     * @param testClass the test class being executed
+     */
+    public static void handleMockEndpointsAndSkip(ConfigurableApplicationContext context, Class<?> testClass) throws Exception {
+        if (testClass.isAnnotationPresent(MockEndpointsAndSkip.class)) {
+            final String mockEndpoints = testClass.getAnnotation(MockEndpointsAndSkip.class).value();
+            CamelSpringTestHelper.doToSpringCamelContexts(context, new CamelSpringTestHelper.DoToSpringCamelContextsStrategy() {
+
+                public void execute(String contextName, SpringCamelContext camelContext)
+                        throws Exception {
+                    // resolve the property place holders of the mockEndpoints
+                    String mockEndpointsValue = camelContext.resolvePropertyPlaceholders(mockEndpoints);
+                    LOGGER.info("Enabling auto mocking and skipping of endpoints matching pattern [{}] on CamelContext with name [{}].", mockEndpointsValue, contextName);
+                    camelContext.adapt(ExtendedCamelContext.class).registerEndpointCallback(new InterceptSendToMockEndpointStrategy(mockEndpointsValue, true));
+                }
+            });
+        }
+    }
+
+    /**
+     * Handles override this method to include and override properties with the Camel {@link org.apache.camel.component.properties.PropertiesComponent}.
+     *
+     * @param context the initialized Spring context
+     * @param testClass the test class being executed
+     */
+    public static void handleUseOverridePropertiesWithPropertiesComponent(ConfigurableApplicationContext context, Class<?> testClass) throws Exception {
+        Collection<Method> methods = getAllMethods(testClass);
+        final List<Properties> properties = new LinkedList<>();
+
+        for (Method method : methods) {
+            if (AnnotationUtils.findAnnotation(method, UseOverridePropertiesWithPropertiesComponent.class) != null) {
+                Class<?>[] argTypes = method.getParameterTypes();
+                if (argTypes.length > 0) {
+                    throw new IllegalArgumentException("Method [" + method.getName()
+                            + "] is annotated with UseOverridePropertiesWithPropertiesComponent but is not a no-argument method.");
+                } else if (!Properties.class.isAssignableFrom(method.getReturnType())) {
+                    throw new IllegalArgumentException("Method [" + method.getName()
+                            + "] is annotated with UseOverridePropertiesWithPropertiesComponent but does not return a java.util.Properties.");
+                } else if (!Modifier.isStatic(method.getModifiers())) {
+                    throw new IllegalArgumentException("Method [" + method.getName()
+                            + "] is annotated with UseOverridePropertiesWithPropertiesComponent but is not static.");
+                } else if (!Modifier.isPublic(method.getModifiers())) {
+                    throw new IllegalArgumentException("Method [" + method.getName()
+                            + "] is annotated with UseOverridePropertiesWithPropertiesComponent but is not public.");
+                }
+
+                try {
+                    properties.add((Properties) method.invoke(null));
+                } catch (Exception e) {
+                    throw new RuntimeException("Method [" + method.getName()
+                            + "] threw exception during evaluation.", e);
+                }
+            }
+        }
+
+        if (properties.size() != 0) {
+            CamelSpringTestHelper.doToSpringCamelContexts(context, new CamelSpringTestHelper.DoToSpringCamelContextsStrategy() {
+                public void execute(String contextName, SpringCamelContext camelContext) throws Exception {
+                    PropertiesComponent pc = camelContext.getComponent("properties", PropertiesComponent.class);
+                    Properties extra = new Properties();
+                    for (Properties prop : properties) {
+                        extra.putAll(prop);
+                    }
+                    if (!extra.isEmpty()) {
+                        LOGGER.info("Using {} properties to override any existing properties on the PropertiesComponent on CamelContext with name [{}].", extra.size(), contextName);
+                        pc.setOverrideProperties(extra);
+                    }
+                }
+            });
+        }
+    }
+
+    /**
+     * Handles starting of Camel contexts based on {@link UseAdviceWith} and other state in the JVM.
+     *
+     * @param context the initialized Spring context
+     * @param testClass the test class being executed
+     */
+    public static void handleCamelContextStartup(ConfigurableApplicationContext context, Class<?> testClass) throws Exception {
+        boolean skip = "true".equalsIgnoreCase(System.getProperty("skipStartingCamelContext"));
+        if (skip) {
+            LOGGER.info("Skipping starting CamelContext(s) as system property skipStartingCamelContext is set to be true.");
+        } else if (testClass.isAnnotationPresent(UseAdviceWith.class)) {
+            if (testClass.getAnnotation(UseAdviceWith.class).value()) {
+                LOGGER.info("Skipping starting CamelContext(s) as UseAdviceWith annotation was found and isUseAdviceWith is set to true.");
+                skip = true;
+            } else {
+                LOGGER.info("Starting CamelContext(s) as UseAdviceWith annotation was found, but isUseAdviceWith is set to false.");
+                skip = false;
+            }
+        }
+
+        if (!skip) {
+            CamelSpringTestHelper.doToSpringCamelContexts(context, new CamelSpringTestHelper.DoToSpringCamelContextsStrategy() {
+                public void execute(String contextName,
+                                    SpringCamelContext camelContext) throws Exception {
+                    if (!camelContext.isStarted()) {
+                        LOGGER.info("Starting CamelContext with name [{}].", contextName);
+                        camelContext.start();
+                    } else {
+                        LOGGER.debug("CamelContext with name [{}] already started.", contextName);
+                    }
+                }
+            });
+        }
+    }
+
+}
diff --git a/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringBootExecutionListener.java b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringBootExecutionListener.java
new file mode 100644
index 0000000..4192e5e
--- /dev/null
+++ b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringBootExecutionListener.java
@@ -0,0 +1,95 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.spring;
+
+import org.apache.camel.spring.SpringCamelContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.context.ConfigurableApplicationContext;
+import org.springframework.test.context.TestContext;
+import org.springframework.test.context.support.AbstractTestExecutionListener;
+
+public class CamelSpringBootExecutionListener extends AbstractTestExecutionListener {
+
+    protected static ThreadLocal<ConfigurableApplicationContext> threadApplicationContext = new ThreadLocal<>();
+
+    private static final Logger LOG = LoggerFactory.getLogger(CamelSpringBootExecutionListener.class);
+
+    @Override
+    public void prepareTestInstance(TestContext testContext) throws Exception {
+        LOG.info("@RunWith(CamelSpringBootRunner.class) preparing: {}", testContext.getTestClass());
+
+        Class<?> testClass = testContext.getTestClass();
+
+        // need to prepare this before we load spring application context
+        CamelAnnotationsHandler.handleExcludeRoutesForSpringBoot(testClass);
+
+        // we are customizing the Camel context with
+        // CamelAnnotationsHandler so we do not want to start it
+        // automatically, which would happen when SpringCamelContext
+        // is added to Spring ApplicationContext, so we set the flag
+        // not to start it just yet
+        SpringCamelContext.setNoStart(true);
+        System.setProperty("skipStartingCamelContext", "true");
+        ConfigurableApplicationContext context = (ConfigurableApplicationContext) testContext.getApplicationContext();
+
+        // Post CamelContext(s) instantiation but pre CamelContext(s) start setup
+        CamelAnnotationsHandler.handleProvidesBreakpoint(context, testClass);
+        CamelAnnotationsHandler.handleShutdownTimeout(context, testClass);
+        CamelAnnotationsHandler.handleMockEndpoints(context, testClass);
+        CamelAnnotationsHandler.handleMockEndpointsAndSkip(context, testClass);
+        CamelAnnotationsHandler.handleUseOverridePropertiesWithPropertiesComponent(context, testClass);
+
+        System.clearProperty("skipStartingCamelContext");
+        SpringCamelContext.setNoStart(false);
+    }
+
+    @Override
+    public void beforeTestMethod(TestContext testContext) throws Exception {
+        LOG.info("@RunWith(CamelSpringBootRunner.class) before: {}.{}", testContext.getTestClass(), testContext.getTestMethod().getName());
+
+        Class<?> testClass = testContext.getTestClass();
+        String testName = testContext.getTestMethod().getName();
+
+        ConfigurableApplicationContext context = (ConfigurableApplicationContext) testContext.getApplicationContext();
+        threadApplicationContext.set(context);
+
+        // mark Camel to be startable again and start Camel
+        System.clearProperty("skipStartingCamelContext");
+
+        // route coverage need to know the test method
+        CamelAnnotationsHandler.handleRouteCoverage(context, testClass, s -> testName);
+
+        LOG.info("Initialized CamelSpringBootRunner now ready to start CamelContext");
+        CamelAnnotationsHandler.handleCamelContextStartup(context, testClass);
+    }
+
+    @Override
+    public void afterTestMethod(TestContext testContext) throws Exception {
+        LOG.info("@RunWith(CamelSpringBootRunner.class) after: {}.{}", testContext.getTestClass(), testContext.getTestMethod().getName());
+
+        Class<?> testClass = testContext.getTestClass();
+        String testName = testContext.getTestMethod().getName();
+
+        ConfigurableApplicationContext context = threadApplicationContext.get();
+        if (context != null && context.isRunning()) {
+            // dump route coverage for each test method so its accurate statistics
+            // even if spring application context is running (i.e. its not dirtied per test method)
+            CamelAnnotationsHandler.handleRouteCoverageDump(context, testClass, s -> testName);
+        }
+    }
+}
diff --git a/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringBootJUnit4ClassRunner.java b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringBootJUnit4ClassRunner.java
new file mode 100644
index 0000000..d96c903
--- /dev/null
+++ b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringBootJUnit4ClassRunner.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.spring;
+
+import org.junit.runners.model.InitializationError;
+
+/**
+ * The class {@link CamelSpringBootJUnit4ClassRunner} has been renamed to {@link CamelSpringBootRunner}
+ * which is a shorter and easier to remember name.
+ *
+ * @deprecated use {@link CamelSpringBootRunner}
+ */
+@Deprecated
+public class CamelSpringBootJUnit4ClassRunner extends CamelSpringBootRunner {
+
+    public CamelSpringBootJUnit4ClassRunner(Class<?> clazz) throws InitializationError {
+        super(clazz);
+    }
+}
diff --git a/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringBootRunner.java b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringBootRunner.java
new file mode 100644
index 0000000..fbd3a2e
--- /dev/null
+++ b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringBootRunner.java
@@ -0,0 +1,87 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.spring;
+
+import java.util.List;
+
+import org.junit.runners.model.InitializationError;
+import org.springframework.test.context.TestContextManager;
+import org.springframework.test.context.TestExecutionListener;
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+
+/**
+ * An implementation bringing the functionality of {@link CamelSpringTestSupport} to
+ * Spring Boot Test based test cases.  This approach allows developers to implement tests
+ * for their Spring Boot based applications/routes using the typical Spring Test conventions
+ * for test development.
+ */
+public class CamelSpringBootRunner extends SpringJUnit4ClassRunner {
+
+    public CamelSpringBootRunner(Class<?> clazz) throws InitializationError {
+        super(clazz);
+    }
+
+    /**
+     * Returns the specialized manager instance that provides tight integration between Camel testing
+     * features and Spring.
+     *
+     * @return a new instance of {@link CamelTestContextManager}.
+     */
+    @Override
+    protected TestContextManager createTestContextManager(Class<?> clazz) {
+        return new CamelTestContextManager(clazz);
+    }
+
+    /**
+     * An implementation providing additional integration between Spring Test and Camel
+     * testing features.
+     */
+    public static final class CamelTestContextManager extends TestContextManager {
+
+        public CamelTestContextManager(Class<?> testClass) {
+            super(testClass);
+
+            // turn off auto starting spring as we need to do this later
+            System.setProperty("skipStartingCamelContext", "true");
+
+            // is Camel already registered
+            if (!alreadyRegistered()) {
+                // inject Camel first, and then disable jmx and add the stop-watch
+                List<TestExecutionListener> list = getTestExecutionListeners();
+                list.add(0, new CamelSpringTestContextLoaderTestExecutionListener());
+                list.add(1, new DisableJmxTestExecutionListener());
+                list.add(2, new CamelSpringBootExecutionListener());
+                list.add(3, new StopWatchTestExecutionListener());
+            }
+        }
+
+        private boolean alreadyRegistered() {
+            List<TestExecutionListener> list = getTestExecutionListeners();
+            if (list != null) {
+                for (TestExecutionListener listener : list) {
+                    if (listener instanceof CamelSpringTestContextLoaderTestExecutionListener) {
+                        return true;
+                    }
+                }
+            }
+
+            return false;
+        }
+
+    }
+
+}
diff --git a/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringDelegatingTestContextLoader.java b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringDelegatingTestContextLoader.java
new file mode 100644
index 0000000..ce486e5
--- /dev/null
+++ b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringDelegatingTestContextLoader.java
@@ -0,0 +1,138 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.spring;
+
+import java.lang.reflect.Method;
+
+import org.apache.camel.api.management.JmxSystemPropertyKeys;
+import org.apache.camel.spring.SpringCamelContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.support.BeanDefinitionRegistry;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ConfigurableApplicationContext;
+import org.springframework.context.annotation.AnnotationConfigUtils;
+import org.springframework.test.context.MergedContextConfiguration;
+import org.springframework.test.context.support.DelegatingSmartContextLoader;
+
+/**
+ * CamelSpringDelegatingTestContextLoader which fixes issues in Camel's JavaConfigContextLoader. (adds support for Camel's test annotations)
+ * <br>
+ * <em>This loader can handle either classes or locations for configuring the context.</em>
+ * <br>
+ * NOTE: This TestContextLoader doesn't support the annotation of ExcludeRoutes now.
+ *
+ * @deprecated use {@link CamelSpringRunner} or {@link CamelSpringBootRunner} instead.
+ */
+@Deprecated
+public class CamelSpringDelegatingTestContextLoader extends DelegatingSmartContextLoader {
+
+    protected final Logger logger = LoggerFactory.getLogger(getClass());
+
+    @Override
+    public ApplicationContext loadContext(MergedContextConfiguration mergedConfig) throws Exception {
+        
+        Class<?> testClass = getTestClass();
+        
+        if (logger.isDebugEnabled()) {
+            logger.debug("Loading ApplicationContext for merged context configuration [{}].", mergedConfig);
+        }
+        
+        // Pre CamelContext(s) instantiation setup
+        CamelAnnotationsHandler.handleDisableJmx(null, testClass);
+
+        try {
+            SpringCamelContext.setNoStart(true);
+            System.setProperty("skipStartingCamelContext", "true");
+            ConfigurableApplicationContext context = (ConfigurableApplicationContext) super.loadContext(mergedConfig);
+            SpringCamelContext.setNoStart(false);
+            System.clearProperty("skipStartingCamelContext");
+            return loadContext(context, testClass);
+        } finally {
+            cleanup(testClass);
+        }
+    }
+
+    /**
+     * Performs the bulk of the Spring application context loading/customization.
+     *
+     * @param context the partially configured context.  The context should have the bean definitions loaded, but nothing else.
+     * @param testClass the test class being executed
+     * @return the initialized (refreshed) Spring application context
+     *
+     * @throws Exception if there is an error during initialization/customization
+     */
+    public ApplicationContext loadContext(ConfigurableApplicationContext context, Class<?> testClass)
+        throws Exception {
+            
+        AnnotationConfigUtils.registerAnnotationConfigProcessors((BeanDefinitionRegistry) context);
+
+        // Post CamelContext(s) instantiation but pre CamelContext(s) start setup
+        CamelAnnotationsHandler.handleRouteCoverage(context, testClass, s -> getTestMethod().getName());
+        CamelAnnotationsHandler.handleProvidesBreakpoint(context, testClass);
+        CamelAnnotationsHandler.handleShutdownTimeout(context, testClass);
+        CamelAnnotationsHandler.handleMockEndpoints(context, testClass);
+        CamelAnnotationsHandler.handleMockEndpointsAndSkip(context, testClass);
+        CamelAnnotationsHandler.handleUseOverridePropertiesWithPropertiesComponent(context, testClass);
+        
+        // CamelContext(s) startup
+        CamelAnnotationsHandler.handleCamelContextStartup(context, testClass);
+        
+        return context;
+    }
+    
+    /**
+     * Cleanup/restore global state to defaults / pre-test values after the test setup
+     * is complete. 
+     * 
+     * @param testClass the test class being executed
+     */
+    protected void cleanup(Class<?> testClass) {
+        SpringCamelContext.setNoStart(false);
+        
+        if (testClass.isAnnotationPresent(DisableJmx.class)) {
+            if (CamelSpringTestHelper.getOriginalJmxDisabled() == null) {
+                System.clearProperty(JmxSystemPropertyKeys.DISABLED);
+            } else {
+                System.setProperty(JmxSystemPropertyKeys.DISABLED,
+                    CamelSpringTestHelper.getOriginalJmxDisabled());
+            }
+        }
+    }
+
+    /**
+     * Returns the class under test in order to enable inspection of annotations while the
+     * Spring context is being created.
+     * 
+     * @return the test class that is being executed
+     * @see CamelSpringTestHelper
+     */
+    protected Class<?> getTestClass() {
+        return CamelSpringTestHelper.getTestClass();
+    }
+
+    /**
+     * Returns the test method under test.
+     *
+     * @return the method that is being executed
+     * @see CamelSpringTestHelper
+     */
+    protected Method getTestMethod() {
+        return CamelSpringTestHelper.getTestMethod();
+    }
+
+}
diff --git a/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringRunner.java b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringRunner.java
new file mode 100644
index 0000000..d64ce29
--- /dev/null
+++ b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringRunner.java
@@ -0,0 +1,83 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.spring;
+
+import java.util.List;
+
+import org.junit.runners.model.InitializationError;
+import org.springframework.test.context.TestContextManager;
+import org.springframework.test.context.TestExecutionListener;
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+
+/**
+ * An implementation bringing the functionality of {@link org.apache.camel.test.spring.CamelSpringTestSupport} to
+ * Spring Test based test cases.  This approach allows developers to implement tests
+ * for their Spring based applications/routes using the typical Spring Test conventions
+ * for test development.
+ */
+public class CamelSpringRunner extends SpringJUnit4ClassRunner {
+
+    public CamelSpringRunner(Class<?> clazz) throws InitializationError {
+        super(clazz);
+    }
+
+    /**
+     * Returns the specialized manager instance that provides tight integration between Camel testing
+     * features and Spring.
+     *
+     * @return a new instance of {@link CamelTestContextManager}.
+     */
+    @Override
+    protected TestContextManager createTestContextManager(Class<?> clazz) {
+        return new CamelTestContextManager(clazz);
+    }
+
+    /**
+     * An implementation providing additional integration between Spring Test and Camel
+     * testing features.
+     */
+    public static final class CamelTestContextManager extends TestContextManager {
+
+        public CamelTestContextManager(Class<?> testClass) {
+            super(testClass);
+
+            // is Camel already registered
+            if (!alreadyRegistered()) {
+                // inject Camel first, and then disable jmx and add the stop-watch
+                List<TestExecutionListener> list = getTestExecutionListeners();
+                list.add(0, new CamelSpringTestContextLoaderTestExecutionListener());
+                list.add(1, new DisableJmxTestExecutionListener());
+                list.add(2, new StopWatchTestExecutionListener());
+            }
+        }
+
+        private boolean alreadyRegistered() {
+            List<TestExecutionListener> list = getTestExecutionListeners();
+            if (list != null) {
+                for (TestExecutionListener listener : list) {
+                    if (listener instanceof CamelSpringTestContextLoaderTestExecutionListener) {
+                        return true;
+                    }
+                }
+            }
+
+            return false;
+        }
+
+    }
+
+}
diff --git a/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringTestContextLoader.java b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringTestContextLoader.java
new file mode 100644
index 0000000..99e52e0
--- /dev/null
+++ b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringTestContextLoader.java
@@ -0,0 +1,551 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.spring;
+
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Properties;
+import java.util.concurrent.TimeUnit;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.ExtendedCamelContext;
+import org.apache.camel.api.management.JmxSystemPropertyKeys;
+import org.apache.camel.impl.engine.InterceptSendToMockEndpointStrategy;
+import org.apache.camel.processor.interceptor.DefaultDebugger;
+import org.apache.camel.spi.Breakpoint;
+import org.apache.camel.spi.Debugger;
+import org.apache.camel.spi.EventNotifier;
+import org.apache.camel.spi.PropertiesComponent;
+import org.apache.camel.spring.SpringCamelContext;
+import org.apache.camel.test.ExcludingPackageScanClassResolver;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.apache.camel.test.junit5.spring.CamelSpringTestHelper.DoToSpringCamelContextsStrategy;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.config.BeanPostProcessor;
+import org.springframework.beans.factory.support.RootBeanDefinition;
+import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ConfigurableApplicationContext;
+import org.springframework.context.annotation.AnnotationConfigUtils;
+import org.springframework.context.support.GenericApplicationContext;
+import org.springframework.core.annotation.AnnotationUtils;
+import org.springframework.test.context.MergedContextConfiguration;
+import org.springframework.test.context.support.AbstractContextLoader;
+import org.springframework.test.context.support.AbstractGenericContextLoader;
+import org.springframework.test.context.support.GenericXmlContextLoader;
+import org.springframework.util.StringUtils;
+
+import static org.apache.camel.test.spring.CamelSpringTestHelper.getAllMethods;
+
+/**
+ * Replacement for the default {@link GenericXmlContextLoader} that provides hooks for
+ * processing some class level Camel related test annotations.
+ */
+public class CamelSpringTestContextLoader extends AbstractContextLoader {
+    
+    private static final Logger LOG = LoggerFactory.getLogger(CamelSpringTestContextLoader.class);
+    
+    /**
+     *  Modeled after the Spring implementation in {@link AbstractGenericContextLoader},
+     *  this method creates and refreshes the application context while providing for
+     *  processing of additional Camel specific post-refresh actions.  We do not provide the
+     *  pre-post hooks for customization seen in {@link AbstractGenericContextLoader} because
+     *  they probably are unnecessary for 90+% of users.
+     *  <p/>
+     *  For some functionality, we cannot use {@link org.springframework.test.context.TestExecutionListener} because we need
+     *  to both produce the desired outcome during application context loading, and also cleanup
+     *  after ourselves even if the test class never executes.  Thus the listeners, which
+     *  only run if the application context is successfully initialized are insufficient to
+     *  provide the behavior described above.
+     */
+    @Override
+    public ApplicationContext loadContext(MergedContextConfiguration mergedConfig) throws Exception {
+        Class<?> testClass = getTestClass();
+        
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("Loading ApplicationContext for merged context configuration [{}].", mergedConfig);
+        }
+        
+        try {            
+            GenericApplicationContext context = createContext(testClass, mergedConfig);
+            prepareContext(context, mergedConfig);
+            loadBeanDefinitions(context, mergedConfig);
+            return loadContext(context, testClass);
+        } finally {
+            cleanup(testClass);
+        }
+    }
+    
+    /**
+     *  Modeled after the Spring implementation in {@link AbstractGenericContextLoader},
+     *  this method creates and refreshes the application context while providing for
+     *  processing of additional Camel specific post-refresh actions.  We do not provide the
+     *  pre-post hooks for customization seen in {@link AbstractGenericContextLoader} because
+     *  they probably are unnecessary for 90+% of users.
+     *  <p/>
+     *  For some functionality, we cannot use {@link org.springframework.test.context.TestExecutionListener} because we need
+     *  to both produce the desired outcome during application context loading, and also cleanup
+     *  after ourselves even if the test class never executes.  Thus the listeners, which
+     *  only run if the application context is successfully initialized are insufficient to
+     *  provide the behavior described above.
+     */
+    @Override
+    public ApplicationContext loadContext(String... locations) throws Exception {
+        
+        Class<?> testClass = getTestClass();
+
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("Loading ApplicationContext for locations [" + StringUtils.arrayToCommaDelimitedString(locations) + "].");
+        }
+        
+        try {
+            GenericApplicationContext context = createContext(testClass, null);
+            loadBeanDefinitions(context, locations);
+            return loadContext(context, testClass);
+        } finally {
+            cleanup(testClass);
+        }
+    }
+
+    /**
+     * Returns &quot;<code>-context.xml</code>&quot;.
+     */
+    @Override
+    public String getResourceSuffix() {
+        return "-context.xml";
+    }
+    
+    /**
+     * Performs the bulk of the Spring application context loading/customization.
+     *
+     * @param context the partially configured context.  The context should have the bean definitions loaded, but nothing else.
+     * @param testClass the test class being executed
+     * @return the initialized (refreshed) Spring application context
+     *
+     * @throws Exception if there is an error during initialization/customization
+     */
+    protected ApplicationContext loadContext(GenericApplicationContext context, Class<?> testClass) throws Exception {
+            
+        AnnotationConfigUtils.registerAnnotationConfigProcessors(context);
+        
+        // Pre CamelContext(s) instantiation setup
+        handleDisableJmx(context, testClass);        
+        handleUseOverridePropertiesWithPropertiesComponent(context, testClass);
+        
+        // Temporarily disable CamelContext start while the contexts are instantiated.
+        SpringCamelContext.setNoStart(true);
+        context.refresh();
+        context.registerShutdownHook();
+        // Turn CamelContext startup back on since the context's have now been instantiated.
+        SpringCamelContext.setNoStart(false);
+        
+        // Post CamelContext(s) instantiation but pre CamelContext(s) start setup
+        handleRouteCoverage(context, testClass);
+        handleProvidesBreakpoint(context, testClass);
+        handleShutdownTimeout(context, testClass);
+        handleMockEndpoints(context, testClass);
+        handleMockEndpointsAndSkip(context, testClass);
+
+        // CamelContext(s) startup
+        handleCamelContextStartup(context, testClass);
+        
+        return context;
+    }
+    
+    /**
+     * Cleanup/restore global state to defaults / pre-test values after the test setup
+     * is complete. 
+     * 
+     * @param testClass the test class being executed
+     */
+    protected void cleanup(Class<?> testClass) {
+        SpringCamelContext.setNoStart(false);
+        
+        if (testClass.isAnnotationPresent(DisableJmx.class)) {
+            if (CamelSpringTestHelper.getOriginalJmxDisabled() == null) {
+                System.clearProperty(JmxSystemPropertyKeys.DISABLED);
+            } else {
+                System.setProperty(JmxSystemPropertyKeys.DISABLED,
+                    CamelSpringTestHelper.getOriginalJmxDisabled());
+            }
+        }
+    }
+    
+    protected void loadBeanDefinitions(GenericApplicationContext context, MergedContextConfiguration mergedConfig) {
+        (new XmlBeanDefinitionReader(context)).loadBeanDefinitions(mergedConfig.getLocations());
+    }
+    
+    protected void loadBeanDefinitions(GenericApplicationContext context, String... locations) {
+        (new XmlBeanDefinitionReader(context)).loadBeanDefinitions(locations);
+    }
+    
+    /**
+     * Creates and starts the Spring context while optionally starting any loaded Camel contexts.
+     *
+     * @param testClass the test class that is being executed
+     * @return the loaded Spring context
+     */
+    protected GenericApplicationContext createContext(Class<?> testClass, MergedContextConfiguration mergedConfig) {
+        ApplicationContext parentContext = null;
+        GenericApplicationContext routeExcludingContext = null;
+        
+        if (mergedConfig != null) {
+            parentContext = mergedConfig.getParentApplicationContext();
+        }
+        
+        if (testClass.isAnnotationPresent(ExcludeRoutes.class)) {
+            Class<?>[] excludedClasses = testClass.getAnnotation(ExcludeRoutes.class).value();
+            
+            if (excludedClasses.length > 0) {
+                if (LOG.isDebugEnabled()) {
+                    LOG.debug("Setting up package scanning excluded classes as ExcludeRoutes "
+                            + "annotation was found. Excluding [" + StringUtils.arrayToCommaDelimitedString(excludedClasses) + "].");
+                }
+                
+                if (parentContext == null) {
+                    routeExcludingContext = new GenericApplicationContext();
+                } else {
+                    routeExcludingContext = new GenericApplicationContext(parentContext);
+                }
+                routeExcludingContext.registerBeanDefinition("excludingResolver", new RootBeanDefinition(ExcludingPackageScanClassResolver.class));
+                routeExcludingContext.refresh();
+                
+                ExcludingPackageScanClassResolver excludingResolver = routeExcludingContext.getBean("excludingResolver", ExcludingPackageScanClassResolver.class);
+                List<Class<?>> excluded = Arrays.asList(excludedClasses);
+                excludingResolver.setExcludedClasses(new HashSet<>(excluded));
+            } else {
+                if (LOG.isDebugEnabled()) {
+                    LOG.debug("Not enabling package scanning excluded classes as ExcludeRoutes "
+                            + "annotation was found but no classes were excluded.");
+                }
+            }
+        }
+        
+        GenericApplicationContext context;
+
+        if (routeExcludingContext != null) {
+            context = new GenericApplicationContext(routeExcludingContext);
+        } else {
+            if (parentContext != null) {
+                context = new GenericApplicationContext(parentContext);
+            } else {
+                context = new GenericApplicationContext();
+            }
+        }
+        
+        return context;
+    }
+    
+    /**
+     * Handles disabling of JMX on Camel contexts based on {@link DisableJmx}.
+     *
+     * @param context the initialized Spring context
+     * @param testClass the test class being executed
+     */
+    protected void handleDisableJmx(GenericApplicationContext context, Class<?> testClass) {
+        CamelSpringTestHelper.setOriginalJmxDisabledValue(System.getProperty(JmxSystemPropertyKeys.DISABLED));
+
+        if (testClass.isAnnotationPresent(DisableJmx.class)) {
+            if (testClass.getAnnotation(DisableJmx.class).value()) {
+                LOG.info("Disabling Camel JMX globally as DisableJmx annotation was found and disableJmx is set to true.");
+                System.setProperty(JmxSystemPropertyKeys.DISABLED, "true");
+            } else {
+                LOG.info("Enabling Camel JMX as DisableJmx annotation was found and disableJmx is set to false.");
+                System.clearProperty(JmxSystemPropertyKeys.DISABLED);
+            }
+        } else if (!testClass.isAnnotationPresent(EnableRouteCoverage.class)) {
+            // route coverage need JMX so do not disable it by default
+            LOG.info("Disabling Camel JMX globally for tests by default.  Use the DisableJMX annotation to override the default setting.");
+            System.setProperty(JmxSystemPropertyKeys.DISABLED, "true");
+        }
+    }
+
+    /**
+     * Handles disabling of JMX on Camel contexts based on {@link DisableJmx}.
+     *
+     * @param context the initialized Spring context
+     * @param testClass the test class being executed
+     */
+    private void handleRouteCoverage(GenericApplicationContext context, Class<?> testClass) throws Exception {
+        if (testClass.isAnnotationPresent(EnableRouteCoverage.class)) {
+            System.setProperty(CamelTestSupport.ROUTE_COVERAGE_ENABLED, "true");
+
+            CamelSpringTestHelper.doToSpringCamelContexts(context, new DoToSpringCamelContextsStrategy() {
+
+                @Override
+                public void execute(String contextName, SpringCamelContext camelContext) throws Exception {
+                    LOG.info("Enabling RouteCoverage");
+                    EventNotifier notifier = new RouteCoverageEventNotifier(testClass.getName(), s -> getTestMethod().getName());
+                    camelContext.addService(notifier, true);
+                    camelContext.getManagementStrategy().addEventNotifier(notifier);
+                }
+            });
+        }
+    }
+
+    /**
+     * Handles the processing of the {@link ProvidesBreakpoint} annotation on a test class.  Exists here
+     * as it is needed in 
+     *
+     * @param context the initialized Spring context containing the Camel context(s) to insert breakpoints into 
+     * @param testClass the test class being processed
+     *
+     * @throws Exception if there is an error processing the class
+     */
+    protected void handleProvidesBreakpoint(GenericApplicationContext context, Class<?> testClass) throws Exception {
+        Collection<Method> methods = getAllMethods(testClass);
+        final List<Breakpoint> breakpoints = new LinkedList<>();
+        
+        for (Method method : methods) {
+            if (AnnotationUtils.findAnnotation(method, ProvidesBreakpoint.class) != null) {
+                Class<?>[] argTypes = method.getParameterTypes();
+                if (argTypes.length != 0) {
+                    throw new IllegalArgumentException("Method [" + method.getName()
+                           + "] is annotated with ProvidesBreakpoint but is not a no-argument method.");
+                } else if (!Breakpoint.class.isAssignableFrom(method.getReturnType())) {
+                    throw new IllegalArgumentException("Method [" + method.getName()
+                           + "] is annotated with ProvidesBreakpoint but does not return a Breakpoint.");
+                } else if (!Modifier.isStatic(method.getModifiers())) {
+                    throw new IllegalArgumentException("Method [" + method.getName()
+                           + "] is annotated with ProvidesBreakpoint but is not static.");
+                } else if (!Modifier.isPublic(method.getModifiers())) {
+                    throw new IllegalArgumentException("Method [" + method.getName()
+                           + "] is annotated with ProvidesBreakpoint but is not public.");
+                }
+                
+                try {
+                    breakpoints.add((Breakpoint) method.invoke(null));
+                } catch (Exception e) {
+                    throw new RuntimeException("Method [" + method.getName()
+                           + "] threw exception during evaluation.", e);
+                }
+            }
+        }
+        
+        if (breakpoints.size() != 0) {
+            CamelSpringTestHelper.doToSpringCamelContexts(context, new DoToSpringCamelContextsStrategy() {
+                
+                @Override
+                public void execute(String contextName, SpringCamelContext camelContext)
+                    throws Exception {
+                    Debugger debugger = camelContext.getDebugger();
+                    if (debugger == null) {
+                        debugger = new DefaultDebugger();
+                        camelContext.setDebugger(debugger);
+                    }
+                    
+                    for (Breakpoint breakpoint : breakpoints) {
+                        LOG.info("Adding Breakpoint [{}] to CamelContext with name [{}].", breakpoint, contextName);
+                        debugger.addBreakpoint(breakpoint);
+                    }
+                }
+            });
+        }
+    }
+    
+    
+    /**
+     * Handles updating shutdown timeouts on Camel contexts based on {@link ShutdownTimeout}.
+     *
+     * @param context the initialized Spring context
+     * @param testClass the test class being executed
+     */
+    protected void handleShutdownTimeout(GenericApplicationContext context, Class<?> testClass) throws Exception {
+        final int shutdownTimeout;
+        final TimeUnit shutdownTimeUnit;
+        if (testClass.isAnnotationPresent(ShutdownTimeout.class)) {
+            shutdownTimeout = testClass.getAnnotation(ShutdownTimeout.class).value();
+            shutdownTimeUnit = testClass.getAnnotation(ShutdownTimeout.class).timeUnit();
+        } else {
+            shutdownTimeout = 10;
+            shutdownTimeUnit = TimeUnit.SECONDS;
+        }
+        
+        CamelSpringTestHelper.doToSpringCamelContexts(context, new DoToSpringCamelContextsStrategy() {
+            
+            @Override
+            public void execute(String contextName, SpringCamelContext camelContext)
+                throws Exception {
+                LOG.info("Setting shutdown timeout to [{} {}] on CamelContext with name [{}].", shutdownTimeout, shutdownTimeUnit, contextName);
+                camelContext.getShutdownStrategy().setTimeout(shutdownTimeout);
+                camelContext.getShutdownStrategy().setTimeUnit(shutdownTimeUnit);
+            }
+        });
+    }
+    
+    /**
+     * Handles auto-intercepting of endpoints with mocks based on {@link MockEndpoints}.
+     *
+     * @param context the initialized Spring context
+     * @param testClass the test class being executed
+     */
+    protected void handleMockEndpoints(GenericApplicationContext context, Class<?> testClass) throws Exception {
+        if (testClass.isAnnotationPresent(MockEndpoints.class)) {
+            final String mockEndpoints = testClass.getAnnotation(MockEndpoints.class).value();
+            CamelSpringTestHelper.doToSpringCamelContexts(context, new DoToSpringCamelContextsStrategy() {
+                
+                @Override
+                public void execute(String contextName, SpringCamelContext camelContext)
+                    throws Exception {
+                    LOG.info("Enabling auto mocking of endpoints matching pattern [{}] on CamelContext with name [{}].", mockEndpoints, contextName);
+                    camelContext.adapt(ExtendedCamelContext.class).registerEndpointCallback(new InterceptSendToMockEndpointStrategy(mockEndpoints));
+                }
+            });
+        }
+    }
+    
+    /**
+     * Handles auto-intercepting of endpoints with mocks based on {@link MockEndpointsAndSkip} and skipping the
+     * original endpoint.
+     *
+     * @param context the initialized Spring context
+     * @param testClass the test class being executed
+     */
+    protected void handleMockEndpointsAndSkip(GenericApplicationContext context, Class<?> testClass) throws Exception {
+        if (testClass.isAnnotationPresent(MockEndpointsAndSkip.class)) {
+            final String mockEndpoints = testClass.getAnnotation(MockEndpointsAndSkip.class).value();
+            CamelSpringTestHelper.doToSpringCamelContexts(context, new DoToSpringCamelContextsStrategy() {
+                
+                @Override
+                public void execute(String contextName, SpringCamelContext camelContext)
+                    throws Exception {
+                    // resovle the property place holders of the mockEndpoints 
+                    String mockEndpointsValue = camelContext.resolvePropertyPlaceholders(mockEndpoints);
+                    LOG.info("Enabling auto mocking and skipping of endpoints matching pattern [{}] on CamelContext with name [{}].", mockEndpointsValue, contextName);
+                    camelContext.adapt(ExtendedCamelContext.class).registerEndpointCallback(new InterceptSendToMockEndpointStrategy(mockEndpointsValue, true));
+                }
+            });
+        }
+    }
+    
+    /**
+     * Sets property overrides for the Camel {@link org.apache.camel.component.properties.PropertiesComponent}.
+     *
+     * @param context the pre-refresh Spring context
+     * @param testClass the test class being executed
+     */
+    protected void handleUseOverridePropertiesWithPropertiesComponent(ConfigurableApplicationContext context, Class<?> testClass) throws Exception {
+        Collection<Method> methods = getAllMethods(testClass);
+        final List<Properties> properties = new LinkedList<>();
+
+        for (Method method : methods) {
+            if (AnnotationUtils.findAnnotation(method, UseOverridePropertiesWithPropertiesComponent.class) != null) {
+                Class<?>[] argTypes = method.getParameterTypes();
+                if (argTypes.length > 0) {
+                    throw new IllegalArgumentException("Method [" + method.getName()
+                            + "] is annotated with UseOverridePropertiesWithPropertiesComponent but is not a no-argument method.");
+                } else if (!Properties.class.isAssignableFrom(method.getReturnType())) {
+                    throw new IllegalArgumentException("Method [" + method.getName()
+                            + "] is annotated with UseOverridePropertiesWithPropertiesComponent but does not return a java.util.Properties.");
+                } else if (!Modifier.isStatic(method.getModifiers())) {
+                    throw new IllegalArgumentException("Method [" + method.getName()
+                            + "] is annotated with UseOverridePropertiesWithPropertiesComponent but is not static.");
+                } else if (!Modifier.isPublic(method.getModifiers())) {
+                    throw new IllegalArgumentException("Method [" + method.getName()
+                            + "] is annotated with UseOverridePropertiesWithPropertiesComponent but is not public.");
+                }
+
+                try {
+                    properties.add((Properties) method.invoke(null));
+                } catch (Exception e) {
+                    throw new RuntimeException("Method [" + method.getName()
+                            + "] threw exception during evaluation.", e);
+                }
+            }
+        }
+        
+        Properties extra = new Properties();
+        for (Properties prop : properties) {
+            extra.putAll(prop);
+        }
+
+        if (!extra.isEmpty()) {
+            context.addBeanFactoryPostProcessor(beanFactory -> beanFactory.addBeanPostProcessor(new BeanPostProcessor() {
+                @Override
+                public Object postProcessAfterInitialization(Object bean, String beanName) {
+                    if (bean instanceof CamelContext) {
+                        CamelContext camelContext = (CamelContext) bean;
+                        PropertiesComponent pc = camelContext.getPropertiesComponent(true);
+                        LOG.info("Using {} properties to override any existing properties on the PropertiesComponent on CamelContext with name [{}].", extra.size(), camelContext.getName());
+                        pc.setOverrideProperties(extra);
+                    }
+                    return bean;
+                }
+            }));
+        }
+    }
+
+    /**
+     * Handles starting of Camel contexts based on {@link UseAdviceWith} and other state in the JVM.
+     *
+     * @param context the initialized Spring context
+     * @param testClass the test class being executed
+     */
+    protected void handleCamelContextStartup(GenericApplicationContext context, Class<?> testClass) throws Exception {
+        boolean skip = "true".equalsIgnoreCase(System.getProperty("skipStartingCamelContext"));
+        if (skip) {
+            LOG.info("Skipping starting CamelContext(s) as system property skipStartingCamelContext is set to be true.");
+        } else if (testClass.isAnnotationPresent(UseAdviceWith.class)) {
+            if (testClass.getAnnotation(UseAdviceWith.class).value()) {
+                LOG.info("Skipping starting CamelContext(s) as UseAdviceWith annotation was found and isUseAdviceWith is set to true.");
+                skip = true;
+            } else {
+                LOG.info("Starting CamelContext(s) as UseAdviceWith annotation was found, but isUseAdviceWith is set to false.");
+                skip = false;
+            }
+        }
+        
+        if (!skip) {
+            CamelSpringTestHelper.doToSpringCamelContexts(context, new DoToSpringCamelContextsStrategy() {
+                
+                @Override
+                public void execute(String contextName,
+                        SpringCamelContext camelContext) throws Exception {
+                    LOG.info("Starting CamelContext with name [{}].", contextName);
+                    camelContext.start();
+                }
+            });
+        }
+    }
+    
+    /**
+     * Returns the class under test in order to enable inspection of annotations while the
+     * Spring context is being created.
+     * 
+     * @return the test class that is being executed
+     * @see CamelSpringTestHelper
+     */
+    protected Class<?> getTestClass() {
+        return CamelSpringTestHelper.getTestClass();
+    }
+
+    /**
+     * Returns the test method under test.
+     *
+     * @return the method that is being executed
+     * @see CamelSpringTestHelper
+     */
+    protected Method getTestMethod() {
+        return CamelSpringTestHelper.getTestMethod();
+    }
+}
diff --git a/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringTestContextLoaderTestExecutionListener.java b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringTestContextLoaderTestExecutionListener.java
new file mode 100644
index 0000000..a749104
--- /dev/null
+++ b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringTestContextLoaderTestExecutionListener.java
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.spring;
+
+import org.springframework.core.Ordered;
+import org.springframework.test.context.TestContext;
+import org.springframework.test.context.support.AbstractTestExecutionListener;
+
+/**
+ * Helper for {@link CamelSpringTestContextLoader} that sets the test class state
+ * in {@link CamelSpringTestHelper} almost immediately before the loader initializes
+ * the Spring context.
+ * <p/>
+ * Implemented as a listener as the state can be set on a {@code ThreadLocal} and we are pretty sure
+ * that the same thread will be used to initialize the Spring context.
+ */
+public class CamelSpringTestContextLoaderTestExecutionListener extends AbstractTestExecutionListener {
+
+    /**
+     * The default implementation returns {@link org.springframework.core.Ordered#LOWEST_PRECEDENCE},
+     * thereby ensuring that custom listeners are ordered after default
+     * listeners supplied by the framework. Can be overridden by subclasses
+     * as necessary.
+     */
+    @Override
+    public int getOrder() {
+        //set Camel first
+        return Ordered.HIGHEST_PRECEDENCE;
+    }
+
+    @Override
+    public void prepareTestInstance(TestContext testContext) throws Exception {
+        CamelSpringTestHelper.setTestClass(testContext.getTestClass());
+        CamelSpringTestHelper.setTestContext(testContext);
+    }
+}
diff --git a/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringTestHelper.java b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringTestHelper.java
new file mode 100644
index 0000000..a9ed288
--- /dev/null
+++ b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringTestHelper.java
@@ -0,0 +1,109 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.spring;
+
+import java.lang.reflect.Method;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+
+import org.apache.camel.spring.SpringCamelContext;
+
+import org.springframework.context.ApplicationContext;
+import org.springframework.test.context.TestContext;
+
+/**
+ * Helper that provides state information across the levels of Spring Test that do not expose the
+ * necessary context/state for integration of Camel testing features into Spring test.  Also
+ * provides utility methods.
+ * <p/>
+ * Note that this class makes use of {@link ThreadLocal}s to maintain some state.  It is imperative
+ * that the state setters and getters are accessed within the scope of a single thread in order
+ * for this class to work right.
+ */
+public final class CamelSpringTestHelper {
+    
+    private static ThreadLocal<String> originalJmxDisabledValue = new ThreadLocal<>();
+    private static ThreadLocal<Class<?>> testClazz = new ThreadLocal<>();
+    private static ThreadLocal<TestContext> testContext = new ThreadLocal<>();
+
+    private CamelSpringTestHelper() {
+    }
+    
+    public static String getOriginalJmxDisabled() {
+        return originalJmxDisabledValue.get();
+    }
+    
+    public static void setOriginalJmxDisabledValue(String originalValue) {
+        originalJmxDisabledValue.set(originalValue);
+    }
+    
+    public static Class<?> getTestClass() {
+        return testClazz.get();
+    }
+    
+    public static void setTestClass(Class<?> testClass) {
+        testClazz.set(testClass);
+    }
+
+    public static Method getTestMethod() {
+        return testContext.get().getTestMethod();
+    }
+
+    public static void setTestContext(TestContext context) {
+        testContext.set(context);
+    }
+
+    /**
+     * Returns all methods defined in {@code clazz} and its superclasses/interfaces.
+     */
+    public static Collection<Method> getAllMethods(Class<?> clazz)  {
+        Set<Method> methods = new LinkedHashSet<>();
+        Class<?> currentClass = clazz;
+        
+        while (currentClass != null) {
+            methods.addAll(Arrays.asList(clazz.getMethods()));
+            currentClass = currentClass.getSuperclass(); 
+        }
+                
+        return methods;
+    }
+    
+    /**
+     * Executes {@code strategy} against all {@link SpringCamelContext}s found in the Spring context.
+     * This method reduces the amount of repeated find and loop code throughout this class.
+     *
+     * @param context the Spring context to search
+     * @param strategy the strategy to execute against the found {@link SpringCamelContext}s
+     *
+     * @throws Exception if there is an error executing any of the strategies
+     */
+    public static void doToSpringCamelContexts(ApplicationContext context, DoToSpringCamelContextsStrategy strategy) throws Exception {
+        Map<String, SpringCamelContext> contexts = context.getBeansOfType(SpringCamelContext.class);
+        
+        for (Entry<String, SpringCamelContext> entry : contexts.entrySet()) {
+            strategy.execute(entry.getKey(), entry.getValue());
+        }
+    }
+    
+    public interface DoToSpringCamelContextsStrategy {
+        void execute(String contextName, SpringCamelContext camelContext) throws Exception;
+    }
+}
diff --git a/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringTestSupport.java b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringTestSupport.java
new file mode 100644
index 0000000..839f675
--- /dev/null
+++ b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringTestSupport.java
@@ -0,0 +1,212 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.spring;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.ExtendedCamelContext;
+import org.apache.camel.spring.SpringCamelContext;
+import org.apache.camel.test.ExcludingPackageScanClassResolver;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.apache.camel.util.IOHelper;
+import org.apache.camel.util.ObjectHelper;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.Assertions;
+import org.springframework.beans.factory.support.RootBeanDefinition;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.support.AbstractApplicationContext;
+import org.springframework.context.support.GenericApplicationContext;
+
+/**
+ * Base test-class for classic Spring application such as standalone, web applications.
+ * Do <tt>not</tt> use this class for Spring Boot testing, instead use <code>@RunWith(CamelSpringBootRunner.class)</code>.
+ */
+public abstract class CamelSpringTestSupport extends CamelTestSupport {
+    protected static ThreadLocal<AbstractApplicationContext> threadAppContext = new ThreadLocal<>();
+    protected static Object lock = new Object();
+    
+    protected AbstractApplicationContext applicationContext;
+    protected abstract AbstractApplicationContext createApplicationContext();
+
+    @Override
+    public void postProcessTest() throws Exception {
+        if (isCreateCamelContextPerClass()) {
+            applicationContext = threadAppContext.get();
+        }
+        super.postProcessTest();
+    }
+
+    @Override
+    public void doPreSetup() throws Exception {
+        if (!"true".equalsIgnoreCase(System.getProperty("skipStartingCamelContext"))) {
+            // tell camel-spring it should not trigger starting CamelContext, since we do that later
+            // after we are finished setting up the unit test
+            synchronized (lock) {
+                SpringCamelContext.setNoStart(true);
+                if (isCreateCamelContextPerClass()) {
+                    applicationContext = threadAppContext.get();
+                    if (applicationContext == null) {
+                        applicationContext = doCreateApplicationContext();
+                        threadAppContext.set(applicationContext);
+                    }
+                } else {
+                    applicationContext = doCreateApplicationContext();
+                }
+                SpringCamelContext.setNoStart(false);
+            }
+        } else {
+            log.info("Skipping starting CamelContext as system property skipStartingCamelContext is set to be true.");
+        }
+    }
+
+    private AbstractApplicationContext doCreateApplicationContext() {
+        AbstractApplicationContext context = createApplicationContext();
+        Assertions.assertNotNull(context, "Should have created a valid Spring application context");
+
+        String[] profiles = activeProfiles();
+        if (profiles != null && profiles.length > 0) {
+            // the context must not be active
+            if (context.isActive()) {
+                throw new IllegalStateException("Cannot active profiles: " + Arrays.asList(profiles) + " on active Spring application context: " + context
+                    + ". The code in your createApplicationContext() method should be adjusted to create the application context with refresh = false as parameter");
+            }
+            log.info("Spring activating profiles: {}", Arrays.asList(profiles));
+            context.getEnvironment().setActiveProfiles(profiles);
+        }
+
+        // ensure the context has been refreshed at least once
+        if (!context.isActive()) {
+            context.refresh();
+        }
+
+        return context;
+    }
+
+    @Override
+    @AfterEach
+    public void tearDown() throws Exception {
+        super.tearDown();
+
+        if (!isCreateCamelContextPerClass()) {
+            IOHelper.close(applicationContext);
+            applicationContext = null;
+        }
+    }
+
+    @Override
+    public void doPostTearDown() throws Exception {
+        super.doPostTearDown();
+
+        if (threadAppContext.get() != null) {
+            IOHelper.close(threadAppContext.get());
+            threadAppContext.remove();
+        }
+    }
+    
+    /**
+     * Create a parent context that initializes a
+     * {@link org.apache.camel.spi.PackageScanClassResolver} to exclude a set of given classes from
+     * being resolved. Typically this is used at test time to exclude certain routes,
+     * which might otherwise be just noisy, from being discovered and initialized.
+     * <p/>
+     * To use this filtering mechanism it is necessary to provide the
+     * {@link org.springframework.context.ApplicationContext} returned from here as the parent context to
+     * your test context e.g.
+     *
+     * <pre>
+     * protected AbstractXmlApplicationContext createApplicationContext() {
+     *     return new ClassPathXmlApplicationContext(new String[] {&quot;test-context.xml&quot;}, getRouteExcludingApplicationContext());
+     * }
+     * </pre>
+     *
+     * This will, in turn, call the template methods <code>excludedRoutes</code>
+     * and <code>excludedRoute</code> to determine the classes to be excluded from scanning.
+     *
+     * @return ApplicationContext a parent {@link org.springframework.context.ApplicationContext} configured
+     *         to exclude certain classes from package scanning
+     */
+    protected ApplicationContext getRouteExcludingApplicationContext() {
+        GenericApplicationContext routeExcludingContext = new GenericApplicationContext();
+        routeExcludingContext.registerBeanDefinition("excludingResolver", new RootBeanDefinition(ExcludingPackageScanClassResolver.class));
+        routeExcludingContext.refresh();
+
+        ExcludingPackageScanClassResolver excludingResolver = routeExcludingContext.getBean("excludingResolver", ExcludingPackageScanClassResolver.class);
+        List<Class<?>> excluded = Arrays.asList(excludeRoutes());
+        excludingResolver.setExcludedClasses(new HashSet<>(excluded));
+
+        return routeExcludingContext;
+    }
+
+    /**
+     * Template method used to exclude {@link org.apache.camel.Route} from the test time context
+     * route scanning
+     *
+     * @return Class[] the classes to be excluded from test time context route scanning
+     */
+    protected Class<?>[] excludeRoutes() {
+        Class<?> excludedRoute = excludeRoute();
+        return excludedRoute != null ? new Class[] {excludedRoute} : new Class[0];
+    }
+
+    /**
+     * Template method used to exclude a {@link org.apache.camel.Route} from the test camel context
+     */
+    protected Class<?> excludeRoute() {
+        return null;
+    }
+
+    /**
+     * Looks up the mandatory spring bean of the given name and type, failing if
+     * it is not present or the correct type
+     */
+    public <T> T getMandatoryBean(Class<T> type, String name) {
+        Object value = applicationContext.getBean(name);
+        Assertions.assertNotNull(value, "No spring bean found for name <" + name + ">");
+        if (type.isInstance(value)) {
+            return type.cast(value);
+        } else {
+            Assertions.fail("Spring bean <" + name + "> is not an instanceof " + type.getName() + " but is of type " + ObjectHelper.className(value));
+            return null;
+        }
+    }
+
+    /**
+     * Which active profiles should be used.
+     * <p/>
+     * <b>Important:</b> When using active profiles, then the code in {@link #createApplicationContext()} should create
+     * the Spring {@link org.springframework.context.support.AbstractApplicationContext} without refreshing. For example creating an
+     * {@link org.springframework.context.support.ClassPathXmlApplicationContext} you would need to pass in
+     * <tt>false</tt> in the refresh parameter, in the constructor.
+     * Camel will thrown an {@link IllegalStateException} if this is not correct stating this problem.
+     * The reason is that we cannot active profiles <b>after</b> a Spring application context has already
+     * been refreshed, and is active.
+     *
+     * @return an array of active profiles to use, use <tt>null</tt> to not use any active profiles.
+     */
+    protected String[] activeProfiles() {
+        return null;
+    }
+
+    @Override
+    protected CamelContext createCamelContext() throws Exception {
+        // don't start the springCamelContext if we
+        return SpringCamelContext.springCamelContext(applicationContext, false);
+    }
+}
diff --git a/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelTestContextBootstrapper.java b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelTestContextBootstrapper.java
new file mode 100644
index 0000000..aef6e19
--- /dev/null
+++ b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelTestContextBootstrapper.java
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.spring;
+
+import org.springframework.test.context.ContextLoader;
+import org.springframework.test.context.support.DefaultTestContextBootstrapper;
+
+/**
+ * To bootstrap Camel for testing with Spring 4.1 onwards.
+ */
+public class CamelTestContextBootstrapper extends DefaultTestContextBootstrapper {
+
+    @Override
+    protected Class<? extends ContextLoader> getDefaultContextLoaderClass(Class<?> testClass) {
+        return CamelSpringTestContextLoader.class;
+    }
+}
diff --git a/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/DisableJmx.java b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/DisableJmx.java
new file mode 100644
index 0000000..b3f44c1
--- /dev/null
+++ b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/DisableJmx.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.spring;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Indicates if JMX should be globally disabled in the {@code CamelContext}s that are bootstrapped 
+ * during the test through the use of Spring Test loaded application contexts.  Note that the
+ * presence of this annotation will result in the manipulation of System Properties that
+ * will affect Camel contexts constructed outside of the Spring Test loaded application contexts.
+ */
+@Documented
+@Inherited
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.TYPE})
+public @interface DisableJmx {
+    
+    /**
+     * Whether the test annotated with this annotation should be run with JMX disabled in Camel.
+     * Defaults to {@code true}. 
+     */
+    boolean value() default true;
+}
diff --git a/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/DisableJmxTestExecutionListener.java b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/DisableJmxTestExecutionListener.java
new file mode 100644
index 0000000..f3aaee6
--- /dev/null
+++ b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/DisableJmxTestExecutionListener.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.spring;
+
+import org.apache.camel.api.management.JmxSystemPropertyKeys;
+import org.springframework.test.context.TestContext;
+import org.springframework.test.context.support.AbstractTestExecutionListener;
+
+/**
+ * Provides reset to pre-test state behavior for global enable/disable of JMX
+ * support in Camel through the use of {@link DisableJmx}.
+ * Tries to ensure that the pre-test value is restored.
+ */
+public class DisableJmxTestExecutionListener extends AbstractTestExecutionListener {
+
+    @Override
+    public void afterTestClass(TestContext testContext) throws Exception {
+        if (CamelSpringTestHelper.getOriginalJmxDisabled() == null) {
+            System.clearProperty(JmxSystemPropertyKeys.DISABLED);
+        } else {
+            System.setProperty(JmxSystemPropertyKeys.DISABLED, CamelSpringTestHelper.getOriginalJmxDisabled());
+        }
+    }
+
+}
diff --git a/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/EnableRouteCoverage.java b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/EnableRouteCoverage.java
new file mode 100644
index 0000000..9b846b9
--- /dev/null
+++ b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/EnableRouteCoverage.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.spring;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Enables dumping route coverage statistic.
+ * The route coverage status is written as xml files in the <tt>target/camel-route-coverage</tt> directory after the test has finished.
+ * <p/>
+ * This allows tooling or manual inspection of the stats, so you can generate a route trace diagram of which EIPs
+ * have been in use and which have not. Similar concepts as a code coverage report.
+ * <p/>
+ * You can also turn on route coverage globally via setting JVM system property <tt>CamelTestRouteCoverage=true</tt>.
+ */
+@Documented
+@Inherited
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.TYPE})
+public @interface EnableRouteCoverage {
+
+}
diff --git a/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/ExcludeRoutes.java b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/ExcludeRoutes.java
new file mode 100644
index 0000000..eab25f0
--- /dev/null
+++ b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/ExcludeRoutes.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.spring;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import org.apache.camel.RoutesBuilder;
+
+/**
+ * Indicates if certain route builder classes should be excluded from discovery.  
+ * Initializes a {@link org.apache.camel.spi.PackageScanClassResolver} to exclude a set of given
+ * classes from being resolved. Typically this is used at test time to exclude certain routes,
+ * which might otherwise be noisy, from being discovered and initialized.
+ */
+@Documented
+@Inherited
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.TYPE})
+public @interface ExcludeRoutes {
+
+    /**
+     * The classes to exclude from resolution when using package scanning.
+     */
+    Class<? extends RoutesBuilder>[] value() default {};
+}
diff --git a/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/MockEndpoints.java b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/MockEndpoints.java
new file mode 100644
index 0000000..2e9215a
--- /dev/null
+++ b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/MockEndpoints.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.spring;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import org.apache.camel.impl.engine.InterceptSendToMockEndpointStrategy;
+
+/**
+ * Triggers the auto-mocking of endpoints whose URIs match the provided filter.  The default
+ * filter is "*" which matches all endpoints.  See {@link InterceptSendToMockEndpointStrategy} for
+ * more details on the registration of the mock endpoints.
+ */
+@Documented
+@Inherited
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.TYPE})
+public @interface MockEndpoints {
+    
+    /**
+     * The pattern to use for matching endpoints to enable mocking on.
+     */
+    String value() default "*";
+}
diff --git a/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/MockEndpointsAndSkip.java b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/MockEndpointsAndSkip.java
new file mode 100644
index 0000000..4e88a3c
--- /dev/null
+++ b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/MockEndpointsAndSkip.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.spring;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import org.apache.camel.impl.engine.InterceptSendToMockEndpointStrategy;
+
+/**
+ * Triggers the auto-mocking of endpoints whose URIs match the provided filter with the added provision
+ * that the endpoints are also skipped.  The default filter is "*" which matches all endpoints.
+ * See {@link InterceptSendToMockEndpointStrategy} for more details on the registration of the mock endpoints.
+ */
+@Documented
+@Inherited
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.TYPE})
+public @interface MockEndpointsAndSkip {
+    
+    /**
+     * The pattern to use for matching endpoints to enable mocking on.
+     */
+    String value() default "*";
+}
diff --git a/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/ProvidesBreakpoint.java b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/ProvidesBreakpoint.java
new file mode 100644
index 0000000..088b313
--- /dev/null
+++ b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/ProvidesBreakpoint.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.spring;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import org.apache.camel.spi.Breakpoint;
+
+/**
+ * Indicates that the annotated method returns a {@link Breakpoint} for use in the test.  Useful for intercepting
+ * traffic to all endpoints or simply for setting a break point in an IDE for debugging.  The method must
+ * be {@code public}, {@code static}, take no arguments, and return {@link Breakpoint}.
+ */
+@Documented
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.METHOD})
+public @interface ProvidesBreakpoint {
+}
diff --git a/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/RouteCoverageDumper.java b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/RouteCoverageDumper.java
new file mode 100644
index 0000000..11b11b2
--- /dev/null
+++ b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/RouteCoverageDumper.java
@@ -0,0 +1,82 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.spring;
+
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.api.management.ManagedCamelContext;
+import org.apache.camel.api.management.mbean.ManagedCamelContextMBean;
+import org.apache.camel.util.IOHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Helper to dump route coverage when using {@link EnableRouteCoverage}.
+ */
+public final class RouteCoverageDumper {
+
+    private static final Logger LOG = LoggerFactory.getLogger(RouteCoverageDumper.class);
+
+    private RouteCoverageDumper() {
+    }
+
+    public static void dumpRouteCoverage(CamelContext context, String testClassName, String testName) {
+        try {
+            String dir = "target/camel-route-coverage";
+            String name = testClassName + "-" + testName + ".xml";
+
+            ManagedCamelContextMBean managedCamelContext = context.getExtension(ManagedCamelContext.class).getManagedCamelContext();
+            if (managedCamelContext == null) {
+                LOG.warn("Cannot dump route coverage to file as JMX is not enabled. Override useJmx() method to enable JMX in the unit test classes.");
+            } else {
+                String xml = managedCamelContext.dumpRoutesCoverageAsXml();
+                String combined = "<camelRouteCoverage>\n" + gatherTestDetailsAsXml(testClassName, testName) + xml + "\n</camelRouteCoverage>";
+
+                File file = new File(dir);
+                // ensure dir exists
+                file.mkdirs();
+                file = new File(dir, name);
+
+                LOG.info("Dumping route coverage to file: " + file);
+                InputStream is = new ByteArrayInputStream(combined.getBytes());
+                OutputStream os = new FileOutputStream(file, false);
+                IOHelper.copyAndCloseInput(is, os);
+                IOHelper.close(os);
+            }
+        } catch (Exception e) {
+            LOG.warn("Error during dumping route coverage statistic. This exception is ignored.", e);
+        }
+
+    }
+
+    /**
+     * Gathers test details as xml
+     */
+    private static String gatherTestDetailsAsXml(String testClassName, String testName) {
+        StringBuilder sb = new StringBuilder();
+        sb.append("<test>\n");
+        sb.append("  <class>").append(testClassName).append("</class>\n");
+        sb.append("  <method>").append(testName).append("</method>\n");
+        sb.append("</test>\n");
+        return sb.toString();
+    }
+}
diff --git a/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/RouteCoverageEventNotifier.java b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/RouteCoverageEventNotifier.java
new file mode 100644
index 0000000..7d7df3d
--- /dev/null
+++ b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/RouteCoverageEventNotifier.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.spring;
+
+import java.util.function.Function;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.spi.CamelEvent;
+import org.apache.camel.spi.CamelEvent.CamelContextEvent;
+import org.apache.camel.spi.CamelEvent.CamelContextStoppingEvent;
+import org.apache.camel.support.EventNotifierSupport;
+
+public class RouteCoverageEventNotifier extends EventNotifierSupport {
+
+    private final String testClassName;
+    private final Function testMethodName;
+
+    public RouteCoverageEventNotifier(String testClassName, Function testMethodName) {
+        this.testClassName = testClassName;
+        this.testMethodName = testMethodName;
+        setIgnoreCamelContextEvents(false);
+        setIgnoreExchangeEvents(true);
+    }
+
+    @Override
+    public boolean isEnabled(CamelEvent event) {
+        return event instanceof CamelContextStoppingEvent;
+    }
+
+    @Override
+    public void notify(CamelEvent event) throws Exception {
+        CamelContext context = ((CamelContextStoppingEvent) event).getContext();
+        String testName = (String) testMethodName.apply(this);
+        RouteCoverageDumper.dumpRouteCoverage(context, testClassName, testName);
+    }
+
+}
diff --git a/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/ShutdownTimeout.java b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/ShutdownTimeout.java
new file mode 100644
index 0000000..8e35d58
--- /dev/null
+++ b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/ShutdownTimeout.java
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.spring;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * Indicates to set the shutdown timeout of all {@code CamelContext}s instantiated through the 
+ * use of Spring Test loaded application contexts.  If no annotation is used, the timeout is
+ * automatically reduced to 10 seconds by the test framework.  If the annotation is present the
+ * shutdown timeout is set based on the value of {@link #value()}. 
+ */
+@Documented
+@Inherited
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.TYPE})
+public @interface ShutdownTimeout {
+
+    /**
+     * The shutdown timeout to set on the {@code CamelContext}(s).
+     * Defaults to {@code 10} seconds.
+     */
+    int value() default 10;
+    
+    /**
+     * The time unit that {@link #value()} is in.
+     */
+    TimeUnit timeUnit() default TimeUnit.SECONDS;
+}
diff --git a/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/StopWatchTestExecutionListener.java b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/StopWatchTestExecutionListener.java
new file mode 100644
index 0000000..535a7dc
--- /dev/null
+++ b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/StopWatchTestExecutionListener.java
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.spring;
+
+import org.apache.camel.util.StopWatch;
+import org.apache.camel.util.TimeUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.test.context.TestContext;
+import org.springframework.test.context.support.AbstractTestExecutionListener;
+
+/**
+ * An execution listener that simulates the timing output built in to {@link org.apache.camel.test.junit4.CamelTestSupport}.
+ */
+public class StopWatchTestExecutionListener extends AbstractTestExecutionListener {
+    
+    protected static ThreadLocal<StopWatch> threadStopWatch = new ThreadLocal<>();
+    
+    /**
+     * Exists primarily for testing purposes, but allows for access to the underlying stop watch instance for a test.
+     */
+    public static StopWatch getStopWatch() {
+        return threadStopWatch.get();
+    }
+    
+    @Override
+    public void beforeTestMethod(TestContext testContext) throws Exception {
+        StopWatch stopWatch = new StopWatch();
+        threadStopWatch.set(stopWatch);
+    }
+
+    @Override
+    public void afterTestMethod(TestContext testContext) throws Exception {
+        StopWatch watch = threadStopWatch.get();
+        if (watch != null) {
+            long time = watch.taken();
+            Logger log = LoggerFactory.getLogger(testContext.getTestClass());
+
+            log.info("********************************************************************************");
+            log.info("Testing done: " + testContext.getTestMethod().getName() + "(" + testContext.getTestClass().getName() + ")");
+            log.info("Took: " + TimeUtils.printDuration(time) + " (" + time + " millis)");
+            log.info("********************************************************************************");
+
+            threadStopWatch.remove();
+        }
+    }
+
+}
diff --git a/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/UseAdviceWith.java b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/UseAdviceWith.java
new file mode 100644
index 0000000..9e09deb
--- /dev/null
+++ b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/UseAdviceWith.java
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.spring;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import org.apache.camel.CamelContext;
+
+/**
+ * Indicates the use of {@code adviceWith()} within the test class.  If a class is annotated with
+ * this annotation and {@link UseAdviceWith#value()} returns true, any 
+ * {@code CamelContext}s bootstrapped during the test through the use of Spring Test loaded 
+ * application contexts will not be started automatically.  The test author is responsible for 
+ * injecting the Camel contexts into the test and executing {@link CamelContext#start()} on them 
+ * at the appropriate time after any advice has been applied to the routes in the Camel context(s). 
+ */
+@Documented
+@Inherited
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.TYPE})
+public @interface UseAdviceWith {
+    
+    /**
+     * Whether the test annotated with this annotation should be treated as if 
+     * {@code adviceWith()} is in use in the test and the Camel contexts should not be started
+     * automatically.
+     * Defaults to {@code true}.
+     */
+    boolean value() default true;
+}
diff --git a/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/UseOverridePropertiesWithPropertiesComponent.java b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/UseOverridePropertiesWithPropertiesComponent.java
new file mode 100644
index 0000000..89a71a5
--- /dev/null
+++ b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/UseOverridePropertiesWithPropertiesComponent.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.spring;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Indicates that the annotated method returns a {@link java.util.Properties} for use in the test, and that
+ * those properties override any existing properties configured on the {@link org.apache.camel.component.properties.PropertiesComponent}.
+ */
+@Documented
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.METHOD})
+public @interface UseOverridePropertiesWithPropertiesComponent {
+
+}
diff --git a/components/camel-testcontainers-spring/src/main/java/org/apache/camel/test/junit5/testcontainers/spring/ContainerAwareSpringTestSupport.java b/components/camel-testcontainers-spring/src/main/java/org/apache/camel/test/junit5/testcontainers/spring/ContainerAwareSpringTestSupport.java
new file mode 100644
index 0000000..74130af
--- /dev/null
+++ b/components/camel-testcontainers-spring/src/main/java/org/apache/camel/test/junit5/testcontainers/spring/ContainerAwareSpringTestSupport.java
@@ -0,0 +1,112 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.testcontainers.spring;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.concurrent.TimeUnit;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.component.properties.PropertiesComponent;
+import org.apache.camel.test.junit5.spring.CamelSpringTestSupport;
+import org.apache.camel.test.testcontainers.ContainerPropertiesFunction;
+import org.apache.camel.test.testcontainers.Containers;
+import org.testcontainers.containers.GenericContainer;
+import org.testcontainers.containers.Network;
+
+public abstract class ContainerAwareSpringTestSupport extends CamelSpringTestSupport {
+    private List<GenericContainer<?>> containers = new CopyOnWriteArrayList<>();
+
+    // ******************
+    // Setup
+    // ******************
+
+    @Override
+    protected void setupResources() throws Exception {
+        super.setupResources();
+
+        containers.clear();
+        containers.addAll(createContainers());
+
+        final Network network = containerNetwork();
+        final long timeout = containersStartupTimeout();
+
+        Containers.start(containers, network, timeout);
+    }
+
+    @Override
+    protected void cleanupResources() throws Exception {
+        super.cleanupResources();
+
+        Containers.stop(containers, containerShutdownTimeout());
+    }
+
+    @Override
+    protected CamelContext createCamelContext() throws Exception {
+        final CamelContext context = super.createCamelContext();
+        final PropertiesComponent pc = context.getComponent("properties", PropertiesComponent.class);
+
+        pc.addFunction(new ContainerPropertiesFunction(containers));
+
+        return context;
+    }
+
+    // ******************
+    // Containers set-up
+    // ******************
+
+    protected GenericContainer<?> createContainer() {
+        return null;
+    }
+
+    protected List<GenericContainer<?>> createContainers() {
+        GenericContainer<?> container = createContainer();
+
+        return container == null
+            ? Collections.emptyList()
+            : Collections.singletonList(container);
+    }
+
+    protected long containersStartupTimeout() {
+        return TimeUnit.MINUTES.toSeconds(1);
+    }
+
+    protected long containerShutdownTimeout() {
+        return TimeUnit.MINUTES.toSeconds(1);
+    }
+
+    protected Network containerNetwork() {
+        return null;
+    }
+
+    // ******************
+    // Helpers
+    // ******************
+
+    protected GenericContainer<?> getContainer(String containerName) {
+        return Containers.lookup(containers, containerName);
+    }
+
+    protected String getContainerHost(String containerName) {
+        return getContainer(containerName).getContainerIpAddress();
+    }
+
+    protected int getContainerPort(String containerName, int originalPort) {
+        return getContainer(containerName).getMappedPort(originalPort);
+    }
+}
diff --git a/components/camel-testcontainers-spring/src/test/java/org/apache/camel/test/junit5/testcontainers/spring/ContainerAwareSpringTestSupportIT.java b/components/camel-testcontainers-spring/src/test/java/org/apache/camel/test/junit5/testcontainers/spring/ContainerAwareSpringTestSupportIT.java
new file mode 100644
index 0000000..fef4342
--- /dev/null
+++ b/components/camel-testcontainers-spring/src/test/java/org/apache/camel/test/junit5/testcontainers/spring/ContainerAwareSpringTestSupportIT.java
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.testcontainers.spring;
+
+import org.apache.camel.test.testcontainers.Wait;
+import org.assertj.core.api.Assertions;
+import org.junit.jupiter.api.Test;
+import org.springframework.context.support.AbstractApplicationContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+import org.testcontainers.containers.GenericContainer;
+
+public class ContainerAwareSpringTestSupportIT extends ContainerAwareSpringTestSupport {
+    @Override
+    protected AbstractApplicationContext createApplicationContext() {
+        return new ClassPathXmlApplicationContext("org/apache/camel/test/testcontainers/spring/ContainerAwareSpringTestSupportTest.xml");
+    }
+
+    @Test
+    public void testPropertyPlaceholders() throws Exception {
+        final GenericContainer<?> container = getContainer("myconsul");
+
+        final String host = context.resolvePropertyPlaceholders("{{container:host:myconsul}}");
+        Assertions.assertThat(host).isEqualTo(container.getContainerIpAddress());
+
+        final String port = context.resolvePropertyPlaceholders("{{container:port:8500@myconsul}}");
+        Assertions.assertThat(port).isEqualTo("" + container.getMappedPort(8500));
+    }
+
+    @Override
+    protected GenericContainer<?> createContainer() {
+        return new GenericContainer("consul:1.5.1")
+            .withNetworkAliases("myconsul")
+            .withExposedPorts(8500)
+            .waitingFor(Wait.forLogMessageContaining("Synced node info", 1))
+            .withCommand(
+                "agent",
+                "-dev",
+                "-server",
+                "-bootstrap",
+                "-client",
+                "0.0.0.0",
+                "-log-level",
+                "trace"
+            );
+    }
+
+}


[camel] 05/09: CAMEL-13342: Implemented a first version of a proof-of-concept for camel-testcontainers with JUnit 5

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

aldettinger pushed a commit to branch CAMEL-13342-JUNIT5-EXPLORATORY
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 7c104ae53fc90ce20199b48ade2305dc9ee4afc0
Author: aldettinger <al...@gmail.com>
AuthorDate: Thu Jul 4 11:35:54 2019 +0200

    CAMEL-13342: Implemented a first version of a proof-of-concept for camel-testcontainers with JUnit 5
---
 .../camel/component/consul/ConsulCatalogTest.java  |  16 +--
 .../component/consul/ConsulClientKeyValueTest.java |   7 +-
 .../component/consul/ConsulCoordinatesTest.java    |  20 ++--
 .../camel/component/consul/ConsulEventTest.java    |   9 +-
 .../component/consul/ConsulEventWatchTest.java     |   2 +-
 .../camel/component/consul/ConsulHealthTest.java   |  14 +--
 .../camel/component/consul/ConsulKeyValueTest.java |   7 +-
 .../component/consul/ConsulKeyValueWatchTest.java  |   2 +-
 .../camel/component/consul/ConsulRegistryTest.java |  32 +++---
 .../component/consul/ConsulRegistryUtilsTest.java  |   6 +-
 .../camel/component/consul/ConsulSessionTest.java  |  18 ++--
 .../camel/component/consul/ConsulTestSupport.java  |  17 ++--
 .../cloud/ConsulDefaultServiceCallRouteTest.java   |   2 +-
 .../cloud/ConsulRibbonServiceCallRouteTest.java    |   2 +-
 .../ConsulServiceCallWithRegistrationTest.java     |  60 ++++++-----
 .../consul/cloud/ConsulServiceDiscoveryTest.java   |   5 +-
 .../cloud/ConsulServiceRegistrationTestBase.java   |   5 +-
 .../consul/cloud/ConsulServiceRegistryTest.java    |   4 +-
 .../ConsulClusteredRoutePolicyFactoryTest.java     |  14 +--
 .../cluster/ConsulClusteredRoutePolicyTest.java    |  14 +--
 .../component/consul/cluster/ConsulMasterTest.java |  14 +--
 components/camel-testcontainers/pom.xml            |   6 +-
 .../testcontainers/ContainerAwareTestSupport.java  | 112 +++++++++++++++++++++
 .../ContainerAwareTestSupportIT.java               |  54 ++++++++++
 24 files changed, 315 insertions(+), 127 deletions(-)

diff --git a/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulCatalogTest.java b/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulCatalogTest.java
index d96305b..097daec 100644
--- a/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulCatalogTest.java
+++ b/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulCatalogTest.java
@@ -21,8 +21,8 @@ import java.util.List;
 import com.orbitz.consul.model.health.Node;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.consul.endpoint.ConsulCatalogActions;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
 
 public class ConsulCatalogTest extends ConsulTestSupport {
 
@@ -34,9 +34,9 @@ public class ConsulCatalogTest extends ConsulTestSupport {
             .to("direct:consul")
             .request(List.class);
 
-        Assert.assertFalse(ref.isEmpty());
-        Assert.assertFalse(res.isEmpty());
-        Assert.assertEquals(ref, res);
+        Assertions.assertFalse(ref.isEmpty());
+        Assertions.assertFalse(res.isEmpty());
+        Assertions.assertEquals(ref, res);
     }
 
     @Test
@@ -47,9 +47,9 @@ public class ConsulCatalogTest extends ConsulTestSupport {
             .to("direct:consul")
             .request(List.class);
 
-        Assert.assertFalse(ref.isEmpty());
-        Assert.assertFalse(res.isEmpty());
-        Assert.assertEquals(ref, res);
+        Assertions.assertFalse(ref.isEmpty());
+        Assertions.assertFalse(res.isEmpty());
+        Assertions.assertEquals(ref, res);
     }
 
     @Override
diff --git a/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulClientKeyValueTest.java b/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulClientKeyValueTest.java
index ef6cc27..0835d8c 100644
--- a/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulClientKeyValueTest.java
+++ b/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulClientKeyValueTest.java
@@ -24,7 +24,8 @@ import org.apache.camel.BindToRegistry;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.consul.endpoint.ConsulKeyValueActions;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
 
 public class ConsulClientKeyValueTest extends ConsulTestSupport {
 
@@ -49,8 +50,8 @@ public class ConsulClientKeyValueTest extends ConsulTestSupport {
 
         Optional<String> keyVal = getConsul().keyValueClient().getValueAsString(key);
 
-        assertTrue(keyVal.isPresent());
-        assertEquals(val, keyVal.get());
+        Assertions.assertTrue(keyVal.isPresent());
+        Assertions.assertEquals(val, keyVal.get());
     }
 
     @BindToRegistry("consulClient")
diff --git a/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulCoordinatesTest.java b/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulCoordinatesTest.java
index 1b9d280..fc8a855 100644
--- a/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulCoordinatesTest.java
+++ b/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulCoordinatesTest.java
@@ -22,9 +22,9 @@ import com.orbitz.consul.model.coordinate.Coordinate;
 import com.orbitz.consul.model.coordinate.Datacenter;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.consul.endpoint.ConsulCoordinatesActions;
-import org.junit.Assert;
-import org.junit.Ignore;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
 
 public class ConsulCoordinatesTest extends ConsulTestSupport {
 
@@ -36,12 +36,12 @@ public class ConsulCoordinatesTest extends ConsulTestSupport {
             .to("direct:consul")
             .request(List.class);
 
-        Assert.assertFalse(ref.isEmpty());
-        Assert.assertFalse(res.isEmpty());
-        Assert.assertEquals(ref, res);
+        Assertions.assertFalse(ref.isEmpty());
+        Assertions.assertFalse(res.isEmpty());
+        Assertions.assertEquals(ref, res);
     }
 
-    @Ignore("Disabled as it seems that nodes is always 0")
+    @Disabled("Disabled as it seems that nodes is always 0")
     @Test
     public void testNodes() throws Exception {
         List<Coordinate> ref = getConsul().coordinateClient().getNodes();
@@ -50,9 +50,9 @@ public class ConsulCoordinatesTest extends ConsulTestSupport {
             .to("direct:consul")
             .request(List.class);
 
-        Assert.assertFalse(ref.isEmpty());
-        Assert.assertFalse(res.isEmpty());
-        Assert.assertEquals(ref, res);
+        Assertions.assertFalse(ref.isEmpty());
+        Assertions.assertFalse(res.isEmpty());
+        Assertions.assertEquals(ref, res);
     }
 
     @Override
diff --git a/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulEventTest.java b/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulEventTest.java
index 6daed84..5050343 100644
--- a/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulEventTest.java
+++ b/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulEventTest.java
@@ -23,7 +23,8 @@ import com.orbitz.consul.model.event.Event;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.consul.endpoint.ConsulEventActions;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
 
 public class ConsulEventTest extends ConsulTestSupport {
 
@@ -48,9 +49,9 @@ public class ConsulEventTest extends ConsulTestSupport {
         EventResponse response = getConsul().eventClient().listEvents(key);
         List<Event> events = response.getEvents();
 
-        assertFalse(events.isEmpty());
-        assertTrue(events.get(0).getPayload().isPresent());
-        assertEquals(val, events.get(0).getPayload().get());
+        Assertions.assertFalse(events.isEmpty());
+        Assertions.assertTrue(events.get(0).getPayload().isPresent());
+        Assertions.assertEquals(val, events.get(0).getPayload().get());
     }
 
     @Override
diff --git a/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulEventWatchTest.java b/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulEventWatchTest.java
index 8550295..b546e1c 100644
--- a/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulEventWatchTest.java
+++ b/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulEventWatchTest.java
@@ -21,7 +21,7 @@ import java.util.List;
 import com.orbitz.consul.EventClient;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 public class ConsulEventWatchTest extends ConsulTestSupport {
     private String key;
diff --git a/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulHealthTest.java b/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulHealthTest.java
index 79e2cfe..79855b7 100644
--- a/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulHealthTest.java
+++ b/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulHealthTest.java
@@ -27,8 +27,8 @@ import com.orbitz.consul.model.agent.Registration;
 import com.orbitz.consul.model.health.ServiceHealth;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.consul.endpoint.ConsulHealthActions;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
 
 public class ConsulHealthTest extends ConsulTestSupport {
     private AgentClient client;
@@ -85,14 +85,14 @@ public class ConsulHealthTest extends ConsulTestSupport {
             .to("direct:consul")
             .request(List.class);
 
-        Assert.assertEquals(2, ref.size());
-        Assert.assertEquals(2, res.size());
-        Assert.assertEquals(ref, res);
+        Assertions.assertEquals(2, ref.size());
+        Assertions.assertEquals(2, res.size());
+        Assertions.assertEquals(ref, res);
 
-        assertTrue(registrations.stream().anyMatch(
+        Assertions.assertTrue(registrations.stream().anyMatch(
             r -> r.getPort().isPresent() && r.getPort().get() == res.get(0).getService().getPort() && r.getId().equalsIgnoreCase(res.get(0).getService().getId())
         ));
-        assertTrue(registrations.stream().anyMatch(
+        Assertions.assertTrue(registrations.stream().anyMatch(
             r -> r.getPort().isPresent() && r.getPort().get() == res.get(1).getService().getPort() && r.getId().equalsIgnoreCase(res.get(1).getService().getId())
         ));
     }
diff --git a/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulKeyValueTest.java b/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulKeyValueTest.java
index dc03889..1a61f29 100644
--- a/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulKeyValueTest.java
+++ b/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulKeyValueTest.java
@@ -21,7 +21,8 @@ import java.util.Optional;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.consul.endpoint.ConsulKeyValueActions;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
 
 public class ConsulKeyValueTest extends ConsulTestSupport {
 
@@ -46,8 +47,8 @@ public class ConsulKeyValueTest extends ConsulTestSupport {
 
         Optional<String> keyVal = getConsul().keyValueClient().getValueAsString(key);
 
-        assertTrue(keyVal.isPresent());
-        assertEquals(val, keyVal.get());
+        Assertions.assertTrue(keyVal.isPresent());
+        Assertions.assertEquals(val, keyVal.get());
     }
 
     @Override
diff --git a/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulKeyValueWatchTest.java b/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulKeyValueWatchTest.java
index 716e25e..7dcfab9 100644
--- a/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulKeyValueWatchTest.java
+++ b/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulKeyValueWatchTest.java
@@ -22,7 +22,7 @@ import java.util.Random;
 import com.orbitz.consul.KeyValueClient;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 public class ConsulKeyValueWatchTest extends ConsulTestSupport {
     private String key;
diff --git a/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulRegistryTest.java b/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulRegistryTest.java
index 67cc2fd..68e94fd 100644
--- a/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulRegistryTest.java
+++ b/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulRegistryTest.java
@@ -23,14 +23,14 @@ import java.util.Set;
 
 import com.orbitz.consul.Consul;
 import org.apache.camel.NoSuchBeanException;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 import org.testcontainers.containers.GenericContainer;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
 
 /**
  * Unit test for Camel Registry implementation for Consul
@@ -49,7 +49,7 @@ public class ConsulRegistryTest implements Serializable {
         }
     }
 
-    @BeforeClass
+    @BeforeAll
     public static void setUp() {
         container = ConsulTestSupport.consulContainer();
         container.start();
@@ -57,7 +57,7 @@ public class ConsulRegistryTest implements Serializable {
         registry = new ConsulRegistry(container.getContainerIpAddress(), container.getMappedPort(Consul.DEFAULT_HTTP_PORT));
     }
 
-    @AfterClass
+    @AfterAll
     public static void tearDown() {
         container.stop();
     }
@@ -67,7 +67,7 @@ public class ConsulRegistryTest implements Serializable {
         registry.put("stringTestKey", "stringValue");
         String result = (String) registry.lookupByName("stringTestKey");
         registry.remove("stringTestKey");
-        assertNotNull(result);
+        Assertions.assertNotNull(result);
         assertEquals("stringValue", result);
     }
 
@@ -77,7 +77,7 @@ public class ConsulRegistryTest implements Serializable {
         registry.put("uniqueKey", "stringValueTwo");
         String result = (String) registry.lookupByName("uniqueKey");
         registry.remove("uniqueKey");
-        assertNotNull(result);
+        Assertions.assertNotNull(result);
         assertEquals("stringValueTwo", result);
     }
 
@@ -86,7 +86,7 @@ public class ConsulRegistryTest implements Serializable {
         registry.put("namedKey", "namedValue");
         String result = (String) registry.lookupByName("namedKey");
         registry.remove("namedKey");
-        assertNotNull(result);
+        Assertions.assertNotNull(result);
         assertEquals("namedValue", result);
     }
 
@@ -104,7 +104,7 @@ public class ConsulRegistryTest implements Serializable {
         registry.put("testClass", consulTestClass);
         ConsulTestClass consulTestClassClone = registry.lookupByNameAndType("testClass", consulTestClass.getClass());
         registry.remove("testClass");
-        assertNotNull(consulTestClassClone);
+        Assertions.assertNotNull(consulTestClassClone);
         assertEquals(consulTestClass.getClass(), consulTestClassClone.getClass());
     }
 
@@ -128,7 +128,7 @@ public class ConsulRegistryTest implements Serializable {
         registry.remove("testClassOne");
         registry.remove("testClassTwo");
         HashMap<String, ConsulTestClass> emptyHashMap = new HashMap<>();
-        assertNotNull(consulTestClassMap);
+        Assertions.assertNotNull(consulTestClassMap);
         assertEquals(consulTestClassMap.getClass(), emptyHashMap.getClass());
         assertEquals(2, consulTestClassMap.size());
     }
@@ -153,7 +153,7 @@ public class ConsulRegistryTest implements Serializable {
         ConsulTestClass classTwo = new ConsulTestClass();
         registry.put("classTwo", classTwo);
         Set<? extends ConsulTestClass> results = registry.findByType(classOne.getClass());
-        assertNotNull(results);
+        Assertions.assertNotNull(results);
         HashSet<ConsulTestClass> hashSet = new HashSet<>();
         registry.remove("classOne");
         registry.remove("classTwo");
@@ -165,8 +165,8 @@ public class ConsulRegistryTest implements Serializable {
 
     }
 
-    @Test(expected = NoSuchBeanException.class)
+    @Test
     public void deleteNonExisting() {
-        registry.remove("nonExisting");
+        Assertions.assertThrows(NoSuchBeanException.class, () -> registry.remove("nonExisting"));
     }
 }
diff --git a/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulRegistryUtilsTest.java b/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulRegistryUtilsTest.java
index f56045d..221e569 100644
--- a/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulRegistryUtilsTest.java
+++ b/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulRegistryUtilsTest.java
@@ -21,10 +21,10 @@ import java.util.Arrays;
 import java.util.List;
 
 import org.apache.camel.component.consul.ConsulRegistry.ConsulRegistryUtils;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertArrayEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 /**
  * @author <a href="https://github.com/ppalaga">Peter Palaga</a>
diff --git a/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulSessionTest.java b/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulSessionTest.java
index 63fa765..300feaa 100644
--- a/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulSessionTest.java
+++ b/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulSessionTest.java
@@ -24,8 +24,8 @@ import com.orbitz.consul.model.session.SessionCreatedResponse;
 import com.orbitz.consul.model.session.SessionInfo;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.consul.endpoint.ConsulSessionActions;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
 
 public class ConsulSessionTest extends ConsulTestSupport {
 
@@ -40,8 +40,8 @@ public class ConsulSessionTest extends ConsulTestSupport {
                 .to("direct:consul")
                 .request(List.class);
 
-            Assert.assertEquals(sessions, list.size());
-            Assert.assertFalse(list.stream().anyMatch(s -> s.getName().isPresent() && s.getName().get().equals(name)));
+            Assertions.assertEquals(sessions, list.size());
+            Assertions.assertFalse(list.stream().anyMatch(s -> s.getName().isPresent() && s.getName().get().equals(name)));
         }
 
         SessionCreatedResponse res = fluentTemplate()
@@ -50,7 +50,7 @@ public class ConsulSessionTest extends ConsulTestSupport {
             .to("direct:consul")
             .request(SessionCreatedResponse.class);
 
-        Assert.assertNotNull(res.getId());
+        Assertions.assertNotNull(res.getId());
 
         {
             List<SessionInfo> list = fluentTemplate()
@@ -58,8 +58,8 @@ public class ConsulSessionTest extends ConsulTestSupport {
                 .to("direct:consul")
                 .request(List.class);
 
-            Assert.assertEquals(sessions + 1, list.size());
-            Assert.assertTrue(list.stream().anyMatch(s -> s.getName().isPresent() && s.getName().get().equals(name)));
+            Assertions.assertEquals(sessions + 1, list.size());
+            Assertions.assertTrue(list.stream().anyMatch(s -> s.getName().isPresent() && s.getName().get().equals(name)));
         }
 
         {
@@ -74,8 +74,8 @@ public class ConsulSessionTest extends ConsulTestSupport {
                 .to("direct:consul")
                 .request(List.class);
 
-            Assert.assertEquals(sessions, list.size());
-            Assert.assertFalse(list.stream().anyMatch(s -> s.getName().isPresent() && s.getName().get().equals(name)));
+            Assertions.assertEquals(sessions, list.size());
+            Assertions.assertFalse(list.stream().anyMatch(s -> s.getName().isPresent() && s.getName().get().equals(name)));
         }
     }
 
diff --git a/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulTestSupport.java b/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulTestSupport.java
index bc1d6cd..a5e8831 100644
--- a/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulTestSupport.java
+++ b/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulTestSupport.java
@@ -24,10 +24,10 @@ import com.orbitz.consul.Consul;
 import com.orbitz.consul.KeyValueClient;
 
 import org.apache.camel.BindToRegistry;
-import org.apache.camel.test.testcontainers.ContainerAwareTestSupport;
+import org.apache.camel.test.junit5.testcontainers.ContainerAwareTestSupport;
 import org.apache.camel.test.testcontainers.Wait;
-import org.junit.Rule;
-import org.junit.rules.TestName;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.TestInfo;
 import org.testcontainers.containers.GenericContainer;
 
 public class ConsulTestSupport extends ContainerAwareTestSupport {
@@ -35,8 +35,13 @@ public class ConsulTestSupport extends ContainerAwareTestSupport {
     public static final String CONTAINER_NAME = "consul";
     public static final String KV_PREFIX = "/camel";
 
-    @Rule
-    public final TestName testName = new TestName();
+    protected String testName;
+
+    @BeforeEach
+    public void setUp(TestInfo testInfo) throws Exception {
+        super.setUp();
+        testName = testInfo.getDisplayName();
+    }
 
     @BindToRegistry("consul")
     public ConsulComponent getConsulComponent() {
@@ -69,7 +74,7 @@ public class ConsulTestSupport extends ContainerAwareTestSupport {
     }
 
     protected String generateKey() {
-        return KV_PREFIX + "/" + testName.getMethodName() + "/" + generateRandomString();
+        return KV_PREFIX + "/" + testName + "/" + generateRandomString();
     }
 
     protected String consulUrl() {
diff --git a/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/ConsulDefaultServiceCallRouteTest.java b/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/ConsulDefaultServiceCallRouteTest.java
index c21ed04..1f054d0 100644
--- a/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/ConsulDefaultServiceCallRouteTest.java
+++ b/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/ConsulDefaultServiceCallRouteTest.java
@@ -26,7 +26,7 @@ import org.apache.camel.RoutesBuilder;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.consul.ConsulTestSupport;
 import org.apache.camel.test.AvailablePortFinder;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 public class ConsulDefaultServiceCallRouteTest extends ConsulTestSupport {
     private static final String SERVICE_NAME = "http-service";
diff --git a/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/ConsulRibbonServiceCallRouteTest.java b/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/ConsulRibbonServiceCallRouteTest.java
index eb7c769..ec26483 100644
--- a/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/ConsulRibbonServiceCallRouteTest.java
+++ b/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/ConsulRibbonServiceCallRouteTest.java
@@ -26,7 +26,7 @@ import org.apache.camel.RoutesBuilder;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.consul.ConsulTestSupport;
 import org.apache.camel.test.AvailablePortFinder;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 public class ConsulRibbonServiceCallRouteTest extends ConsulTestSupport {
     private static final String SERVICE_NAME = "http-service";
diff --git a/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/ConsulServiceCallWithRegistrationTest.java b/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/ConsulServiceCallWithRegistrationTest.java
index e7f6a80..9cb0334 100644
--- a/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/ConsulServiceCallWithRegistrationTest.java
+++ b/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/ConsulServiceCallWithRegistrationTest.java
@@ -23,9 +23,12 @@ import org.apache.camel.CamelExecutionException;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.consul.ConsulTestSupport;
 import org.apache.camel.impl.cloud.ServiceRegistrationRoutePolicy;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
 import org.springframework.util.SocketUtils;
 
+import static org.junit.jupiter.api.Assertions.assertThrows;
+
 public class ConsulServiceCallWithRegistrationTest extends ConsulTestSupport {
     private static final String SERVICE_HOST = "localhost";
 
@@ -90,43 +93,36 @@ public class ConsulServiceCallWithRegistrationTest extends ConsulTestSupport {
 
         context.start();
 
-        assertEquals("ping on " + port, template.requestBody("direct:start", "ping", String.class));
+        Assertions.assertEquals("ping on " + port, template.requestBody("direct:start", "ping", String.class));
     }
 
-    @Test(expected = CamelExecutionException.class)
+    @Test
     public void testServiceCallFailure() throws Exception {
-        final int port = SocketUtils.findAvailableTcpPort();
-        final String serviceId = UUID.randomUUID().toString();
-        final String serviceName = UUID.randomUUID().toString();
 
-        context.addRoutes(new RouteBuilder() {
-            @Override
-            public void configure() throws Exception {
-                // context path is had coded so it should fail as it not exposed
-                // by jetty
-                from("direct:start")
-                    .serviceCall()
-                        .name(serviceName + "/bad/path")
-                        .component("http")
-                        .defaultLoadBalancer()
-                        .consulServiceDiscovery()
-                            .url(consulUrl())
-                        .end()
-                    .end()
-                    .log("${body}");
+        assertThrows(CamelExecutionException.class, () -> {
 
-                fromF("undertow:http://%s:%d/service/path", SERVICE_HOST, port)
-                    .routeId(serviceId)
-                    .routeGroup(serviceName)
-                    .routePolicy(new ServiceRegistrationRoutePolicy())
-                    .transform()
-                    .simple("${in.body} on " + port);
-            }
-        });
+            final int port = SocketUtils.findAvailableTcpPort();
+            final String serviceId = UUID.randomUUID().toString();
+            final String serviceName = UUID.randomUUID().toString();
 
-        context.start();
+            context.addRoutes(new RouteBuilder() {
+                @Override
+                public void configure() throws Exception {
+                    // context path is had coded so it should fail as it not
+                    // exposed
+                    // by jetty
+                    from("direct:start").serviceCall().name(serviceName + "/bad/path").component("http").defaultLoadBalancer().consulServiceDiscovery().url(consulUrl()).end().end()
+                        .log("${body}");
 
-        template.requestBody("direct:start", "ping", String.class);
-        fail("Should have failed");
+                    fromF("undertow:http://%s:%d/service/path", SERVICE_HOST, port).routeId(serviceId).routeGroup(serviceName).routePolicy(new ServiceRegistrationRoutePolicy())
+                        .transform().simple("${in.body} on " + port);
+                }
+            });
+
+            context.start();
+
+            template.requestBody("direct:start", "ping", String.class);
+            Assertions.fail("Should have failed");
+        });
     }
 }
diff --git a/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/ConsulServiceDiscoveryTest.java b/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/ConsulServiceDiscoveryTest.java
index 8023c29..196500f 100644
--- a/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/ConsulServiceDiscoveryTest.java
+++ b/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/ConsulServiceDiscoveryTest.java
@@ -29,9 +29,12 @@ import org.apache.camel.cloud.ServiceDiscovery;
 import org.apache.camel.component.consul.ConsulConfiguration;
 import org.apache.camel.component.consul.ConsulTestSupport;
 import org.assertj.core.api.Assertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.springframework.util.SocketUtils;
 
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+
 public class ConsulServiceDiscoveryTest extends ConsulTestSupport {
     private AgentClient client;
     private List<Registration> registrations;
diff --git a/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/ConsulServiceRegistrationTestBase.java b/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/ConsulServiceRegistrationTestBase.java
index b9a3bed..231cf88 100644
--- a/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/ConsulServiceRegistrationTestBase.java
+++ b/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/ConsulServiceRegistrationTestBase.java
@@ -28,9 +28,12 @@ import com.orbitz.consul.model.health.ServiceHealth;
 import org.apache.camel.CamelContext;
 import org.apache.camel.cloud.ServiceDefinition;
 import org.apache.camel.component.consul.ConsulTestSupport;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.springframework.util.SocketUtils;
 
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
 public abstract class ConsulServiceRegistrationTestBase extends ConsulTestSupport {
     protected static final String SERVICE_ID = UUID.randomUUID().toString();
     protected static final String SERVICE_NAME = "my-service";
diff --git a/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/ConsulServiceRegistryTest.java b/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/ConsulServiceRegistryTest.java
index 2c7f574..b4e0df0 100644
--- a/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/ConsulServiceRegistryTest.java
+++ b/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/ConsulServiceRegistryTest.java
@@ -24,7 +24,9 @@ import com.orbitz.consul.model.catalog.CatalogService;
 import com.orbitz.consul.model.health.ServiceHealth;
 import org.apache.camel.component.consul.ConsulTestSupport;
 import org.apache.camel.impl.cloud.DefaultServiceDefinition;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 public class ConsulServiceRegistryTest extends ConsulTestSupport {
     @Override
diff --git a/components/camel-consul/src/test/java/org/apache/camel/component/consul/cluster/ConsulClusteredRoutePolicyFactoryTest.java b/components/camel-consul/src/test/java/org/apache/camel/component/consul/cluster/ConsulClusteredRoutePolicyFactoryTest.java
index bdd59df..7d996d5 100644
--- a/components/camel-consul/src/test/java/org/apache/camel/component/consul/cluster/ConsulClusteredRoutePolicyFactoryTest.java
+++ b/components/camel-consul/src/test/java/org/apache/camel/component/consul/cluster/ConsulClusteredRoutePolicyFactoryTest.java
@@ -31,16 +31,18 @@ import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.consul.ConsulTestSupport;
 import org.apache.camel.impl.DefaultCamelContext;
 import org.apache.camel.impl.cluster.ClusteredRoutePolicyFactory;
-import org.junit.Assert;
-import org.junit.ClassRule;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.testcontainers.containers.GenericContainer;
+import org.testcontainers.junit.jupiter.Container;
+import org.testcontainers.junit.jupiter.Testcontainers;
 
+@Testcontainers
 public class ConsulClusteredRoutePolicyFactoryTest {
 
-    @ClassRule
+    @Container
     public static GenericContainer container = ConsulTestSupport.consulContainer();
 
     private static final Logger LOGGER = LoggerFactory.getLogger(ConsulClusteredRoutePolicyFactoryTest.class);
@@ -62,8 +64,8 @@ public class ConsulClusteredRoutePolicyFactoryTest {
         LATCH.await(1, TimeUnit.MINUTES);
         SCHEDULER.shutdownNow();
 
-        Assert.assertEquals(CLIENTS.size(), RESULTS.size());
-        Assert.assertTrue(RESULTS.containsAll(CLIENTS));
+        Assertions.assertEquals(CLIENTS.size(), RESULTS.size());
+        Assertions.assertTrue(RESULTS.containsAll(CLIENTS));
     }
 
     // ************************************
diff --git a/components/camel-consul/src/test/java/org/apache/camel/component/consul/cluster/ConsulClusteredRoutePolicyTest.java b/components/camel-consul/src/test/java/org/apache/camel/component/consul/cluster/ConsulClusteredRoutePolicyTest.java
index cb06bb6..a7867d3 100644
--- a/components/camel-consul/src/test/java/org/apache/camel/component/consul/cluster/ConsulClusteredRoutePolicyTest.java
+++ b/components/camel-consul/src/test/java/org/apache/camel/component/consul/cluster/ConsulClusteredRoutePolicyTest.java
@@ -31,16 +31,18 @@ import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.consul.ConsulTestSupport;
 import org.apache.camel.impl.DefaultCamelContext;
 import org.apache.camel.impl.cluster.ClusteredRoutePolicy;
-import org.junit.Assert;
-import org.junit.ClassRule;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.testcontainers.containers.GenericContainer;
+import org.testcontainers.junit.jupiter.Container;
+import org.testcontainers.junit.jupiter.Testcontainers;
 
+@Testcontainers
 public class ConsulClusteredRoutePolicyTest {
 
-    @ClassRule
+    @Container
     public static GenericContainer container = ConsulTestSupport.consulContainer();
 
     private static final Logger LOGGER = LoggerFactory.getLogger(ConsulClusteredRoutePolicyTest.class);
@@ -62,8 +64,8 @@ public class ConsulClusteredRoutePolicyTest {
         LATCH.await(1, TimeUnit.MINUTES);
         SCHEDULER.shutdownNow();
 
-        Assert.assertEquals(CLIENTS.size(), RESULTS.size());
-        Assert.assertTrue(RESULTS.containsAll(CLIENTS));
+        Assertions.assertEquals(CLIENTS.size(), RESULTS.size());
+        Assertions.assertTrue(RESULTS.containsAll(CLIENTS));
     }
 
     // ************************************
diff --git a/components/camel-consul/src/test/java/org/apache/camel/component/consul/cluster/ConsulMasterTest.java b/components/camel-consul/src/test/java/org/apache/camel/component/consul/cluster/ConsulMasterTest.java
index 90129b2..0a609ff 100644
--- a/components/camel-consul/src/test/java/org/apache/camel/component/consul/cluster/ConsulMasterTest.java
+++ b/components/camel-consul/src/test/java/org/apache/camel/component/consul/cluster/ConsulMasterTest.java
@@ -30,16 +30,18 @@ import com.orbitz.consul.Consul;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.consul.ConsulTestSupport;
 import org.apache.camel.impl.DefaultCamelContext;
-import org.junit.Assert;
-import org.junit.ClassRule;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.testcontainers.containers.GenericContainer;
+import org.testcontainers.junit.jupiter.Container;
+import org.testcontainers.junit.jupiter.Testcontainers;
 
+@Testcontainers
 public class ConsulMasterTest {
 
-    @ClassRule
+    @Container
     public static GenericContainer container = ConsulTestSupport.consulContainer();
 
     private static final Logger LOGGER = LoggerFactory.getLogger(ConsulMasterTest.class);
@@ -61,8 +63,8 @@ public class ConsulMasterTest {
         LATCH.await(1, TimeUnit.MINUTES);
         SCHEDULER.shutdownNow();
 
-        Assert.assertEquals(CLIENTS.size(), RESULTS.size());
-        Assert.assertTrue(RESULTS.containsAll(CLIENTS));
+        Assertions.assertEquals(CLIENTS.size(), RESULTS.size());
+        Assertions.assertTrue(RESULTS.containsAll(CLIENTS));
     }
 
     // ************************************
diff --git a/components/camel-testcontainers/pom.xml b/components/camel-testcontainers/pom.xml
index 0c1d933..3e27a17 100644
--- a/components/camel-testcontainers/pom.xml
+++ b/components/camel-testcontainers/pom.xml
@@ -49,7 +49,11 @@
             <artifactId>testcontainers</artifactId>
             <version>${testcontainers-version}</version>
         </dependency>
-
+        <dependency>
+            <groupId>org.testcontainers</groupId>
+            <artifactId>junit-jupiter</artifactId>
+            <version>${testcontainers-version}</version>
+        </dependency>
         <!-- optional dependencies for running tests -->
         <dependency>
             <groupId>org.assertj</groupId>
diff --git a/components/camel-testcontainers/src/main/java/org/apache/camel/test/junit5/testcontainers/ContainerAwareTestSupport.java b/components/camel-testcontainers/src/main/java/org/apache/camel/test/junit5/testcontainers/ContainerAwareTestSupport.java
new file mode 100644
index 0000000..c5381ff
--- /dev/null
+++ b/components/camel-testcontainers/src/main/java/org/apache/camel/test/junit5/testcontainers/ContainerAwareTestSupport.java
@@ -0,0 +1,112 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.testcontainers;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.concurrent.TimeUnit;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.component.properties.PropertiesComponent;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.apache.camel.test.testcontainers.ContainerPropertiesFunction;
+import org.apache.camel.test.testcontainers.Containers;
+import org.testcontainers.containers.GenericContainer;
+import org.testcontainers.containers.Network;
+
+public class ContainerAwareTestSupport extends CamelTestSupport {
+    private List<GenericContainer<?>> containers = new CopyOnWriteArrayList<>();
+
+    // ******************
+    // Setup
+    // ******************
+
+    @Override
+    protected void setupResources() throws Exception {
+        super.setupResources();
+
+        containers.clear();
+        containers.addAll(createContainers());
+
+        final Network network = containerNetwork();
+        final long timeout = containersStartupTimeout();
+
+        Containers.start(containers, network, timeout);
+    }
+
+    @Override
+    protected void cleanupResources() throws Exception {
+        super.cleanupResources();
+
+        Containers.stop(containers, containerShutdownTimeout());
+    }
+
+    @Override
+    protected CamelContext createCamelContext() throws Exception {
+        final CamelContext context = super.createCamelContext();
+        final PropertiesComponent pc = context.getComponent("properties", PropertiesComponent.class);
+
+        pc.addFunction(new ContainerPropertiesFunction(containers));
+
+        return context;
+    }
+
+    // ******************
+    // Containers set-up
+    // ******************
+
+    protected GenericContainer<?> createContainer() {
+        return null;
+    }
+
+    protected List<GenericContainer<?>> createContainers() {
+        GenericContainer<?> container = createContainer();
+
+        return container == null
+            ? Collections.emptyList()
+            : Collections.singletonList(container);
+    }
+
+    protected long containersStartupTimeout() {
+        return TimeUnit.MINUTES.toSeconds(1);
+    }
+
+    protected long containerShutdownTimeout() {
+        return TimeUnit.MINUTES.toSeconds(1);
+    }
+
+    protected Network containerNetwork() {
+        return null;
+    }
+
+    // ******************
+    // Helpers
+    // ******************
+
+    protected GenericContainer<?> getContainer(String containerName) {
+        return Containers.lookup(containers, containerName);
+    }
+
+    protected String getContainerHost(String containerName) {
+        return getContainer(containerName).getContainerIpAddress();
+    }
+
+    protected int getContainerPort(String containerName, int originalPort) {
+        return getContainer(containerName).getMappedPort(originalPort);
+    }
+}
diff --git a/components/camel-testcontainers/src/test/java/org/apache/camel/test/junit5/testcontainers/ContainerAwareTestSupportIT.java b/components/camel-testcontainers/src/test/java/org/apache/camel/test/junit5/testcontainers/ContainerAwareTestSupportIT.java
new file mode 100644
index 0000000..1a608ea
--- /dev/null
+++ b/components/camel-testcontainers/src/test/java/org/apache/camel/test/junit5/testcontainers/ContainerAwareTestSupportIT.java
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.testcontainers;
+
+import org.apache.camel.test.testcontainers.Wait;
+import org.assertj.core.api.Assertions;
+import org.junit.jupiter.api.Test;
+import org.testcontainers.containers.GenericContainer;
+
+public class ContainerAwareTestSupportIT extends ContainerAwareTestSupport {
+    @Test
+    public void testPropertyPlaceholders() throws Exception {
+        final GenericContainer<?> container = getContainer("myconsul");
+
+        final String host = context.resolvePropertyPlaceholders("{{container:host:myconsul}}");
+        Assertions.assertThat(host).isEqualTo(container.getContainerIpAddress());
+
+        final String port = context.resolvePropertyPlaceholders("{{container:port:8500@myconsul}}");
+        Assertions.assertThat(port).isEqualTo("" + container.getMappedPort(8500));
+    }
+
+    @Override
+    protected GenericContainer<?> createContainer() {
+        return new GenericContainer<>("consul:1.5.1")
+            .withNetworkAliases("myconsul")
+            .withExposedPorts(8500)
+            .waitingFor(Wait.forLogMessageContaining("Synced node info", 1))
+            .withCommand(
+                "agent",
+                "-dev",
+                "-server",
+                "-bootstrap",
+                "-client",
+                "0.0.0.0",
+                "-log-level",
+                "trace"
+            );
+    }
+
+}


[camel] 08/09: CAMEL-13342: Implemented a first version of a proof-of-concept for camel-test-spring/SpringExtension with JUnit 5

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

aldettinger pushed a commit to branch CAMEL-13342-JUNIT5-EXPLORATORY
in repository https://gitbox.apache.org/repos/asf/camel.git

commit c2da2eb35d8185c21729a748d81687ee2672db6f
Author: aldettinger <al...@gmail.com>
AuthorDate: Wed Jul 17 17:20:28 2019 +0200

    CAMEL-13342: Implemented a first version of a proof-of-concept for camel-test-spring/SpringExtension with JUnit 5
---
 .../test/junit5/spring/CamelSpringRunner.java      |  83 --------------
 .../camel/test/junit5/spring/CamelSpringTest.java  |  39 +++++++
 .../patterns/DebugSpringCamelContextTest.java      |  40 +++++++
 .../test/junit5/patterns/DebugSpringTest.java      |  83 ++++++++++++++
 .../camel/test/junit5/patterns/MyProduceBean.java  |  41 +++++++
 .../camel/test/junit5/patterns/MySender.java       |  25 +++++
 .../test/junit5/patterns/ProduceBeanTest.java      |  42 +++++++
 .../junit5/patterns/ProducerBeanInjectTest.java    |  40 +++++++
 .../camel/test/junit5/patterns/SimpleMockTest.java |  63 +++++++++++
 .../spring/CamelSpringActiveProfileTest.java       |  56 +++++++++
 ...CamelSpringDisableJmxInheritedOverrideTest.java |  32 ++++++
 .../spring/CamelSpringDisableJmxInheritedTest.java |  21 ++++
 .../junit5/spring/CamelSpringDisableJmxTest.java   |  33 ++++++
 .../spring/CamelSpringExcludeRoutesTest.java       |  32 ++++++
 .../CamelSpringMockEndpointsAndSkipTest.java       |  57 ++++++++++
 .../spring/CamelSpringMockEndpointsTest.java       |  58 ++++++++++
 ...ingOverridePropertiesForPropertyInjectTest.java |  54 +++++++++
 .../spring/CamelSpringOverridePropertiesTest.java  |  69 ++++++++++++
 .../test/junit5/spring/CamelSpringPlainTest.java   | 125 +++++++++++++++++++++
 .../CamelSpringPropertiesLocationElementTest.java  |  64 +++++++++++
 ...amelSpringProvidesBreakpointInherritedTest.java |  22 ++++
 .../spring/CamelSpringProvidesBreakpointTest.java  |  67 +++++++++++
 ...lSpringRouteProcessorDumpRouteCoverageTest.java |  57 ++++++++++
 ...SpringShutdownTimeoutInheritedOverrideTest.java |  35 ++++++
 .../CamelSpringShutdownTimeoutInheritedTest.java   |  22 ++++
 .../spring/CamelSpringShutdownTimeoutTest.java     |  35 ++++++
 .../spring/CamelSpringTestPropertySourceTest.java  |  46 ++++++++
 .../CamelSpringTestSupportActiveProfileTest.java   |  51 +++++++++
 .../spring/CamelSpringUseAdviceWithTest.java       |  52 +++++++++
 .../spring/TestPropertyInjectRouteBuilder.java     |  33 ++++++
 .../camel/test/junit5/spring/TestRouteBuilder.java |  30 +++++
 ...InterceptSendToEndpointWithLoadbalancerTest.xml |  32 ++++++
 .../junit5/issues/AdviceWithOnCompletionTest.xml   |  39 +++++++
 .../AdviceWithOnExceptionMultipleIssueTest.xml     |  49 ++++++++
 .../junit5/issues/MockEndpointsAndSkipTest.xml     |  37 ++++++
 .../test/junit5/patterns/ProduceBeanInjectTest.xml |  39 +++++++
 .../camel/test/junit5/patterns/ProduceBeanTest.xml |  35 ++++++
 .../camel/test/junit5/patterns/SimpleMockTest.xml  |  33 ++++++
 .../test/junit5/patterns/applicationContext.xml    |  40 +++++++
 .../CamelSpringActiveProfileTest-context.xml       |  43 +++++++
 ...ridePropertiesForPropertyInjectTest-context.xml |  36 ++++++
 .../CamelSpringOverridePropertiesTest-context.xml  |  42 +++++++
 .../junit5/spring/CamelSpringPlainTest-context.xml |  56 +++++++++
 ...SpringPropertiesLocationElementTest-context.xml |  49 ++++++++
 .../CamelSpringTestPropertySourceTest-context.xml  |  41 +++++++
 .../properties-location-element-1.properties       |  18 +++
 .../properties-location-element-2.properties       |  18 +++
 .../properties-location-element-3.properties       |  18 +++
 .../camel/test/junit5/spring/test.properties       |  20 ++++
 49 files changed, 2069 insertions(+), 83 deletions(-)

diff --git a/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringRunner.java b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringRunner.java
deleted file mode 100644
index d64ce29..0000000
--- a/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringRunner.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.test.junit5.spring;
-
-import java.util.List;
-
-import org.junit.runners.model.InitializationError;
-import org.springframework.test.context.TestContextManager;
-import org.springframework.test.context.TestExecutionListener;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-
-/**
- * An implementation bringing the functionality of {@link org.apache.camel.test.spring.CamelSpringTestSupport} to
- * Spring Test based test cases.  This approach allows developers to implement tests
- * for their Spring based applications/routes using the typical Spring Test conventions
- * for test development.
- */
-public class CamelSpringRunner extends SpringJUnit4ClassRunner {
-
-    public CamelSpringRunner(Class<?> clazz) throws InitializationError {
-        super(clazz);
-    }
-
-    /**
-     * Returns the specialized manager instance that provides tight integration between Camel testing
-     * features and Spring.
-     *
-     * @return a new instance of {@link CamelTestContextManager}.
-     */
-    @Override
-    protected TestContextManager createTestContextManager(Class<?> clazz) {
-        return new CamelTestContextManager(clazz);
-    }
-
-    /**
-     * An implementation providing additional integration between Spring Test and Camel
-     * testing features.
-     */
-    public static final class CamelTestContextManager extends TestContextManager {
-
-        public CamelTestContextManager(Class<?> testClass) {
-            super(testClass);
-
-            // is Camel already registered
-            if (!alreadyRegistered()) {
-                // inject Camel first, and then disable jmx and add the stop-watch
-                List<TestExecutionListener> list = getTestExecutionListeners();
-                list.add(0, new CamelSpringTestContextLoaderTestExecutionListener());
-                list.add(1, new DisableJmxTestExecutionListener());
-                list.add(2, new StopWatchTestExecutionListener());
-            }
-        }
-
-        private boolean alreadyRegistered() {
-            List<TestExecutionListener> list = getTestExecutionListeners();
-            if (list != null) {
-                for (TestExecutionListener listener : list) {
-                    if (listener instanceof CamelSpringTestContextLoaderTestExecutionListener) {
-                        return true;
-                    }
-                }
-            }
-
-            return false;
-        }
-
-    }
-
-}
diff --git a/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringTest.java b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringTest.java
new file mode 100644
index 0000000..b43e77f
--- /dev/null
+++ b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringTest.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.spring;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.springframework.test.context.BootstrapWith;
+import org.springframework.test.context.TestExecutionListeners;
+import org.springframework.test.context.junit.jupiter.SpringExtension;
+
+@Documented
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.TYPE})
+@ExtendWith(SpringExtension.class)
+@BootstrapWith(CamelTestContextBootstrapper.class)
+@TestExecutionListeners(value = {CamelSpringTestContextLoaderTestExecutionListener.class, DisableJmxTestExecutionListener.class,
+                                 StopWatchTestExecutionListener.class}, mergeMode = TestExecutionListeners.MergeMode.MERGE_WITH_DEFAULTS)
+public @interface CamelSpringTest {
+
+}
diff --git a/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/patterns/DebugSpringCamelContextTest.java b/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/patterns/DebugSpringCamelContextTest.java
new file mode 100644
index 0000000..340dc22
--- /dev/null
+++ b/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/patterns/DebugSpringCamelContextTest.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.patterns;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.springframework.context.support.AbstractApplicationContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+
+public class DebugSpringCamelContextTest extends DebugSpringTest {
+
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+                // there is no route to be used
+            }
+        };
+    }
+
+    @Override
+    protected AbstractApplicationContext createApplicationContext() {
+        return new ClassPathXmlApplicationContext("org/apache/camel/test/junit5/patterns/applicationContext.xml");
+    }
+}
diff --git a/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/patterns/DebugSpringTest.java b/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/patterns/DebugSpringTest.java
new file mode 100644
index 0000000..c9138a3
--- /dev/null
+++ b/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/patterns/DebugSpringTest.java
@@ -0,0 +1,83 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.patterns;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.model.ProcessorDefinition;
+import org.apache.camel.test.junit5.spring.CamelSpringTestSupport;
+import org.junit.jupiter.api.Test;
+import org.springframework.context.support.AbstractApplicationContext;
+import org.springframework.context.support.GenericApplicationContext;
+
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+public class DebugSpringTest extends CamelSpringTestSupport {
+    private boolean debugged;
+    
+    @Override
+    public boolean isUseDebugger() {
+        // must enable debugger
+        return true;
+    }
+
+    @Override
+    protected void debugBefore(Exchange exchange, Processor processor,
+                               ProcessorDefinition<?> definition, String id, String shortName) {
+        // this method is invoked before we are about to enter the given processor
+        // from your Java editor you can just add a breakpoint in the code line below
+        log.info("Before " + definition + " with body " + exchange.getIn().getBody());
+        debugged = true;
+    }
+
+
+    @Test
+    public void testDebugger() throws Exception {
+        // set mock expectations
+        getMockEndpoint("mock:a").expectedMessageCount(1);
+        getMockEndpoint("mock:b").expectedMessageCount(1);
+
+        // send a message
+        template.sendBody("direct:start", "World");
+
+        // assert mocks
+        assertMockEndpointsSatisfied();
+        assertTrue(debugged, "The debugger is not called!");
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+                // this is the route we want to debug
+                from("direct:start")
+                    .to("mock:a")
+                    .transform(body().prepend("Hello "))
+                    .to("mock:b");
+            }
+        };
+    }
+    
+
+    @Override
+    protected AbstractApplicationContext createApplicationContext() {
+        return new GenericApplicationContext();
+    }
+
+}
diff --git a/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/patterns/MyProduceBean.java b/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/patterns/MyProduceBean.java
new file mode 100644
index 0000000..ba33b34
--- /dev/null
+++ b/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/patterns/MyProduceBean.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.patterns;
+
+import org.apache.camel.EndpointInject;
+import org.apache.camel.Produce;
+import org.apache.camel.ProducerTemplate;
+
+/**
+ *
+ */
+public class MyProduceBean {
+
+    @Produce("mock:result")
+    MySender sender;
+    
+    @EndpointInject("direct:start")
+    ProducerTemplate template;
+
+    public void doSomething(String body) {
+        sender.send(body);
+    }
+    
+    public ProducerTemplate getProducerTemplate() {
+        return template;
+    }
+}
diff --git a/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/patterns/MySender.java b/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/patterns/MySender.java
new file mode 100644
index 0000000..0188296
--- /dev/null
+++ b/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/patterns/MySender.java
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.patterns;
+
+/**
+ *
+ */
+public interface MySender {
+
+    void send(String body);
+}
diff --git a/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/patterns/ProduceBeanTest.java b/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/patterns/ProduceBeanTest.java
new file mode 100644
index 0000000..101d97a
--- /dev/null
+++ b/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/patterns/ProduceBeanTest.java
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.patterns;
+
+import org.apache.camel.test.junit5.spring.CamelSpringTestSupport;
+import org.junit.jupiter.api.Test;
+import org.springframework.context.support.AbstractApplicationContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+/**
+ *
+ */
+public class ProduceBeanTest extends CamelSpringTestSupport {
+
+    @Test
+    public void testProduceBean() throws Exception {
+        getMockEndpoint("mock:result").expectedMessageCount(1);
+
+        template.sendBody("direct:start", "Hello World");
+
+        assertMockEndpointsSatisfied();
+    }
+
+    @Override
+    protected AbstractApplicationContext createApplicationContext() {
+        return new ClassPathXmlApplicationContext("org/apache/camel/test/junit5/patterns/ProduceBeanTest.xml");
+    }
+}
diff --git a/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/patterns/ProducerBeanInjectTest.java b/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/patterns/ProducerBeanInjectTest.java
new file mode 100644
index 0000000..147847c
--- /dev/null
+++ b/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/patterns/ProducerBeanInjectTest.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.patterns;
+
+import org.apache.camel.test.junit5.spring.CamelSpringTestSupport;
+import org.junit.jupiter.api.Test;
+import org.springframework.context.support.AbstractApplicationContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+
+public class ProducerBeanInjectTest extends CamelSpringTestSupport {
+
+    @Test
+    public void checkProducerBeanInjection() {
+        MyProduceBean bean = applicationContext.getBean("myProduceBean", MyProduceBean.class);
+        assertNotNull(bean.getProducerTemplate(), "The producerTemplate should not be null.");
+        assertEquals(bean.getProducerTemplate().requestBody("Camel"), "Camel rocks!", "Get a wrong response");
+    }
+
+    protected AbstractApplicationContext createApplicationContext() {
+        return new ClassPathXmlApplicationContext("org/apache/camel/test/junit5/patterns/ProduceBeanInjectTest.xml");
+    }
+
+}
diff --git a/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/patterns/SimpleMockTest.java b/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/patterns/SimpleMockTest.java
new file mode 100644
index 0000000..a693ad9
--- /dev/null
+++ b/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/patterns/SimpleMockTest.java
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.patterns;
+
+import org.apache.camel.EndpointInject;
+import org.apache.camel.Produce;
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.test.junit5.spring.CamelSpringTestSupport;
+import org.junit.jupiter.api.Test;
+import org.springframework.context.support.AbstractApplicationContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+public class SimpleMockTest extends CamelSpringTestSupport {
+
+    @EndpointInject("mock:result")
+    protected MockEndpoint resultEndpoint;
+
+    @Produce("direct:start")
+    protected ProducerTemplate template;
+
+    @Override
+    protected AbstractApplicationContext createApplicationContext() {
+        return new ClassPathXmlApplicationContext("org/apache/camel/test/junit5/patterns/SimpleMockTest.xml");
+    }
+
+    @Test
+    public void testMock() throws Exception {
+        String expectedBody = "Hello World";
+
+        resultEndpoint.expectedBodiesReceived(expectedBody);
+
+        template.sendBodyAndHeader(expectedBody, "foo", "bar");
+
+        resultEndpoint.assertIsSatisfied();
+    }
+
+    @Test
+    public void testMockAgain() throws Exception {
+        String expectedBody = "Bye World";
+
+        resultEndpoint.expectedBodiesReceived(expectedBody);
+
+        template.sendBodyAndHeader(expectedBody, "foo", "bar");
+
+        resultEndpoint.assertIsSatisfied();
+    }
+
+}
diff --git a/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/CamelSpringActiveProfileTest.java b/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/CamelSpringActiveProfileTest.java
new file mode 100644
index 0000000..64bb894
--- /dev/null
+++ b/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/CamelSpringActiveProfileTest.java
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.spring;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.Produce;
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.junit.jupiter.api.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.test.context.ActiveProfiles;
+import org.springframework.test.context.ContextConfiguration;
+
+// START SNIPPET: e1
+
+/**
+ * Spring style testing with annotations to configure and setup the test.
+ * <p/>
+ * As we do next extend any base test class, we need to inject our resources
+ * for testing such as the {@link CamelContext} and {@link ProducerTemplate}.
+ */
+@ContextConfiguration
+@ActiveProfiles("test")
+@CamelSpringTest
+public class CamelSpringActiveProfileTest {
+
+    @Autowired
+    protected CamelContext camelContext;
+
+    @Produce(value = "direct:start", context = "camelContext")
+    protected ProducerTemplate start;
+
+    @Test
+    public void testLoadActiveProfile() throws InterruptedException {
+        MockEndpoint mock = camelContext.getEndpoint("mock:test", MockEndpoint.class);
+        mock.expectedBodiesReceived("Hello World");
+        start.sendBody("World");
+        mock.assertIsSatisfied();
+    }
+
+}
+// END SNIPPET: e1
diff --git a/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/CamelSpringDisableJmxInheritedOverrideTest.java b/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/CamelSpringDisableJmxInheritedOverrideTest.java
new file mode 100644
index 0000000..d40c4fa
--- /dev/null
+++ b/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/CamelSpringDisableJmxInheritedOverrideTest.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.spring;
+
+import org.apache.camel.impl.engine.DefaultManagementStrategy;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+@DisableJmx
+public class CamelSpringDisableJmxInheritedOverrideTest
+        extends CamelSpringDisableJmxTest {
+
+    @Test
+    public void testJmx() throws Exception {
+        assertEquals(DefaultManagementStrategy.class, camelContext.getManagementStrategy().getClass());
+    }
+}
diff --git a/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/CamelSpringDisableJmxInheritedTest.java b/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/CamelSpringDisableJmxInheritedTest.java
new file mode 100644
index 0000000..e57afdf
--- /dev/null
+++ b/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/CamelSpringDisableJmxInheritedTest.java
@@ -0,0 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.spring;
+
+public class CamelSpringDisableJmxInheritedTest
+        extends CamelSpringDisableJmxTest {
+}
diff --git a/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/CamelSpringDisableJmxTest.java b/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/CamelSpringDisableJmxTest.java
new file mode 100644
index 0000000..c9000c7
--- /dev/null
+++ b/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/CamelSpringDisableJmxTest.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.spring;
+
+import org.apache.camel.management.JmxManagementStrategy;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+@DisableJmx(false)
+public class CamelSpringDisableJmxTest
+        extends CamelSpringPlainTest {
+
+    @Test
+    @Override
+    public void testJmx() throws Exception {
+        assertEquals(JmxManagementStrategy.class, camelContext.getManagementStrategy().getClass());
+    }
+}
diff --git a/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/CamelSpringExcludeRoutesTest.java b/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/CamelSpringExcludeRoutesTest.java
new file mode 100644
index 0000000..5a0c632
--- /dev/null
+++ b/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/CamelSpringExcludeRoutesTest.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.spring;
+
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertNull;
+
+@ExcludeRoutes(TestRouteBuilder.class)
+public class CamelSpringExcludeRoutesTest
+        extends CamelSpringPlainTest {
+
+    @Override
+    @Test
+    public void testExcludedRoute() {
+        assertNull(camelContext.getRoute("excludedRoute"));
+    }
+}
diff --git a/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/CamelSpringMockEndpointsAndSkipTest.java b/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/CamelSpringMockEndpointsAndSkipTest.java
new file mode 100644
index 0000000..87af61c
--- /dev/null
+++ b/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/CamelSpringMockEndpointsAndSkipTest.java
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.spring;
+
+import org.apache.camel.EndpointInject;
+import org.apache.camel.ServiceStatus;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.component.seda.SedaEndpoint;
+import org.apache.camel.spi.InterceptSendToEndpoint;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+
+@MockEndpointsAndSkip("{{mock.skip}}")
+public class CamelSpringMockEndpointsAndSkipTest
+        extends CamelSpringPlainTest {
+
+    @EndpointInject(value = "mock:seda:context2.seda", context = "camelContext2")
+    protected MockEndpoint mock;
+
+    @EndpointInject(value = "seda:context2.seda", context = "camelContext2")
+    private InterceptSendToEndpoint original;
+
+    @Test
+    @Override
+    public void testPositive() throws Exception {
+        assertEquals(ServiceStatus.Started, camelContext.getStatus());
+        assertEquals(ServiceStatus.Started, camelContext2.getStatus());
+
+        mockA.expectedBodiesReceived("David");
+        mockB.expectedBodiesReceived("Hello David");
+        mock.expectedBodiesReceived("Hello David");
+
+        start.sendBody("David");
+        start2.sendBody("David");
+
+        MockEndpoint.assertIsSatisfied(camelContext);
+        MockEndpoint.assertIsSatisfied(camelContext2);
+        assertTrue(((SedaEndpoint) original.getOriginalEndpoint()).getExchanges().isEmpty(), "Original endpoint was invoked");
+    }
+}
diff --git a/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/CamelSpringMockEndpointsTest.java b/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/CamelSpringMockEndpointsTest.java
new file mode 100644
index 0000000..34708e7
--- /dev/null
+++ b/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/CamelSpringMockEndpointsTest.java
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.spring;
+
+import org.apache.camel.EndpointInject;
+import org.apache.camel.ServiceStatus;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.component.seda.SedaEndpoint;
+import org.apache.camel.spi.InterceptSendToEndpoint;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+@MockEndpoints("seda:context2.seda")
+public class CamelSpringMockEndpointsTest
+        extends CamelSpringPlainTest {
+
+    @EndpointInject(value = "mock:seda:context2.seda", context = "camelContext2")
+    protected MockEndpoint mock;
+    
+    @EndpointInject(value = "seda:context2.seda", context = "camelContext2")
+    private InterceptSendToEndpoint original;
+    
+    @Test
+    @Override
+    public void testPositive() throws Exception {
+        
+        assertEquals(ServiceStatus.Started, camelContext.getStatus());
+        assertEquals(ServiceStatus.Started, camelContext2.getStatus());
+        
+        mockA.expectedBodiesReceived("David");
+        mockB.expectedBodiesReceived("Hello David");
+        mockC.expectedBodiesReceived("David");
+        mock.expectedBodiesReceived("Hello David");
+        
+        start.sendBody("David");
+        start2.sendBody("David");
+        
+        MockEndpoint.assertIsSatisfied(camelContext);
+        MockEndpoint.assertIsSatisfied(camelContext2);
+        assertTrue(((SedaEndpoint) original.getOriginalEndpoint()).getExchanges().size() == 1, "Original endpoint should be invoked");
+    }
+}
diff --git a/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/CamelSpringOverridePropertiesForPropertyInjectTest.java b/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/CamelSpringOverridePropertiesForPropertyInjectTest.java
new file mode 100644
index 0000000..18cef45
--- /dev/null
+++ b/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/CamelSpringOverridePropertiesForPropertyInjectTest.java
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.spring;
+
+import java.util.Properties;
+
+import org.apache.camel.Produce;
+import org.apache.camel.ProducerTemplate;
+import org.junit.jupiter.api.Test;
+import org.springframework.test.annotation.DirtiesContext;
+import org.springframework.test.context.ContextConfiguration;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.Is.is;
+
+@ContextConfiguration()
+@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD)
+@CamelSpringTest
+public class CamelSpringOverridePropertiesForPropertyInjectTest {
+    
+    private static final String EXPECTED_PROPERTY_VALUE = "The value is overriden";
+    
+    @Produce(value = "direct:start-override-route")
+    private ProducerTemplate start;
+
+    @UseOverridePropertiesWithPropertiesComponent
+    public static Properties override() {
+        Properties answer = new Properties();
+        answer.put("property.to.override", EXPECTED_PROPERTY_VALUE);
+        return answer;
+    }
+
+    @Test
+    public void testOverride() throws Exception {
+        String response = start.requestBody((Object)"ignored", String.class);
+
+        assertThat(response, is(EXPECTED_PROPERTY_VALUE));
+    }
+
+}
diff --git a/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/CamelSpringOverridePropertiesTest.java b/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/CamelSpringOverridePropertiesTest.java
new file mode 100644
index 0000000..c87e110
--- /dev/null
+++ b/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/CamelSpringOverridePropertiesTest.java
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.spring;
+
+import java.util.Properties;
+
+import org.apache.camel.EndpointInject;
+import org.apache.camel.Produce;
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.junit.jupiter.api.Test;
+import org.springframework.test.annotation.DirtiesContext;
+import org.springframework.test.context.ContextConfiguration;
+
+@ContextConfiguration()
+// Put here to prevent Spring context caching across tests and test methods since some tests inherit
+// from this test and therefore use the same Spring context.  Also because we want to reset the
+// Camel context and mock endpoints between test methods automatically.
+@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD)
+@CamelSpringTest
+public class CamelSpringOverridePropertiesTest {
+
+    @Produce("direct:start")
+    private ProducerTemplate start;
+
+    @EndpointInject("mock:a")
+    private MockEndpoint mockA;
+
+    @EndpointInject("mock:test")
+    private MockEndpoint mockTest;
+
+    @EndpointInject("mock:foo")
+    private MockEndpoint mockFoo;
+
+    @UseOverridePropertiesWithPropertiesComponent
+    public static Properties override() {
+        Properties answer = new Properties();
+        answer.put("cool.end", "mock:foo");
+        return answer;
+    }
+
+    @Test
+    public void testOverride() throws Exception {
+        mockA.expectedBodiesReceived("Camel");
+        mockTest.expectedMessageCount(0);
+        mockFoo.expectedBodiesReceived("Hello Camel");
+
+        start.sendBody("Camel");
+
+        mockA.assertIsSatisfied();
+        mockTest.assertIsSatisfied();
+        mockFoo.assertIsSatisfied();
+    }
+
+}
diff --git a/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/CamelSpringPlainTest.java b/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/CamelSpringPlainTest.java
new file mode 100644
index 0000000..508e7b8
--- /dev/null
+++ b/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/CamelSpringPlainTest.java
@@ -0,0 +1,125 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.spring;
+
+import java.util.concurrent.TimeUnit;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.EndpointInject;
+import org.apache.camel.Produce;
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.ServiceStatus;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.impl.engine.DefaultManagementStrategy;
+import org.apache.camel.util.StopWatch;
+import org.junit.jupiter.api.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.test.annotation.DirtiesContext;
+import org.springframework.test.annotation.DirtiesContext.ClassMode;
+import org.springframework.test.context.ContextConfiguration;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+
+// START SNIPPET: e1
+// tag::example[]
+@ContextConfiguration()
+// Put here to prevent Spring context caching across tests and test methods since some tests inherit
+// from this test and therefore use the same Spring context.  Also because we want to reset the
+// Camel context and mock endpoints between test methods automatically.
+@DirtiesContext(classMode = ClassMode.AFTER_EACH_TEST_METHOD)
+@CamelSpringTest
+public class CamelSpringPlainTest {
+    
+    @Autowired
+    protected CamelContext camelContext;
+    
+    @Autowired
+    protected CamelContext camelContext2;
+    
+    @EndpointInject(value = "mock:a", context = "camelContext")
+    protected MockEndpoint mockA;
+    
+    @EndpointInject(value = "mock:b", context = "camelContext")
+    protected MockEndpoint mockB;
+    
+    @EndpointInject(value = "mock:c", context = "camelContext2")
+    protected MockEndpoint mockC;
+    
+    @Produce(value = "direct:start", context = "camelContext")
+    protected ProducerTemplate start;
+    
+    @Produce(value = "direct:start2", context = "camelContext2")
+    protected ProducerTemplate start2;
+    
+    @Test
+    public void testPositive() throws Exception {
+        assertEquals(ServiceStatus.Started, camelContext.getStatus());
+        assertEquals(ServiceStatus.Started, camelContext2.getStatus());
+        
+        mockA.expectedBodiesReceived("David");
+        mockB.expectedBodiesReceived("Hello David");
+        mockC.expectedBodiesReceived("David");
+        
+        start.sendBody("David");
+        start2.sendBody("David");
+        
+        MockEndpoint.assertIsSatisfied(camelContext);
+        MockEndpoint.assertIsSatisfied(camelContext2);
+    }
+    
+    @Test
+    public void testJmx() throws Exception {
+        assertEquals(DefaultManagementStrategy.class, camelContext.getManagementStrategy().getClass());
+    }
+    
+    @Test
+    public void testShutdownTimeout() throws Exception {
+        assertEquals(10, camelContext.getShutdownStrategy().getTimeout());
+        assertEquals(TimeUnit.SECONDS, camelContext.getShutdownStrategy().getTimeUnit());
+    }
+    
+    @Test
+    public void testStopwatch() {
+        StopWatch stopWatch = StopWatchTestExecutionListener.getStopWatch();
+        
+        assertNotNull(stopWatch);
+        assertTrue(stopWatch.taken() < 100);
+    }
+    
+    @Test
+    public void testExcludedRoute() {
+        assertNotNull(camelContext.getRoute("excludedRoute"));
+    }
+    
+    @Test
+    public void testProvidesBreakpoint() {
+        assertNull(camelContext.getDebugger());
+        assertNull(camelContext2.getDebugger());
+    }
+
+    @Test
+    public void testRouteCoverage() throws Exception {
+        // noop
+    }
+
+}
+// end::example[]
+// END SNIPPET: e1
diff --git a/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/CamelSpringPropertiesLocationElementTest.java b/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/CamelSpringPropertiesLocationElementTest.java
new file mode 100644
index 0000000..a02fe71
--- /dev/null
+++ b/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/CamelSpringPropertiesLocationElementTest.java
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.spring;
+
+import java.util.List;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.EndpointInject;
+import org.apache.camel.Produce;
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.component.properties.PropertiesComponent;
+import org.junit.jupiter.api.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.test.annotation.DirtiesContext;
+import org.springframework.test.context.ContextConfiguration;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+
+@ContextConfiguration()
+@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD)
+@CamelSpringTest
+public class CamelSpringPropertiesLocationElementTest {
+    @Autowired
+    protected CamelContext context;
+    @Produce
+    private ProducerTemplate producer;
+    @EndpointInject("mock:result")
+    private MockEndpoint mock;
+
+    @Test
+    public void testPropertiesLocationElement() throws Exception {
+        mock.expectedHeaderReceived("property-1", "property-value-1");
+        mock.expectedHeaderReceived("property-2", "property-value-2");
+        mock.expectedHeaderReceived("property-3", "property-value-3");
+
+        PropertiesComponent pc = context.getComponent("properties", PropertiesComponent.class);
+        assertNotNull(pc, "Properties component not defined");
+
+        List<String> locations = pc.getLocations();
+
+        assertNotNull(locations);
+        assertEquals(4, locations.size(), "Properties locations");
+
+        producer.sendBody("direct:start", null);
+
+        mock.assertIsSatisfied();
+    }
+}
diff --git a/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/CamelSpringProvidesBreakpointInherritedTest.java b/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/CamelSpringProvidesBreakpointInherritedTest.java
new file mode 100644
index 0000000..3154fae
--- /dev/null
+++ b/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/CamelSpringProvidesBreakpointInherritedTest.java
@@ -0,0 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.spring;
+
+public class CamelSpringProvidesBreakpointInherritedTest
+        extends CamelSpringProvidesBreakpointTest {
+
+}
diff --git a/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/CamelSpringProvidesBreakpointTest.java b/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/CamelSpringProvidesBreakpointTest.java
new file mode 100644
index 0000000..7889817
--- /dev/null
+++ b/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/CamelSpringProvidesBreakpointTest.java
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.spring;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.NamedNode;
+import org.apache.camel.Processor;
+import org.apache.camel.processor.interceptor.BreakpointSupport;
+import org.apache.camel.spi.Breakpoint;
+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;
+
+public class CamelSpringProvidesBreakpointTest
+        extends CamelSpringPlainTest {
+
+    @ProvidesBreakpoint
+    public static Breakpoint createBreakpoint() {
+        return new TestBreakpoint();
+    }
+    
+    @Test
+    @Override
+    public void testProvidesBreakpoint() {
+        assertNotNull(camelContext.getDebugger());
+        assertNotNull(camelContext2.getDebugger());
+        
+        start.sendBody("David");
+        
+        assertNotNull(camelContext.getDebugger());
+        assertNotNull(camelContext.getDebugger().getBreakpoints());
+        assertEquals(1, camelContext.getDebugger().getBreakpoints().size());
+        
+        assertTrue(camelContext.getDebugger().getBreakpoints().get(0) instanceof TestBreakpoint);
+        assertTrue(((TestBreakpoint) camelContext.getDebugger().getBreakpoints().get(0)).isBreakpointHit());
+    }
+    
+    private static final class TestBreakpoint extends BreakpointSupport {
+        
+        private boolean breakpointHit;
+
+        @Override
+        public void beforeProcess(Exchange exchange, Processor processor, NamedNode definition) {
+            breakpointHit = true;
+        }
+
+        public boolean isBreakpointHit() {
+            return breakpointHit;
+        }
+    }
+}
diff --git a/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/CamelSpringRouteProcessorDumpRouteCoverageTest.java b/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/CamelSpringRouteProcessorDumpRouteCoverageTest.java
new file mode 100644
index 0000000..16e4957
--- /dev/null
+++ b/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/CamelSpringRouteProcessorDumpRouteCoverageTest.java
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.spring;
+
+import java.io.File;
+
+import org.apache.camel.management.JmxManagementStrategy;
+import org.apache.camel.test.junit5.TestSupport;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Disabled;
+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;
+
+@EnableRouteCoverage
+public class CamelSpringRouteProcessorDumpRouteCoverageTest extends CamelSpringPlainTest {
+
+    @BeforeAll
+    public static void prepareFiles() throws Exception {
+        TestSupport.deleteDirectory("target/camel-route-coverage");
+    }
+
+    @Test
+    @Disabled("@TODO: This test seems to run alone but not amongst other tests")
+    public void testJmx() throws Exception {
+        // JMX is enabled with route coverage
+        assertEquals(JmxManagementStrategy.class, camelContext.getManagementStrategy().getClass());
+    }
+
+    @Override
+    public void testRouteCoverage() throws Exception {
+        camelContext.stop();
+        camelContext2.stop();
+
+        // there should be files
+        String[] names = new File("target/camel-route-coverage").list();
+        assertNotNull(names);
+        assertTrue(names.length > 0);
+    }
+
+}
diff --git a/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/CamelSpringShutdownTimeoutInheritedOverrideTest.java b/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/CamelSpringShutdownTimeoutInheritedOverrideTest.java
new file mode 100644
index 0000000..5764c93
--- /dev/null
+++ b/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/CamelSpringShutdownTimeoutInheritedOverrideTest.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.spring;
+
+import java.util.concurrent.TimeUnit;
+
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+@ShutdownTimeout
+public class CamelSpringShutdownTimeoutInheritedOverrideTest
+        extends CamelSpringShutdownTimeoutTest {
+
+    @Test
+    @Override
+    public void testShutdownTimeout() throws Exception {
+        assertEquals(10, camelContext.getShutdownStrategy().getTimeout());
+        assertEquals(TimeUnit.SECONDS, camelContext.getShutdownStrategy().getTimeUnit());
+    }
+}
diff --git a/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/CamelSpringShutdownTimeoutInheritedTest.java b/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/CamelSpringShutdownTimeoutInheritedTest.java
new file mode 100644
index 0000000..a146d8a
--- /dev/null
+++ b/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/CamelSpringShutdownTimeoutInheritedTest.java
@@ -0,0 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.spring;
+
+public class CamelSpringShutdownTimeoutInheritedTest
+        extends CamelSpringShutdownTimeoutTest {
+
+}
diff --git a/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/CamelSpringShutdownTimeoutTest.java b/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/CamelSpringShutdownTimeoutTest.java
new file mode 100644
index 0000000..7bca1b5
--- /dev/null
+++ b/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/CamelSpringShutdownTimeoutTest.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.spring;
+
+import java.util.concurrent.TimeUnit;
+
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+@ShutdownTimeout(value = 11, timeUnit = TimeUnit.MILLISECONDS)
+public class CamelSpringShutdownTimeoutTest
+        extends CamelSpringPlainTest {
+
+    @Test
+    @Override
+    public void testShutdownTimeout() throws Exception {
+        assertEquals(11, camelContext.getShutdownStrategy().getTimeout());
+        assertEquals(TimeUnit.MILLISECONDS, camelContext.getShutdownStrategy().getTimeUnit());
+    }
+}
diff --git a/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/CamelSpringTestPropertySourceTest.java b/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/CamelSpringTestPropertySourceTest.java
new file mode 100644
index 0000000..a745834
--- /dev/null
+++ b/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/CamelSpringTestPropertySourceTest.java
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.spring;
+
+import org.apache.camel.EndpointInject;
+import org.apache.camel.Produce;
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.junit.jupiter.api.Test;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.TestPropertySource;
+
+@ContextConfiguration
+@TestPropertySource(properties = "fixedBody=Camel")
+@CamelSpringTest
+public class CamelSpringTestPropertySourceTest {
+
+    @Produce("direct:in")
+    private ProducerTemplate start;
+
+    @EndpointInject("mock:out")
+    private MockEndpoint end;
+
+    @Test
+    public void readsFileAndInlinedPropertiesFromAnnotation() throws Exception {
+        end.expectedBodiesReceived("Camel");
+
+        start.sendBody("Aardvark");
+
+        end.assertIsSatisfied();
+    }
+}
diff --git a/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/CamelSpringTestSupportActiveProfileTest.java b/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/CamelSpringTestSupportActiveProfileTest.java
new file mode 100644
index 0000000..c4a6400
--- /dev/null
+++ b/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/CamelSpringTestSupportActiveProfileTest.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.spring;
+
+import org.junit.jupiter.api.Test;
+import org.springframework.context.support.AbstractApplicationContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+// START SNIPPET: e1
+
+/**
+ * Just extend the CamelSpringTestSupport and use Camel test kit for easy Camel based unit testing.
+ */
+public class CamelSpringTestSupportActiveProfileTest extends CamelSpringTestSupport {
+
+    @Override
+    protected AbstractApplicationContext createApplicationContext() {
+        // must not refresh when using active profiles
+        // lets reuse the xml file from the other test
+        return new ClassPathXmlApplicationContext(new String[]{"org/apache/camel/test/junit5/spring/CamelSpringActiveProfileTest-context.xml"}, false);
+    }
+
+    @Override
+    protected String[] activeProfiles() {
+        // return the active profiles to be used
+        return new String[]{"test"};
+    }
+
+    @Test
+    public void testLoadActiveProfile() throws InterruptedException {
+        getMockEndpoint("mock:test").expectedBodiesReceived("Hello World");
+        template.sendBody("direct:start", "World");
+        assertMockEndpointsSatisfied();
+    }
+
+}
+// END SNIPPET: e1
diff --git a/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/CamelSpringUseAdviceWithTest.java b/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/CamelSpringUseAdviceWithTest.java
new file mode 100644
index 0000000..6140fb1
--- /dev/null
+++ b/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/CamelSpringUseAdviceWithTest.java
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.spring;
+
+import org.apache.camel.ServiceStatus;
+import org.apache.camel.util.StopWatch;
+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.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+@UseAdviceWith
+public class CamelSpringUseAdviceWithTest extends CamelSpringPlainTest {
+    
+    @BeforeEach
+    public void testContextStarted() throws Exception {
+        
+        assertEquals(ServiceStatus.Stopped, camelContext.getStatus());
+        assertEquals(ServiceStatus.Stopped, camelContext2.getStatus());
+        camelContext.start();
+        camelContext2.start();
+
+        // just sleep a little to simulate testing take a bit time
+        Thread.sleep(1000);
+    }
+    
+    @Test
+    public void testStopwatch() {
+        StopWatch stopWatch = StopWatchTestExecutionListener.getStopWatch();
+        
+        assertNotNull(stopWatch);
+        long taken = stopWatch.taken();
+        assertTrue(taken > 0, taken + " > 0, but was: " + taken);
+        assertTrue(taken < 3000, taken + " < 3000, but was: " + taken);
+    }
+}
diff --git a/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/TestPropertyInjectRouteBuilder.java b/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/TestPropertyInjectRouteBuilder.java
new file mode 100644
index 0000000..0ef4ca9
--- /dev/null
+++ b/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/TestPropertyInjectRouteBuilder.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.spring;
+
+import org.apache.camel.PropertyInject;
+import org.apache.camel.builder.RouteBuilder;
+
+public class TestPropertyInjectRouteBuilder extends RouteBuilder {
+
+    @PropertyInject("{{property.to.override}}")
+    private String propertyToOverride;
+    
+    @Override
+    public void configure() throws Exception {
+        from("direct:start-override-route")
+            .transform(constant(propertyToOverride));
+    }
+
+}
diff --git a/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/TestRouteBuilder.java b/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/TestRouteBuilder.java
new file mode 100644
index 0000000..838652c
--- /dev/null
+++ b/components/camel-test-spring/src/test/java/org/apache/camel/test/junit5/spring/TestRouteBuilder.java
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5.spring;
+
+import org.apache.camel.builder.RouteBuilder;
+
+public class TestRouteBuilder extends RouteBuilder {
+
+    @Override
+    public void configure() throws Exception {
+        
+        from("direct:z")
+            .routeId("excludedRoute")
+            .to("log:org.apache.camel.test.junit4.spring");
+    }
+}
diff --git a/components/camel-test-spring/src/test/resources/org/apache/camel/test/junit5/issues/AdviceWithInterceptSendToEndpointWithLoadbalancerTest.xml b/components/camel-test-spring/src/test/resources/org/apache/camel/test/junit5/issues/AdviceWithInterceptSendToEndpointWithLoadbalancerTest.xml
new file mode 100644
index 0000000..9570008
--- /dev/null
+++ b/components/camel-test-spring/src/test/resources/org/apache/camel/test/junit5/issues/AdviceWithInterceptSendToEndpointWithLoadbalancerTest.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:camel="http://camel.apache.org/schema/spring"
+       xsi:schemaLocation="
+        http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
+        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd ">
+
+    <bean id="route" class="org.apache.camel.test.issues.AdviceWithInterceptSendToEndpointWithLoadbalancerTest.LoadbalancerTestRoute" />
+
+    <camelContext xmlns="http://camel.apache.org/schema/spring">
+        <camel:routeBuilder ref="route"/>
+    </camelContext>
+</beans>
\ No newline at end of file
diff --git a/components/camel-test-spring/src/test/resources/org/apache/camel/test/junit5/issues/AdviceWithOnCompletionTest.xml b/components/camel-test-spring/src/test/resources/org/apache/camel/test/junit5/issues/AdviceWithOnCompletionTest.xml
new file mode 100644
index 0000000..ad80f65
--- /dev/null
+++ b/components/camel-test-spring/src/test/resources/org/apache/camel/test/junit5/issues/AdviceWithOnCompletionTest.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:camel="http://camel.apache.org/schema/spring"
+       xsi:schemaLocation="
+        http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
+        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd ">
+
+  <camelContext xmlns="http://camel.apache.org/schema/spring">
+
+    <onCompletion>
+      <to uri="mock:complete"/>
+    </onCompletion>
+
+    <route>
+      <from uri="file:start"/>
+      <to uri="log:end"/>
+    </route>
+
+  </camelContext>
+</beans>
\ No newline at end of file
diff --git a/components/camel-test-spring/src/test/resources/org/apache/camel/test/junit5/issues/AdviceWithOnExceptionMultipleIssueTest.xml b/components/camel-test-spring/src/test/resources/org/apache/camel/test/junit5/issues/AdviceWithOnExceptionMultipleIssueTest.xml
new file mode 100644
index 0000000..030be6c
--- /dev/null
+++ b/components/camel-test-spring/src/test/resources/org/apache/camel/test/junit5/issues/AdviceWithOnExceptionMultipleIssueTest.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:camel="http://camel.apache.org/schema/spring"
+       xsi:schemaLocation="
+		http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
+		http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd ">
+
+  <camelContext xmlns="http://camel.apache.org/schema/spring">
+
+    <onException>
+      <exception>java.lang.Exception</exception>
+      <handled>
+        <constant>true</constant>
+      </handled>
+      <to uri="mock:error"/>
+    </onException>
+
+    <route id="RouteA">
+      <from uri="direct:startA"/>
+      <to uri="mock:resultA"/>
+    </route>
+
+    <route id="RouteB">
+      <from uri="direct:startB"/>
+      <to uri="mock:resultB"/>
+    </route>
+
+  </camelContext>
+
+</beans>
\ No newline at end of file
diff --git a/components/camel-test-spring/src/test/resources/org/apache/camel/test/junit5/issues/MockEndpointsAndSkipTest.xml b/components/camel-test-spring/src/test/resources/org/apache/camel/test/junit5/issues/MockEndpointsAndSkipTest.xml
new file mode 100644
index 0000000..e96d01a
--- /dev/null
+++ b/components/camel-test-spring/src/test/resources/org/apache/camel/test/junit5/issues/MockEndpointsAndSkipTest.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:camel="http://camel.apache.org/schema/spring"
+       xsi:schemaLocation="
+		http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
+		http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd ">
+
+  <camelContext xmlns="http://camel.apache.org/schema/spring">
+
+    <route>
+      <from uri="direct:start"/>
+      <to uri="log:foo"/>
+      <to uri="seda:foo"/>
+    </route>
+
+  </camelContext>
+
+</beans>
\ No newline at end of file
diff --git a/components/camel-test-spring/src/test/resources/org/apache/camel/test/junit5/patterns/ProduceBeanInjectTest.xml b/components/camel-test-spring/src/test/resources/org/apache/camel/test/junit5/patterns/ProduceBeanInjectTest.xml
new file mode 100644
index 0000000..beef19b
--- /dev/null
+++ b/components/camel-test-spring/src/test/resources/org/apache/camel/test/junit5/patterns/ProduceBeanInjectTest.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:camel="http://camel.apache.org/schema/spring"
+       xsi:schemaLocation="
+		http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
+		http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd ">
+
+   
+    <camelContext id="camelContext" xmlns="http://camel.apache.org/schema/spring">
+		<route>
+			<from uri="direct:start"/>
+            <transform>
+               <simple>${in.body} rocks!</simple>
+             </transform>
+		</route>
+    </camelContext>
+
+    <bean id="myProduceBean" class="org.apache.camel.test.junit5.patterns.MyProduceBean"/>
+    
+</beans>
\ No newline at end of file
diff --git a/components/camel-test-spring/src/test/resources/org/apache/camel/test/junit5/patterns/ProduceBeanTest.xml b/components/camel-test-spring/src/test/resources/org/apache/camel/test/junit5/patterns/ProduceBeanTest.xml
new file mode 100644
index 0000000..13863a8
--- /dev/null
+++ b/components/camel-test-spring/src/test/resources/org/apache/camel/test/junit5/patterns/ProduceBeanTest.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:camel="http://camel.apache.org/schema/spring"
+       xsi:schemaLocation="
+		http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
+		http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd ">
+
+<camelContext id="camelContext" xmlns="http://camel.apache.org/schema/spring">
+
+		<route>
+			<from uri="direct:start"/>
+      <bean beanType="org.apache.camel.test.junit5.patterns.MyProduceBean"/>
+		</route>
+	</camelContext>
+
+</beans>
\ No newline at end of file
diff --git a/components/camel-test-spring/src/test/resources/org/apache/camel/test/junit5/patterns/SimpleMockTest.xml b/components/camel-test-spring/src/test/resources/org/apache/camel/test/junit5/patterns/SimpleMockTest.xml
new file mode 100644
index 0000000..6f84464
--- /dev/null
+++ b/components/camel-test-spring/src/test/resources/org/apache/camel/test/junit5/patterns/SimpleMockTest.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="
+		http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
+		http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd ">
+
+  <camelContext xmlns="http://camel.apache.org/schema/spring">
+    <route>
+      <from uri="direct:start"/>
+      <to uri="mock:result"/>
+    </route>
+  </camelContext>
+
+</beans>
\ No newline at end of file
diff --git a/components/camel-test-spring/src/test/resources/org/apache/camel/test/junit5/patterns/applicationContext.xml b/components/camel-test-spring/src/test/resources/org/apache/camel/test/junit5/patterns/applicationContext.xml
new file mode 100644
index 0000000..17179a4
--- /dev/null
+++ b/components/camel-test-spring/src/test/resources/org/apache/camel/test/junit5/patterns/applicationContext.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xmlns:camel="http://camel.apache.org/schema/spring"
+	xsi:schemaLocation="
+		http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
+		http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd ">
+
+
+	<camelContext id="camelContext" xmlns="http://camel.apache.org/schema/spring" trace="true" autoStartup="true" >
+
+		<route>
+			<from uri="direct:start" />
+			<to uri="mock:a" />
+			<transform>
+				<simple>Hello ${body}</simple>
+			</transform>
+			<to uri="mock:b" />
+		</route>
+	</camelContext>
+
+</beans>
\ No newline at end of file
diff --git a/components/camel-test-spring/src/test/resources/org/apache/camel/test/junit5/spring/CamelSpringActiveProfileTest-context.xml b/components/camel-test-spring/src/test/resources/org/apache/camel/test/junit5/spring/CamelSpringActiveProfileTest-context.xml
new file mode 100644
index 0000000..a188ede
--- /dev/null
+++ b/components/camel-test-spring/src/test/resources/org/apache/camel/test/junit5/spring/CamelSpringActiveProfileTest-context.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xmlns:camel="http://camel.apache.org/schema/spring"
+	xsi:schemaLocation="
+		http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
+		http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd ">
+
+  <camelContext id="camelContext" xmlns="http://camel.apache.org/schema/spring">
+    <route>
+      <from uri="direct:start" />
+      <transform>
+        <simple>Hello ${body}</simple>
+      </transform>
+      <to uri="properties:{{cool.end}}" />
+    </route>
+  </camelContext>
+  
+  <!-- setup the profile for testing -->
+  <beans profile="test">
+     <bean id="bridgePropertyPlaceholder" class="org.apache.camel.spring.spi.BridgePropertyPlaceholderConfigurer">
+         <property name="location" value="classpath:org/apache/camel/test/junit5/spring/test.properties"/>
+     </bean>
+  </beans>
+</beans>
\ No newline at end of file
diff --git a/components/camel-test-spring/src/test/resources/org/apache/camel/test/junit5/spring/CamelSpringOverridePropertiesForPropertyInjectTest-context.xml b/components/camel-test-spring/src/test/resources/org/apache/camel/test/junit5/spring/CamelSpringOverridePropertiesForPropertyInjectTest-context.xml
new file mode 100644
index 0000000..a7510b2
--- /dev/null
+++ b/components/camel-test-spring/src/test/resources/org/apache/camel/test/junit5/spring/CamelSpringOverridePropertiesForPropertyInjectTest-context.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="
+		http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
+		http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd ">
+
+  <bean id="bridgePropertyPlaceholder" class="org.apache.camel.spring.spi.BridgePropertyPlaceholderConfigurer">
+    <property name="location" value="classpath:org/apache/camel/test/junit5/spring/test.properties"/>
+  </bean>
+  
+  <bean id="testRouteBuilder" class="org.apache.camel.test.junit5.spring.TestPropertyInjectRouteBuilder"></bean>
+
+  <camelContext id="camelContext" xmlns="http://camel.apache.org/schema/spring">
+      <routeBuilder ref="testRouteBuilder"/>
+  </camelContext>
+
+</beans>
\ No newline at end of file
diff --git a/components/camel-test-spring/src/test/resources/org/apache/camel/test/junit5/spring/CamelSpringOverridePropertiesTest-context.xml b/components/camel-test-spring/src/test/resources/org/apache/camel/test/junit5/spring/CamelSpringOverridePropertiesTest-context.xml
new file mode 100644
index 0000000..712e4dd
--- /dev/null
+++ b/components/camel-test-spring/src/test/resources/org/apache/camel/test/junit5/spring/CamelSpringOverridePropertiesTest-context.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="
+		http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
+		http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd ">
+
+  <bean id="bridgePropertyPlaceholder" class="org.apache.camel.spring.spi.BridgePropertyPlaceholderConfigurer">
+    <property name="location" value="classpath:org/apache/camel/test/junit5/spring/test.properties"/>
+  </bean>
+
+  <camelContext id="camelContext" xmlns="http://camel.apache.org/schema/spring">
+    <route>
+      <from uri="direct:start"/>
+      <to uri="mock:a"/>
+      <transform>
+        <simple>Hello ${body}</simple>
+      </transform>
+      <to uri="{{cool.end}}"/>
+    </route>
+  </camelContext>
+  
+
+</beans>
\ No newline at end of file
diff --git a/components/camel-test-spring/src/test/resources/org/apache/camel/test/junit5/spring/CamelSpringPlainTest-context.xml b/components/camel-test-spring/src/test/resources/org/apache/camel/test/junit5/spring/CamelSpringPlainTest-context.xml
new file mode 100644
index 0000000..218f158
--- /dev/null
+++ b/components/camel-test-spring/src/test/resources/org/apache/camel/test/junit5/spring/CamelSpringPlainTest-context.xml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="
+		http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
+		http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd ">
+
+  <camelContext id="camelContext" xmlns="http://camel.apache.org/schema/spring" trace="true" autoStartup="true">
+    <packageScan>
+      <package>org.apache.camel.test.junit5.spring</package>
+    </packageScan>
+    <route>
+      <from uri="direct:start"/>
+      <to uri="mock:a"/>
+      <transform>
+        <simple>Hello ${body}</simple>
+      </transform>
+      <to uri="mock:b"/>
+    </route>
+  </camelContext>
+  
+  <bean id="bridgePropertyPlaceholder" class="org.apache.camel.spring.spi.BridgePropertyPlaceholderConfigurer">
+     <property name="location" value="classpath:org/apache/camel/test/junit5/spring/test.properties"/>
+  </bean>
+
+  <camelContext id="camelContext2" xmlns="http://camel.apache.org/schema/spring" trace="true" autoStartup="true">
+    <route>
+      <from uri="direct:start2"/>
+      <to uri="mock:c"/>
+      <transform>
+        <simple>Hello ${body}</simple>
+      </transform>
+      <to uri="log:org.apache.camel.test.junit5.spring"/>
+      <to uri="seda:context2.seda"/>
+    </route>
+  </camelContext>
+
+</beans>
\ No newline at end of file
diff --git a/components/camel-test-spring/src/test/resources/org/apache/camel/test/junit5/spring/CamelSpringPropertiesLocationElementTest-context.xml b/components/camel-test-spring/src/test/resources/org/apache/camel/test/junit5/spring/CamelSpringPropertiesLocationElementTest-context.xml
new file mode 100644
index 0000000..be91d6c
--- /dev/null
+++ b/components/camel-test-spring/src/test/resources/org/apache/camel/test/junit5/spring/CamelSpringPropertiesLocationElementTest-context.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="
+		http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
+		http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd ">
+
+  <camelContext xmlns="http://camel.apache.org/schema/spring">
+    <propertyPlaceholder id="property-placeholder-camel" location="classpath:org/apache/camel/test/junit5/spring/properties-location-element-3.properties">
+      <propertiesLocation resolver="classpath" path="org/apache/camel/test/junit5/spring/properties-location-element-1.properties"/>
+      <propertiesLocation resolver="classpath" path="org/apache/camel/test/junit5/spring/properties-location-element-2.properties"/>
+      <propertiesLocation resolver="classpath" path="org/apache/camel/test/junit5/spring/properties-location-element-4.properties" optional="true"/>
+    </propertyPlaceholder>
+
+    <route>
+      <from uri="direct:start"/>
+      <setHeader name="property-1">
+        <constant>{{property-key-1}}</constant>
+      </setHeader>
+      <setHeader name="property-2">
+        <constant>{{property-key-2}}</constant>
+      </setHeader>
+      <setHeader name="property-3">
+        <constant>{{property-key-3}}</constant>
+      </setHeader>
+      <to uri="mock:result"/>
+    </route>
+
+  </camelContext>
+
+</beans>
diff --git a/components/camel-test-spring/src/test/resources/org/apache/camel/test/junit5/spring/CamelSpringTestPropertySourceTest-context.xml b/components/camel-test-spring/src/test/resources/org/apache/camel/test/junit5/spring/CamelSpringTestPropertySourceTest-context.xml
new file mode 100644
index 0000000..220e140
--- /dev/null
+++ b/components/camel-test-spring/src/test/resources/org/apache/camel/test/junit5/spring/CamelSpringTestPropertySourceTest-context.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="
+		http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
+		http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+  <!-- Enable PropertySource -->
+  <bean class="org.springframework.context.support.PropertySourcesPlaceholderConfigurer"/>
+
+  <bean id="myBean" class="org.apache.camel.ValueHolder">
+    <constructor-arg value="${fixedBody}"/> <!-- configured from @TestPropertySource -->
+  </bean>
+
+  <camelContext id="camelContext" xmlns="http://camel.apache.org/schema/spring" trace="true" autoStartup="true">
+    <route>
+      <from uri="direct:in"/>
+      <bean ref="myBean" method="get"/>
+      <to uri="mock:out"/>
+    </route>
+  </camelContext>
+
+</beans>
\ No newline at end of file
diff --git a/components/camel-test-spring/src/test/resources/org/apache/camel/test/junit5/spring/properties-location-element-1.properties b/components/camel-test-spring/src/test/resources/org/apache/camel/test/junit5/spring/properties-location-element-1.properties
new file mode 100644
index 0000000..81ff2b5
--- /dev/null
+++ b/components/camel-test-spring/src/test/resources/org/apache/camel/test/junit5/spring/properties-location-element-1.properties
@@ -0,0 +1,18 @@
+## ---------------------------------------------------------------------------
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements.  See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License.  You may obtain a copy of the License at
+##
+##      http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+## ---------------------------------------------------------------------------
+
+property-key-1 = property-value-1
diff --git a/components/camel-test-spring/src/test/resources/org/apache/camel/test/junit5/spring/properties-location-element-2.properties b/components/camel-test-spring/src/test/resources/org/apache/camel/test/junit5/spring/properties-location-element-2.properties
new file mode 100644
index 0000000..24ebe3f
--- /dev/null
+++ b/components/camel-test-spring/src/test/resources/org/apache/camel/test/junit5/spring/properties-location-element-2.properties
@@ -0,0 +1,18 @@
+## ---------------------------------------------------------------------------
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements.  See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License.  You may obtain a copy of the License at
+##
+##      http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+## ---------------------------------------------------------------------------
+
+property-key-2 = property-value-2
diff --git a/components/camel-test-spring/src/test/resources/org/apache/camel/test/junit5/spring/properties-location-element-3.properties b/components/camel-test-spring/src/test/resources/org/apache/camel/test/junit5/spring/properties-location-element-3.properties
new file mode 100644
index 0000000..6c94f7f
--- /dev/null
+++ b/components/camel-test-spring/src/test/resources/org/apache/camel/test/junit5/spring/properties-location-element-3.properties
@@ -0,0 +1,18 @@
+## ---------------------------------------------------------------------------
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements.  See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License.  You may obtain a copy of the License at
+##
+##      http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+## ---------------------------------------------------------------------------
+
+property-key-3 = property-value-3
diff --git a/components/camel-test-spring/src/test/resources/org/apache/camel/test/junit5/spring/test.properties b/components/camel-test-spring/src/test/resources/org/apache/camel/test/junit5/spring/test.properties
new file mode 100644
index 0000000..e8a539c
--- /dev/null
+++ b/components/camel-test-spring/src/test/resources/org/apache/camel/test/junit5/spring/test.properties
@@ -0,0 +1,20 @@
+## ---------------------------------------------------------------------------
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements.  See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License.  You may obtain a copy of the License at
+##
+##      http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+## ---------------------------------------------------------------------------
+
+cool.end=mock:test
+mock.skip=seda:*
+property.to.override=This value should be overriden


[camel] 01/09: CAMEL-13342: Created CamelTest annotation and move existing tests to **test/junit4**

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

aldettinger pushed a commit to branch CAMEL-13342-JUNIT5-EXPLORATORY
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 6103c93760b945f87374a5c511b23e40e5676675
Author: aldettinger <al...@gmail.com>
AuthorDate: Wed Jun 5 14:11:35 2019 +0200

    CAMEL-13342: Created CamelTest annotation and move existing tests to **test/junit4**
---
 components/camel-test/pom.xml                        |  5 +++++
 .../org/apache/camel/test/junit5/CamelTest.java}     | 20 ++++++++------------
 .../patterns/AdviceWithNotStartedTest.java           |  2 +-
 .../{ => junit4}/patterns/AsyncSendMockTest.java     |  2 +-
 .../test/{ => junit4}/patterns/DebugJUnit4Test.java  |  2 +-
 .../patterns/DebugNoLazyTypeConverterTest.java       |  2 +-
 .../camel/test/{ => junit4}/patterns/DebugTest.java  |  2 +-
 .../FilterCreateCamelContextPerClassTest.java        |  2 +-
 .../patterns/FilterFluentTemplateTest.java           |  2 +-
 .../test/{ => junit4}/patterns/FilterJUnit4Test.java |  2 +-
 .../camel/test/{ => junit4}/patterns/FilterTest.java |  2 +-
 .../patterns/IsMockEndpointsAndSkipJUnit4Test.java   |  2 +-
 .../patterns/IsMockEndpointsFileTest.java            |  2 +-
 .../patterns/IsMockEndpointsJUnit4Test.java          |  2 +-
 .../{ => junit4}/patterns/IsMockEndpointsTest.java   |  2 +-
 .../patterns/MockEndpointFailNoHeaderTest.java       |  2 +-
 .../test/{ => junit4}/patterns/MyProduceBean.java    |  2 +-
 .../camel/test/{ => junit4}/patterns/MySender.java   |  2 +-
 .../test/{ => junit4}/patterns/ProduceBeanTest.java  |  2 +-
 .../patterns/RouteBuilderConfigureExceptionTest.java |  2 +-
 .../RouteProcessorDumpRouteCoverageTest.java         |  2 +-
 .../patterns/SimpleMockEndpointsTest.java            |  2 +-
 .../test/{ => junit4}/patterns/SimpleMockTest.java   |  2 +-
 .../patterns/SimpleNotifyBuilderTest.java            |  2 +-
 .../patterns/SimpleWeaveAddMockLastTest.java         |  2 +-
 ...verridePropertiesWithPropertiesComponentTest.java |  2 +-
 26 files changed, 37 insertions(+), 36 deletions(-)

diff --git a/components/camel-test/pom.xml b/components/camel-test/pom.xml
index 2e70437..c3485f4 100644
--- a/components/camel-test/pom.xml
+++ b/components/camel-test/pom.xml
@@ -54,6 +54,11 @@
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.junit.jupiter</groupId>
+            <artifactId>junit-jupiter-api</artifactId>
+            <version>5.5.0-M1</version>
+        </dependency>
 
         <dependency>
             <groupId>org.apache.logging.log4j</groupId>
diff --git a/components/camel-test/src/test/java/org/apache/camel/test/patterns/MyProduceBean.java b/components/camel-test/src/main/java/org/apache/camel/test/junit5/CamelTest.java
similarity index 73%
copy from components/camel-test/src/test/java/org/apache/camel/test/patterns/MyProduceBean.java
copy to components/camel-test/src/main/java/org/apache/camel/test/junit5/CamelTest.java
index d8864c9..05ed250 100644
--- a/components/camel-test/src/test/java/org/apache/camel/test/patterns/MyProduceBean.java
+++ b/components/camel-test/src/main/java/org/apache/camel/test/junit5/CamelTest.java
@@ -14,19 +14,15 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.test.patterns;
+package org.apache.camel.test.junit5;
 
-import org.apache.camel.Produce;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
 
-/**
- *
- */
-public class MyProduceBean {
-
-    @Produce("mock:result")
-    MySender sender;
+@Target({ElementType.TYPE})
+@Retention(RetentionPolicy.RUNTIME)
+public @interface CamelTest {
 
-    public void doSomething(String body) {
-        sender.send(body);
-    }
 }
diff --git a/components/camel-test/src/test/java/org/apache/camel/test/patterns/AdviceWithNotStartedTest.java b/components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/AdviceWithNotStartedTest.java
similarity index 98%
rename from components/camel-test/src/test/java/org/apache/camel/test/patterns/AdviceWithNotStartedTest.java
rename to components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/AdviceWithNotStartedTest.java
index bcbc0e4..2d792c4 100644
--- a/components/camel-test/src/test/java/org/apache/camel/test/patterns/AdviceWithNotStartedTest.java
+++ b/components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/AdviceWithNotStartedTest.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.test.patterns;
+package org.apache.camel.test.junit4.patterns;
 
 import java.util.concurrent.RejectedExecutionException;
 
diff --git a/components/camel-test/src/test/java/org/apache/camel/test/patterns/AsyncSendMockTest.java b/components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/AsyncSendMockTest.java
similarity index 97%
rename from components/camel-test/src/test/java/org/apache/camel/test/patterns/AsyncSendMockTest.java
rename to components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/AsyncSendMockTest.java
index 48d818d..4e37d70 100644
--- a/components/camel-test/src/test/java/org/apache/camel/test/patterns/AsyncSendMockTest.java
+++ b/components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/AsyncSendMockTest.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.test.patterns;
+package org.apache.camel.test.junit4.patterns;
 
 import org.apache.camel.support.DefaultExchange;
 import org.apache.camel.test.junit4.CamelTestSupport;
diff --git a/components/camel-test/src/test/java/org/apache/camel/test/patterns/DebugJUnit4Test.java b/components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/DebugJUnit4Test.java
similarity index 98%
rename from components/camel-test/src/test/java/org/apache/camel/test/patterns/DebugJUnit4Test.java
rename to components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/DebugJUnit4Test.java
index 6aa7524..7b28a24 100644
--- a/components/camel-test/src/test/java/org/apache/camel/test/patterns/DebugJUnit4Test.java
+++ b/components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/DebugJUnit4Test.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.test.patterns;
+package org.apache.camel.test.junit4.patterns;
 
 import org.apache.camel.Exchange;
 import org.apache.camel.Processor;
diff --git a/components/camel-test/src/test/java/org/apache/camel/test/patterns/DebugNoLazyTypeConverterTest.java b/components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/DebugNoLazyTypeConverterTest.java
similarity index 98%
rename from components/camel-test/src/test/java/org/apache/camel/test/patterns/DebugNoLazyTypeConverterTest.java
rename to components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/DebugNoLazyTypeConverterTest.java
index 31e8938..763123d 100644
--- a/components/camel-test/src/test/java/org/apache/camel/test/patterns/DebugNoLazyTypeConverterTest.java
+++ b/components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/DebugNoLazyTypeConverterTest.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.test.patterns;
+package org.apache.camel.test.junit4.patterns;
 
 import org.apache.camel.Exchange;
 import org.apache.camel.Processor;
diff --git a/components/camel-test/src/test/java/org/apache/camel/test/patterns/DebugTest.java b/components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/DebugTest.java
similarity index 98%
rename from components/camel-test/src/test/java/org/apache/camel/test/patterns/DebugTest.java
rename to components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/DebugTest.java
index c7b7466..9e31817 100644
--- a/components/camel-test/src/test/java/org/apache/camel/test/patterns/DebugTest.java
+++ b/components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/DebugTest.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.test.patterns;
+package org.apache.camel.test.junit4.patterns;
 
 import org.apache.camel.Exchange;
 import org.apache.camel.Processor;
diff --git a/components/camel-test/src/test/java/org/apache/camel/test/patterns/FilterCreateCamelContextPerClassTest.java b/components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/FilterCreateCamelContextPerClassTest.java
similarity index 97%
rename from components/camel-test/src/test/java/org/apache/camel/test/patterns/FilterCreateCamelContextPerClassTest.java
rename to components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/FilterCreateCamelContextPerClassTest.java
index 0392f0f..d9ce4a2 100644
--- a/components/camel-test/src/test/java/org/apache/camel/test/patterns/FilterCreateCamelContextPerClassTest.java
+++ b/components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/FilterCreateCamelContextPerClassTest.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.test.patterns;
+package org.apache.camel.test.junit4.patterns;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.test.junit4.CamelTestSupport;
diff --git a/components/camel-test/src/test/java/org/apache/camel/test/patterns/FilterFluentTemplateTest.java b/components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/FilterFluentTemplateTest.java
similarity index 98%
rename from components/camel-test/src/test/java/org/apache/camel/test/patterns/FilterFluentTemplateTest.java
rename to components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/FilterFluentTemplateTest.java
index 913ecbe..72df15d 100644
--- a/components/camel-test/src/test/java/org/apache/camel/test/patterns/FilterFluentTemplateTest.java
+++ b/components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/FilterFluentTemplateTest.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.test.patterns;
+package org.apache.camel.test.junit4.patterns;
 
 import org.apache.camel.EndpointInject;
 import org.apache.camel.FluentProducerTemplate;
diff --git a/components/camel-test/src/test/java/org/apache/camel/test/patterns/FilterJUnit4Test.java b/components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/FilterJUnit4Test.java
similarity index 97%
rename from components/camel-test/src/test/java/org/apache/camel/test/patterns/FilterJUnit4Test.java
rename to components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/FilterJUnit4Test.java
index 9213e5b..54386b9 100644
--- a/components/camel-test/src/test/java/org/apache/camel/test/patterns/FilterJUnit4Test.java
+++ b/components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/FilterJUnit4Test.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.test.patterns;
+package org.apache.camel.test.junit4.patterns;
 
 import org.apache.camel.EndpointInject;
 import org.apache.camel.Produce;
diff --git a/components/camel-test/src/test/java/org/apache/camel/test/patterns/FilterTest.java b/components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/FilterTest.java
similarity index 98%
rename from components/camel-test/src/test/java/org/apache/camel/test/patterns/FilterTest.java
rename to components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/FilterTest.java
index 8ad2636..aa13656 100644
--- a/components/camel-test/src/test/java/org/apache/camel/test/patterns/FilterTest.java
+++ b/components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/FilterTest.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.test.patterns;
+package org.apache.camel.test.junit4.patterns;
 
 import org.apache.camel.EndpointInject;
 import org.apache.camel.Produce;
diff --git a/components/camel-test/src/test/java/org/apache/camel/test/patterns/IsMockEndpointsAndSkipJUnit4Test.java b/components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/IsMockEndpointsAndSkipJUnit4Test.java
similarity index 98%
rename from components/camel-test/src/test/java/org/apache/camel/test/patterns/IsMockEndpointsAndSkipJUnit4Test.java
rename to components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/IsMockEndpointsAndSkipJUnit4Test.java
index da82ca0..8e2a91a 100644
--- a/components/camel-test/src/test/java/org/apache/camel/test/patterns/IsMockEndpointsAndSkipJUnit4Test.java
+++ b/components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/IsMockEndpointsAndSkipJUnit4Test.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.test.patterns;
+package org.apache.camel.test.junit4.patterns;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.seda.SedaEndpoint;
diff --git a/components/camel-test/src/test/java/org/apache/camel/test/patterns/IsMockEndpointsFileTest.java b/components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/IsMockEndpointsFileTest.java
similarity index 98%
rename from components/camel-test/src/test/java/org/apache/camel/test/patterns/IsMockEndpointsFileTest.java
rename to components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/IsMockEndpointsFileTest.java
index 9df144b..82b08c9 100644
--- a/components/camel-test/src/test/java/org/apache/camel/test/patterns/IsMockEndpointsFileTest.java
+++ b/components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/IsMockEndpointsFileTest.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.test.patterns;
+package org.apache.camel.test.junit4.patterns;
 import org.apache.camel.Exchange;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
diff --git a/components/camel-test/src/test/java/org/apache/camel/test/patterns/IsMockEndpointsJUnit4Test.java b/components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/IsMockEndpointsJUnit4Test.java
similarity index 98%
rename from components/camel-test/src/test/java/org/apache/camel/test/patterns/IsMockEndpointsJUnit4Test.java
rename to components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/IsMockEndpointsJUnit4Test.java
index d8cf4c0..d8cfbaa 100644
--- a/components/camel-test/src/test/java/org/apache/camel/test/patterns/IsMockEndpointsJUnit4Test.java
+++ b/components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/IsMockEndpointsJUnit4Test.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.test.patterns;
+package org.apache.camel.test.junit4.patterns;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.test.junit4.CamelTestSupport;
diff --git a/components/camel-test/src/test/java/org/apache/camel/test/patterns/IsMockEndpointsTest.java b/components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/IsMockEndpointsTest.java
similarity index 98%
rename from components/camel-test/src/test/java/org/apache/camel/test/patterns/IsMockEndpointsTest.java
rename to components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/IsMockEndpointsTest.java
index e3bcb9e..ed3288b 100644
--- a/components/camel-test/src/test/java/org/apache/camel/test/patterns/IsMockEndpointsTest.java
+++ b/components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/IsMockEndpointsTest.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.test.patterns;
+package org.apache.camel.test.junit4.patterns;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.test.junit4.CamelTestSupport;
diff --git a/components/camel-test/src/test/java/org/apache/camel/test/patterns/MockEndpointFailNoHeaderTest.java b/components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/MockEndpointFailNoHeaderTest.java
similarity index 97%
rename from components/camel-test/src/test/java/org/apache/camel/test/patterns/MockEndpointFailNoHeaderTest.java
rename to components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/MockEndpointFailNoHeaderTest.java
index c878091..9b341eb 100644
--- a/components/camel-test/src/test/java/org/apache/camel/test/patterns/MockEndpointFailNoHeaderTest.java
+++ b/components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/MockEndpointFailNoHeaderTest.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.test.patterns;
+package org.apache.camel.test.junit4.patterns;
 
 import org.apache.camel.EndpointInject;
 import org.apache.camel.Produce;
diff --git a/components/camel-test/src/test/java/org/apache/camel/test/patterns/MyProduceBean.java b/components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/MyProduceBean.java
similarity index 95%
rename from components/camel-test/src/test/java/org/apache/camel/test/patterns/MyProduceBean.java
rename to components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/MyProduceBean.java
index d8864c9..696b6ea 100644
--- a/components/camel-test/src/test/java/org/apache/camel/test/patterns/MyProduceBean.java
+++ b/components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/MyProduceBean.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.test.patterns;
+package org.apache.camel.test.junit4.patterns;
 
 import org.apache.camel.Produce;
 
diff --git a/components/camel-test/src/test/java/org/apache/camel/test/patterns/MySender.java b/components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/MySender.java
similarity index 94%
rename from components/camel-test/src/test/java/org/apache/camel/test/patterns/MySender.java
rename to components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/MySender.java
index 0319c98..c68a1c6 100644
--- a/components/camel-test/src/test/java/org/apache/camel/test/patterns/MySender.java
+++ b/components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/MySender.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.test.patterns;
+package org.apache.camel.test.junit4.patterns;
 
 /**
  *
diff --git a/components/camel-test/src/test/java/org/apache/camel/test/patterns/ProduceBeanTest.java b/components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/ProduceBeanTest.java
similarity index 97%
rename from components/camel-test/src/test/java/org/apache/camel/test/patterns/ProduceBeanTest.java
rename to components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/ProduceBeanTest.java
index 2050e6c..bb49119 100644
--- a/components/camel-test/src/test/java/org/apache/camel/test/patterns/ProduceBeanTest.java
+++ b/components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/ProduceBeanTest.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.test.patterns;
+package org.apache.camel.test.junit4.patterns;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.test.junit4.CamelTestSupport;
diff --git a/components/camel-test/src/test/java/org/apache/camel/test/patterns/RouteBuilderConfigureExceptionTest.java b/components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/RouteBuilderConfigureExceptionTest.java
similarity index 97%
rename from components/camel-test/src/test/java/org/apache/camel/test/patterns/RouteBuilderConfigureExceptionTest.java
rename to components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/RouteBuilderConfigureExceptionTest.java
index 033d64c..7d2c456 100644
--- a/components/camel-test/src/test/java/org/apache/camel/test/patterns/RouteBuilderConfigureExceptionTest.java
+++ b/components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/RouteBuilderConfigureExceptionTest.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.test.patterns;
+package org.apache.camel.test.junit4.patterns;
 import org.apache.camel.Predicate;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.test.junit4.CamelTestSupport;
diff --git a/components/camel-test/src/test/java/org/apache/camel/test/patterns/RouteProcessorDumpRouteCoverageTest.java b/components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/RouteProcessorDumpRouteCoverageTest.java
similarity index 97%
rename from components/camel-test/src/test/java/org/apache/camel/test/patterns/RouteProcessorDumpRouteCoverageTest.java
rename to components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/RouteProcessorDumpRouteCoverageTest.java
index 675c14e..6bfbd6a 100644
--- a/components/camel-test/src/test/java/org/apache/camel/test/patterns/RouteProcessorDumpRouteCoverageTest.java
+++ b/components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/RouteProcessorDumpRouteCoverageTest.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.test.patterns;
+package org.apache.camel.test.junit4.patterns;
 import org.apache.camel.RoutesBuilder;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.test.junit4.CamelTestSupport;
diff --git a/components/camel-test/src/test/java/org/apache/camel/test/patterns/SimpleMockEndpointsTest.java b/components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/SimpleMockEndpointsTest.java
similarity index 97%
rename from components/camel-test/src/test/java/org/apache/camel/test/patterns/SimpleMockEndpointsTest.java
rename to components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/SimpleMockEndpointsTest.java
index 786d972..ad66ca0 100644
--- a/components/camel-test/src/test/java/org/apache/camel/test/patterns/SimpleMockEndpointsTest.java
+++ b/components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/SimpleMockEndpointsTest.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.test.patterns;
+package org.apache.camel.test.junit4.patterns;
 
 import org.apache.camel.RoutesBuilder;
 import org.apache.camel.builder.RouteBuilder;
diff --git a/components/camel-test/src/test/java/org/apache/camel/test/patterns/SimpleMockTest.java b/components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/SimpleMockTest.java
similarity index 97%
rename from components/camel-test/src/test/java/org/apache/camel/test/patterns/SimpleMockTest.java
rename to components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/SimpleMockTest.java
index c9b89aa..1bbd710 100644
--- a/components/camel-test/src/test/java/org/apache/camel/test/patterns/SimpleMockTest.java
+++ b/components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/SimpleMockTest.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.test.patterns;
+package org.apache.camel.test.junit4.patterns;
 
 import org.apache.camel.RoutesBuilder;
 import org.apache.camel.builder.RouteBuilder;
diff --git a/components/camel-test/src/test/java/org/apache/camel/test/patterns/SimpleNotifyBuilderTest.java b/components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/SimpleNotifyBuilderTest.java
similarity index 97%
rename from components/camel-test/src/test/java/org/apache/camel/test/patterns/SimpleNotifyBuilderTest.java
rename to components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/SimpleNotifyBuilderTest.java
index e8640ee..577587b 100644
--- a/components/camel-test/src/test/java/org/apache/camel/test/patterns/SimpleNotifyBuilderTest.java
+++ b/components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/SimpleNotifyBuilderTest.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.test.patterns;
+package org.apache.camel.test.junit4.patterns;
 
 import java.util.concurrent.TimeUnit;
 
diff --git a/components/camel-test/src/test/java/org/apache/camel/test/patterns/SimpleWeaveAddMockLastTest.java b/components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/SimpleWeaveAddMockLastTest.java
similarity index 97%
rename from components/camel-test/src/test/java/org/apache/camel/test/patterns/SimpleWeaveAddMockLastTest.java
rename to components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/SimpleWeaveAddMockLastTest.java
index 72e1036..929a725 100644
--- a/components/camel-test/src/test/java/org/apache/camel/test/patterns/SimpleWeaveAddMockLastTest.java
+++ b/components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/SimpleWeaveAddMockLastTest.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.test.patterns;
+package org.apache.camel.test.junit4.patterns;
 
 import org.apache.camel.RoutesBuilder;
 import org.apache.camel.builder.AdviceWithRouteBuilder;
diff --git a/components/camel-test/src/test/java/org/apache/camel/test/patterns/UseOverridePropertiesWithPropertiesComponentTest.java b/components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/UseOverridePropertiesWithPropertiesComponentTest.java
similarity index 98%
rename from components/camel-test/src/test/java/org/apache/camel/test/patterns/UseOverridePropertiesWithPropertiesComponentTest.java
rename to components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/UseOverridePropertiesWithPropertiesComponentTest.java
index fbcba31..ac72996 100644
--- a/components/camel-test/src/test/java/org/apache/camel/test/patterns/UseOverridePropertiesWithPropertiesComponentTest.java
+++ b/components/camel-test/src/test/java/org/apache/camel/test/junit4/patterns/UseOverridePropertiesWithPropertiesComponentTest.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.test.patterns;
+package org.apache.camel.test.junit4.patterns;
 
 import java.util.Properties;
 


[camel] 02/09: CAMEL-13342: Setup SimpleMockTest with junit extension and parameter resolver

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

aldettinger pushed a commit to branch CAMEL-13342-JUNIT5-EXPLORATORY
in repository https://gitbox.apache.org/repos/asf/camel.git

commit cff1122f6ec22bea4e1fef61deec7a404c14759c
Author: aldettinger <al...@gmail.com>
AuthorDate: Wed Jun 5 16:50:19 2019 +0200

    CAMEL-13342: Setup SimpleMockTest with junit extension and parameter resolver
---
 components/camel-test/pom.xml                      | 12 +++-
 .../org/apache/camel/test/junit5/CamelTest.java    |  4 ++
 .../camel/test/junit5/CamelTestExtension.java      | 82 ++++++++++++++++++++++
 .../test/junit5/CamelTestParameterResolver.java    | 39 ++++++++++
 .../apache/camel/test/junit5/SimpleMockTest.java   | 53 ++++++++++++++
 5 files changed, 189 insertions(+), 1 deletion(-)

diff --git a/components/camel-test/pom.xml b/components/camel-test/pom.xml
index c3485f4..ebe758a 100644
--- a/components/camel-test/pom.xml
+++ b/components/camel-test/pom.xml
@@ -57,7 +57,17 @@
         <dependency>
             <groupId>org.junit.jupiter</groupId>
             <artifactId>junit-jupiter-api</artifactId>
-            <version>5.5.0-M1</version>
+            <version>5.4.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.junit.jupiter</groupId>
+            <artifactId>junit-jupiter-engine</artifactId>
+            <version>5.4.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.junit.vintage</groupId>
+            <artifactId>junit-vintage-engine</artifactId>
+            <version>5.4.2</version>
         </dependency>
 
         <dependency>
diff --git a/components/camel-test/src/main/java/org/apache/camel/test/junit5/CamelTest.java b/components/camel-test/src/main/java/org/apache/camel/test/junit5/CamelTest.java
index 05ed250..2732d2a 100644
--- a/components/camel-test/src/main/java/org/apache/camel/test/junit5/CamelTest.java
+++ b/components/camel-test/src/main/java/org/apache/camel/test/junit5/CamelTest.java
@@ -21,8 +21,12 @@ import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
 import java.lang.annotation.Target;
 
+import org.junit.jupiter.api.extension.ExtendWith;
+
 @Target({ElementType.TYPE})
 @Retention(RetentionPolicy.RUNTIME)
+@ExtendWith(CamelTestExtension.class)
+@ExtendWith(CamelTestParameterResolver.class)
 public @interface CamelTest {
 
 }
diff --git a/components/camel-test/src/main/java/org/apache/camel/test/junit5/CamelTestExtension.java b/components/camel-test/src/main/java/org/apache/camel/test/junit5/CamelTestExtension.java
new file mode 100644
index 0000000..3e26d80
--- /dev/null
+++ b/components/camel-test/src/main/java/org/apache/camel/test/junit5/CamelTestExtension.java
@@ -0,0 +1,82 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5;
+
+import java.lang.reflect.Method;
+import java.util.Optional;
+
+import org.apache.camel.ConsumerTemplate;
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.RoutesBuilder;
+import org.apache.camel.impl.DefaultCamelContext;
+import org.apache.camel.impl.engine.DefaultCamelBeanPostProcessor;
+import org.apache.camel.model.ModelCamelContext;
+import org.junit.jupiter.api.extension.AfterEachCallback;
+import org.junit.jupiter.api.extension.BeforeEachCallback;
+import org.junit.jupiter.api.extension.ExtensionContext;
+import org.junit.jupiter.api.extension.ExtensionContext.Namespace;
+import org.junit.platform.commons.util.ReflectionUtils;
+
+public class CamelTestExtension implements BeforeEachCallback, AfterEachCallback {
+
+    private ModelCamelContext context;
+    private ProducerTemplate producerTemplate;
+    private ConsumerTemplate consumerTemplate;
+
+    @Override
+    public void afterEach(ExtensionContext eCtx) throws Exception {
+        if (producerTemplate != null) {
+            producerTemplate.stop();
+        }
+        if (consumerTemplate != null) {
+            consumerTemplate.stop();
+        }
+        if (context != null) {
+            context.stop();
+        }
+    }
+
+    @Override
+    public void beforeEach(ExtensionContext eCtx) throws Exception {
+        context = new DefaultCamelContext();
+
+        Optional<Method> method = ReflectionUtils.findMethod(eCtx.getTestClass().get(), "createRouteBuilder");
+
+        Object ret = ReflectionUtils.invokeMethod(method.get(), eCtx.getTestInstance().get());
+        if (ret instanceof RoutesBuilder) {
+            ((RoutesBuilder)ret).addRoutesToCamelContext(context);
+        }
+        producerTemplate = context.createProducerTemplate();
+        consumerTemplate = context.createConsumerTemplate();
+
+        DefaultCamelBeanPostProcessor processor = new DefaultCamelBeanPostProcessor(context);
+        processor.postProcessBeforeInitialization(this, getClass().getName());
+        processor.postProcessAfterInitialization(this, getClass().getName());
+
+        context.start();
+        producerTemplate.start();
+        consumerTemplate.start();
+
+        // @TODO: Do we really use a namespace with key
+        // CamelTestParameterResolver.class
+        // We may reuse those values in test also
+        eCtx.getStore(Namespace.create(CamelTestParameterResolver.class)).put(ModelCamelContext.class, context);
+        eCtx.getStore(Namespace.create(CamelTestParameterResolver.class)).put(ProducerTemplate.class, producerTemplate);
+        eCtx.getStore(Namespace.create(CamelTestParameterResolver.class)).put(ConsumerTemplate.class, consumerTemplate);
+    }
+
+}
diff --git a/components/camel-test/src/main/java/org/apache/camel/test/junit5/CamelTestParameterResolver.java b/components/camel-test/src/main/java/org/apache/camel/test/junit5/CamelTestParameterResolver.java
new file mode 100644
index 0000000..ce58940
--- /dev/null
+++ b/components/camel-test/src/main/java/org/apache/camel/test/junit5/CamelTestParameterResolver.java
@@ -0,0 +1,39 @@
+package org.apache.camel.test.junit5;
+
+import org.apache.camel.ConsumerTemplate;
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.model.ModelCamelContext;
+import org.junit.jupiter.api.extension.ExtensionContext;
+import org.junit.jupiter.api.extension.ExtensionContext.Namespace;
+import org.junit.jupiter.api.extension.ParameterContext;
+import org.junit.jupiter.api.extension.ParameterResolutionException;
+import org.junit.jupiter.api.extension.ParameterResolver;
+
+// @TODO: Is it really the same treatment for all types ?
+// @TODO: Can't we get more than one object of type ProducerTemplate ? like threadTemplate ?
+public class CamelTestParameterResolver implements ParameterResolver {
+
+    @Override
+    public boolean supportsParameter(ParameterContext parameterContext, ExtensionContext extensionContext) throws ParameterResolutionException {
+        // @TODO: clearer is better
+        Class<?> paramClass = parameterContext.getParameter().getType();
+        return paramClass == ProducerTemplate.class || paramClass == ConsumerTemplate.class || paramClass == ModelCamelContext.class;
+    }
+
+    @Override
+    public Object resolveParameter(ParameterContext parameterContext, ExtensionContext extensionContext) throws ParameterResolutionException {
+        final Class<?> paramClass = parameterContext.getParameter().getType();
+        if (paramClass == ProducerTemplate.class) {
+            // @TODO: Is it safe to use class as store keys
+            return extensionContext.getStore(Namespace.create(CamelTestParameterResolver.class)).get(ProducerTemplate.class);
+        } else if (paramClass == ConsumerTemplate.class) {
+            // @TODO: Is it safe to use class as store keys
+            return extensionContext.getStore(Namespace.create(CamelTestParameterResolver.class)).get(ConsumerTemplate.class);
+        } else if (paramClass == ModelCamelContext.class) {
+            // @TODO: Is it safe to use class as store keys
+            return extensionContext.getStore(Namespace.create(CamelTestParameterResolver.class)).get(ModelCamelContext.class);
+        }
+        final String msgFormat = "Test %s can't receive a parameter of type %s. Expecting Context, ProduderTempate or ConsumerTemplate}";
+        throw new ParameterResolutionException(String.format(msgFormat, extensionContext.getDisplayName(), paramClass.getName()));
+    }
+}
diff --git a/components/camel-test/src/test/java/org/apache/camel/test/junit5/SimpleMockTest.java b/components/camel-test/src/test/java/org/apache/camel/test/junit5/SimpleMockTest.java
new file mode 100644
index 0000000..33987ac
--- /dev/null
+++ b/components/camel-test/src/test/java/org/apache/camel/test/junit5/SimpleMockTest.java
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.junit5;
+
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.RoutesBuilder;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.model.ModelCamelContext;
+import org.junit.jupiter.api.Test;
+
+@CamelTest
+public class SimpleMockTest {
+
+    @Test
+    public void testMock(ProducerTemplate template, ModelCamelContext ctx) throws Exception {
+        MockEndpoint mockResult = ctx.getEndpoint("mock:result", MockEndpoint.class);
+        mockResult.expectedBodiesReceived("Hello World");
+        template.sendBody("direct:start", "Hello World");
+        MockEndpoint.assertIsSatisfied(ctx);
+    }
+
+    /* Same test is shorter with junit4
+    @Test
+    public void testMock() throws Exception {
+        getMockEndpoint("mock:result").expectedBodiesReceived("Hello World");
+        template.sendBody("direct:start", "Hello World");
+        assertMockEndpointsSatisfied();
+    }*/
+
+    protected RoutesBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+                from("direct:start").to("mock:result");
+            }
+        };
+    }
+}


[camel] 04/09: CAMEL-13342: Implemented a first version of a proof-of-concept for camel-cdi-test in junit 5

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

aldettinger pushed a commit to branch CAMEL-13342-JUNIT5-EXPLORATORY
in repository https://gitbox.apache.org/repos/asf/camel.git

commit fdecc42f8278b2f27fc64c29e1be0a6f03b28789
Author: aldettinger <al...@gmail.com>
AuthorDate: Wed Jun 26 19:10:13 2019 +0200

    CAMEL-13342: Implemented a first version of a proof-of-concept for camel-cdi-test in junit 5
---
 components/camel-test-cdi/pom.xml                  | 15 +++++
 .../apache/camel/test/cdi/junit5/AnyLiteral.java   | 30 +++++++++
 .../test/cdi/junit5/CamelCdiJUnit5Extension.java   | 71 ++++++++++++++++++++
 .../cdi/junit5/CamelCdiJUnit5ExtensionStore.java   | 52 +++++++++++++++
 .../apache/camel/test/cdi/junit5/CamelCdiTest.java | 31 +++++++++
 .../apache/camel/test/cdi/junit5/FilterTest.java   | 75 ++++++++++++++++++++++
 6 files changed, 274 insertions(+)

diff --git a/components/camel-test-cdi/pom.xml b/components/camel-test-cdi/pom.xml
index 7cc65da..bb4db09 100644
--- a/components/camel-test-cdi/pom.xml
+++ b/components/camel-test-cdi/pom.xml
@@ -57,6 +57,21 @@
             <artifactId>weld-se-core</artifactId>
             <version>${weld3-version}</version>
         </dependency>
+        <dependency>
+            <groupId>org.junit.jupiter</groupId>
+            <artifactId>junit-jupiter-api</artifactId>
+            <version>5.4.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.junit.jupiter</groupId>
+            <artifactId>junit-jupiter-engine</artifactId>
+            <version>5.4.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.junit.vintage</groupId>
+            <artifactId>junit-vintage-engine</artifactId>
+            <version>5.4.2</version>
+        </dependency>
 
         <!-- test dependencies -->
         <dependency>
diff --git a/components/camel-test-cdi/src/main/java/org/apache/camel/test/cdi/junit5/AnyLiteral.java b/components/camel-test-cdi/src/main/java/org/apache/camel/test/cdi/junit5/AnyLiteral.java
new file mode 100644
index 0000000..b71ecd3
--- /dev/null
+++ b/components/camel-test-cdi/src/main/java/org/apache/camel/test/cdi/junit5/AnyLiteral.java
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.cdi.junit5;
+
+import javax.enterprise.inject.Any;
+import javax.enterprise.util.AnnotationLiteral;
+
+final class AnyLiteral extends AnnotationLiteral<Any> implements Any {
+
+    static final Any INSTANCE = new AnyLiteral();
+
+    private static final long serialVersionUID = 1L;
+
+    private AnyLiteral() {
+    }
+}
diff --git a/components/camel-test-cdi/src/main/java/org/apache/camel/test/cdi/junit5/CamelCdiJUnit5Extension.java b/components/camel-test-cdi/src/main/java/org/apache/camel/test/cdi/junit5/CamelCdiJUnit5Extension.java
new file mode 100644
index 0000000..0da533c
--- /dev/null
+++ b/components/camel-test-cdi/src/main/java/org/apache/camel/test/cdi/junit5/CamelCdiJUnit5Extension.java
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.cdi.junit5;
+
+import java.util.Set;
+
+import javax.enterprise.inject.spi.Bean;
+import javax.enterprise.inject.spi.BeanManager;
+
+import org.apache.camel.cdi.CdiCamelExtension;
+import org.jboss.weld.config.ConfigurationKey;
+import org.jboss.weld.environment.se.Weld;
+import org.jboss.weld.environment.se.WeldContainer;
+import org.junit.jupiter.api.extension.AfterEachCallback;
+import org.junit.jupiter.api.extension.BeforeAllCallback;
+import org.junit.jupiter.api.extension.ExtensionContext;
+import org.junit.jupiter.api.extension.TestInstanceFactory;
+import org.junit.jupiter.api.extension.TestInstanceFactoryContext;
+import org.junit.jupiter.api.extension.TestInstantiationException;
+
+import static org.apache.camel.test.cdi.junit5.CamelCdiJUnit5ExtensionStore.getWeldBuilderFromStore;
+import static org.apache.camel.test.cdi.junit5.CamelCdiJUnit5ExtensionStore.getWeldContainerFromStore;
+import static org.apache.camel.test.cdi.junit5.CamelCdiJUnit5ExtensionStore.putWeldBuilderInStore;
+import static org.apache.camel.test.cdi.junit5.CamelCdiJUnit5ExtensionStore.putWeldContainerInStore;
+
+public class CamelCdiJUnit5Extension implements BeforeAllCallback, AfterEachCallback, TestInstanceFactory {
+
+    @Override
+    public void beforeAll(ExtensionContext eCtx) throws Exception {
+        Class<?> testClass = eCtx.getRequiredTestClass();
+        Weld weld = new Weld()
+            // TODO: check parallel execution
+            .containerId("camel-context-cdi").property(ConfigurationKey.RELAXED_CONSTRUCTION.get(), true).property(Weld.SHUTDOWN_HOOK_SYSTEM_PROPERTY, false).enableDiscovery()
+            .beanClasses(testClass.getDeclaredClasses()).addBeanClass(testClass).addExtension(new CdiCamelExtension());
+
+        putWeldBuilderInStore(eCtx, weld);
+    }
+
+    @Override
+    public void afterEach(ExtensionContext eCtx) throws Exception {
+        WeldContainer container = getWeldContainerFromStore(eCtx, eCtx.getRequiredTestInstance());
+        container.shutdown();
+    }
+
+    @Override
+    public Object createTestInstance(TestInstanceFactoryContext factoryContext, ExtensionContext eCtx) throws TestInstantiationException {
+        WeldContainer container = getWeldBuilderFromStore(eCtx).initialize();
+        BeanManager manager = container.getBeanManager();
+        Set<Bean<?>> beans = manager.getBeans(eCtx.getRequiredTestClass(), AnyLiteral.INSTANCE);
+        Bean<?> bean = beans.iterator().next();
+        Object testInstance = manager.getReference(bean, bean.getBeanClass(), manager.createCreationalContext(bean));
+
+        putWeldContainerInStore(eCtx, testInstance, container);
+
+        return testInstance;
+    }
+}
diff --git a/components/camel-test-cdi/src/main/java/org/apache/camel/test/cdi/junit5/CamelCdiJUnit5ExtensionStore.java b/components/camel-test-cdi/src/main/java/org/apache/camel/test/cdi/junit5/CamelCdiJUnit5ExtensionStore.java
new file mode 100644
index 0000000..9f0c8ad
--- /dev/null
+++ b/components/camel-test-cdi/src/main/java/org/apache/camel/test/cdi/junit5/CamelCdiJUnit5ExtensionStore.java
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.cdi.junit5;
+
+import org.jboss.weld.environment.se.Weld;
+import org.jboss.weld.environment.se.WeldContainer;
+import org.junit.jupiter.api.extension.ExtensionContext;
+import org.junit.jupiter.api.extension.ExtensionContext.Namespace;
+
+public final class CamelCdiJUnit5ExtensionStore {
+
+    private static final String TEST_CLASS_WELD_BUILDER_STORE_KEY = "TEST_CLASS_WELD_BUILDER_STORE_KEY";
+    private static final String TEST_INSTANCE_WELD_CONTAINER_STORE_KEY = "TEST_INSTANCE_WELD_CONTAINER_STORE_KEY";
+
+    private CamelCdiJUnit5ExtensionStore() {
+    }
+
+    static void putWeldBuilderInStore(ExtensionContext eCtx, Weld weld) {
+        Namespace ns = Namespace.create(CamelCdiJUnit5ExtensionStore.class, eCtx.getRequiredTestClass());
+        eCtx.getStore(ns).put(TEST_CLASS_WELD_BUILDER_STORE_KEY, weld);
+    }
+
+    static Weld getWeldBuilderFromStore(ExtensionContext eCtx) {
+        Namespace ns = Namespace.create(CamelCdiJUnit5ExtensionStore.class, eCtx.getRequiredTestClass());
+        return eCtx.getStore(ns).get(TEST_CLASS_WELD_BUILDER_STORE_KEY, Weld.class);
+    }
+
+    static void putWeldContainerInStore(ExtensionContext eCtx, Object testInstance, WeldContainer container) {
+        Namespace ns = Namespace.create(CamelCdiJUnit5ExtensionStore.class, testInstance);
+        eCtx.getStore(ns).put(TEST_INSTANCE_WELD_CONTAINER_STORE_KEY, container);
+    }
+
+    static WeldContainer getWeldContainerFromStore(ExtensionContext eCtx, Object testInstance) {
+        Namespace ns = Namespace.create(CamelCdiJUnit5ExtensionStore.class, testInstance);
+        return eCtx.getStore(ns).get(TEST_INSTANCE_WELD_CONTAINER_STORE_KEY, WeldContainer.class);
+    }
+
+}
diff --git a/components/camel-test-cdi/src/main/java/org/apache/camel/test/cdi/junit5/CamelCdiTest.java b/components/camel-test-cdi/src/main/java/org/apache/camel/test/cdi/junit5/CamelCdiTest.java
new file mode 100644
index 0000000..b1f3fee
--- /dev/null
+++ b/components/camel-test-cdi/src/main/java/org/apache/camel/test/cdi/junit5/CamelCdiTest.java
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.cdi.junit5;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import org.junit.jupiter.api.extension.ExtendWith;
+
+@Target({ElementType.TYPE})
+@Retention(RetentionPolicy.RUNTIME)
+@ExtendWith(CamelCdiJUnit5Extension.class)
+public @interface CamelCdiTest {
+
+}
diff --git a/components/camel-test-cdi/src/test/java/org/apache/camel/test/cdi/junit5/FilterTest.java b/components/camel-test-cdi/src/test/java/org/apache/camel/test/cdi/junit5/FilterTest.java
new file mode 100644
index 0000000..e7fe510
--- /dev/null
+++ b/components/camel-test-cdi/src/test/java/org/apache/camel/test/cdi/junit5/FilterTest.java
@@ -0,0 +1,75 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.cdi.junit5;
+
+import org.apache.camel.EndpointInject;
+import org.apache.camel.Produce;
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.TestInfo;
+
+@CamelCdiTest
+public class FilterTest {
+
+    @EndpointInject("mock:result")
+    protected MockEndpoint resultEndpoint;
+
+    @Produce("direct:start")
+    protected ProducerTemplate template;
+
+    @BeforeEach
+    public void before() {
+        resultEndpoint.reset();
+    }
+
+    @Test
+    public void testSendMatchingMessage() throws Exception {
+        String expectedBody = "<matched/>";
+
+        resultEndpoint.expectedBodiesReceived(expectedBody);
+
+        template.sendBodyAndHeader(expectedBody, "foo", "bar");
+
+        resultEndpoint.assertIsSatisfied();
+    }
+
+    @Test
+    public void testSendNotMatchingMessage() throws Exception {
+        resultEndpoint.expectedMessageCount(0);
+
+        template.sendBodyAndHeader("<notMatched/>", "foo", "notMatchedHeaderValue");
+
+        resultEndpoint.assertIsSatisfied();
+    }
+
+    @Test
+    public void testInfoParamShouldBeResolved(TestInfo testInfo) throws Exception {
+        Assertions.assertNotNull(testInfo);
+    }
+
+    static class ContextConfig extends RouteBuilder {
+
+        @Override
+        public void configure() {
+            from("direct:start").filter(header("foo").isEqualTo("bar")).to("mock:result");
+        }
+    }
+}


[camel] 07/09: CAMEL-13342: Moved further the proof-of-concept for camel-test-spring/CamelSpringTestSupport

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

aldettinger pushed a commit to branch CAMEL-13342-JUNIT5-EXPLORATORY
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 443c637c235b8d66b5b8f972f077b593f9c8fef5
Author: aldettinger <al...@gmail.com>
AuthorDate: Tue Jul 16 18:04:00 2019 +0200

    CAMEL-13342: Moved further the proof-of-concept for camel-test-spring/CamelSpringTestSupport
---
 components/camel-csv/pom.xml                       |  12 +-
 .../csv/CsvDataFormatCustomFactoryTest.java        |  12 +-
 .../CsvDataFormatCustomRecordConverterTest.java    |   7 +-
 .../csv/CsvDataFormatResourceFactoryTest.java      |  12 +-
 .../camel/dataformat/csv/CsvDataFormatTest.java    |  16 +--
 ...svMarshalAutogenColumnsSpringQuoteModeTest.java |   6 +-
 .../csv/CsvMarshalAutogenColumnsSpringTest.java    |   6 +-
 .../dataformat/csv/CsvMarshalCharsetTest.java      |   5 +-
 .../camel/dataformat/csv/CsvMarshalHeaderTest.java |  16 +--
 ...MarshalHeaderWithCustomMarshallFactoryTest.java |  16 +--
 .../csv/CsvMarshalPipeDelimiterSpringTest.java     |   6 +-
 .../csv/CsvMarshalPipeDelimiterTest.java           |   6 +-
 .../camel/dataformat/csv/CsvMarshalTest.java       |   6 +-
 .../dataformat/csv/CsvRecordConvertersTest.java    |  10 +-
 .../camel/dataformat/csv/CsvRouteCharsetTest.java  |   6 +-
 .../apache/camel/dataformat/csv/CsvRouteTest.java  |  29 +++--
 .../csv/CsvUnmarshalMapLineSpringTest.java         |   6 +-
 .../csv/CsvUnmarshalPipeDelimiterSpringTest.java   |   6 +-
 .../csv/CsvUnmarshalPipeDelimiterTest.java         |   6 +-
 .../csv/CsvUnmarshalSkipFirstLineSpringTest.java   |   6 +-
 .../csv/CsvUnmarshalStreamSpringTest.java          |   6 +-
 .../dataformat/csv/CsvUnmarshalStreamTest.java     |   6 +-
 .../csv/CsvUnmarshalTabDelimiterSpringTest.java    |   6 +-
 .../csv/CsvUnmarshalTabDelimiterTest.java          |   6 +-
 .../camel/dataformat/csv/CsvUnmarshalTest.java     |   5 +-
 ...CsvUnmarshalTwoCsvDataFormatConcurrentTest.java |   6 +-
 .../spring/CamelSpringBootJUnit4ClassRunner.java   |  33 -----
 .../CamelSpringDelegatingTestContextLoader.java    | 138 ---------------------
 .../spring/CamelSpringTestContextLoader.java       |   1 -
 .../test/junit5/spring/CamelSpringTestSupport.java |   1 -
 .../junit5/spring/RouteCoverageEventNotifier.java  |   1 -
 ...nterceptSendToEndpointWithLoadbalancerTest.java |   4 +-
 .../test/issues/AdviceWithOnCompletionTest.java    |   4 +-
 .../AdviceWithOnExceptionMultipleIssueTest.java    |   4 +-
 .../test/issues/MockEndpointsAndSkipTest.java      |   4 +-
 35 files changed, 146 insertions(+), 274 deletions(-)

diff --git a/components/camel-csv/pom.xml b/components/camel-csv/pom.xml
index 05f2a94..ffd4ece 100644
--- a/components/camel-csv/pom.xml
+++ b/components/camel-csv/pom.xml
@@ -55,6 +55,13 @@
         <dependency>
             <groupId>org.apache.camel</groupId>
             <artifactId>camel-test-spring</artifactId>
+            <exclusions>
+                <!-- proof that junit is no more needed once tests have been migrated -->
+                <exclusion>
+                    <groupId>junit</groupId>
+                    <artifactId>junit</artifactId>
+                </exclusion>
+            </exclusions>
             <scope>test</scope>
         </dependency>
         <dependency>
@@ -73,8 +80,9 @@
             <scope>test</scope>
         </dependency>
         <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
+            <groupId>org.hamcrest</groupId>
+            <artifactId>hamcrest-core</artifactId>
+            <version>2.1</version>
             <scope>test</scope>
         </dependency>
     </dependencies>
diff --git a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvDataFormatCustomFactoryTest.java b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvDataFormatCustomFactoryTest.java
index 89c29eb..733deea 100644
--- a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvDataFormatCustomFactoryTest.java
+++ b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvDataFormatCustomFactoryTest.java
@@ -20,9 +20,9 @@ import java.util.Arrays;
 import java.util.List;
 
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.spring.CamelSpringTestSupport;
-import org.junit.Assert;
-import org.junit.Test;
+import org.apache.camel.test.junit5.spring.CamelSpringTestSupport;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 
 public class CsvDataFormatCustomFactoryTest extends CamelSpringTestSupport {
@@ -38,9 +38,9 @@ public class CsvDataFormatCustomFactoryTest extends CamelSpringTestSupport {
         String body = mock.getReceivedExchanges().get(0).getIn().getBody(String.class);
         String[] lines = body.split("\r\n");
 
-        Assert.assertEquals(2, lines.length);
-        Assert.assertEquals("A1:B1:C1", lines[0].trim());
-        Assert.assertEquals("A2:B2:C2", lines[1].trim());
+        Assertions.assertEquals(2, lines.length);
+        Assertions.assertEquals("A1:B1:C1", lines[0].trim());
+        Assertions.assertEquals("A2:B2:C2", lines[1].trim());
     }
 
     private List<List<String>> getData() {
diff --git a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvDataFormatCustomRecordConverterTest.java b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvDataFormatCustomRecordConverterTest.java
index 5c80dde..3874828 100644
--- a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvDataFormatCustomRecordConverterTest.java
+++ b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvDataFormatCustomRecordConverterTest.java
@@ -22,11 +22,14 @@ import java.util.stream.Stream;
 
 import org.apache.camel.Message;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.spring.CamelSpringTestSupport;
+import org.apache.camel.test.junit5.spring.CamelSpringTestSupport;
 import org.apache.camel.util.CastUtils;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+
 /**
  * Test cases for {@link CsvRecordConverter}.
  */
diff --git a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvDataFormatResourceFactoryTest.java b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvDataFormatResourceFactoryTest.java
index c0cce86..0eea8f3 100644
--- a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvDataFormatResourceFactoryTest.java
+++ b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvDataFormatResourceFactoryTest.java
@@ -20,9 +20,9 @@ import java.util.Arrays;
 import java.util.List;
 
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.spring.CamelSpringTestSupport;
-import org.junit.Assert;
-import org.junit.Test;
+import org.apache.camel.test.junit5.spring.CamelSpringTestSupport;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 
 public class CsvDataFormatResourceFactoryTest extends CamelSpringTestSupport {
@@ -38,9 +38,9 @@ public class CsvDataFormatResourceFactoryTest extends CamelSpringTestSupport {
         String body = mock.getReceivedExchanges().get(0).getIn().getBody(String.class);
         String[] lines = body.split("\r\n");
 
-        Assert.assertEquals(2, lines.length);
-        Assert.assertEquals("A1,B1,C1", lines[0].trim());
-        Assert.assertEquals("A2,B2,C2", lines[1].trim());
+        Assertions.assertEquals(2, lines.length);
+        Assertions.assertEquals("A1,B1,C1", lines[0].trim());
+        Assertions.assertEquals("A2,B2,C2", lines[1].trim());
     }
 
     private List<List<String>> getData() {
diff --git a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvDataFormatTest.java b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvDataFormatTest.java
index 3312a72..bf42048 100644
--- a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvDataFormatTest.java
+++ b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvDataFormatTest.java
@@ -19,14 +19,14 @@ package org.apache.camel.dataformat.csv;
 import org.apache.commons.csv.CSVFormat;
 import org.apache.commons.csv.CSVRecord;
 import org.apache.commons.csv.QuoteMode;
-import org.junit.Test;
-
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertArrayEquals;
+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.assertSame;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 /**
  * This class tests the creation of the proper {@link org.apache.commons.csv.CSVFormat} based on the properties of
diff --git a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalAutogenColumnsSpringQuoteModeTest.java b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalAutogenColumnsSpringQuoteModeTest.java
index 0207696..07d6486 100644
--- a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalAutogenColumnsSpringQuoteModeTest.java
+++ b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalAutogenColumnsSpringQuoteModeTest.java
@@ -23,10 +23,12 @@ import java.util.Map;
 
 import org.apache.camel.EndpointInject;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.spring.CamelSpringTestSupport;
-import org.junit.Test;
+import org.apache.camel.test.junit5.spring.CamelSpringTestSupport;
+import org.junit.jupiter.api.Test;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
 /**
  * Spring based integration test for the <code>CsvDataFormat</code> demonstrating the usage of
  * the <tt>autogenColumns</tt>, <tt>configRef</tt> and <tt>strategyRef</tt> options.
diff --git a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalAutogenColumnsSpringTest.java b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalAutogenColumnsSpringTest.java
index e7f870a..de0000e 100644
--- a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalAutogenColumnsSpringTest.java
+++ b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalAutogenColumnsSpringTest.java
@@ -23,10 +23,12 @@ import java.util.Map;
 
 import org.apache.camel.EndpointInject;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.spring.CamelSpringTestSupport;
-import org.junit.Test;
+import org.apache.camel.test.junit5.spring.CamelSpringTestSupport;
+import org.junit.jupiter.api.Test;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
 /**
  * Spring based integration test for the <code>CsvDataFormat</code> demonstrating the usage of
  * the <tt>autogenColumns</tt>, <tt>configRef</tt> and <tt>strategyRef</tt> options.
diff --git a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalCharsetTest.java b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalCharsetTest.java
index 1e4a87e..871534c 100644
--- a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalCharsetTest.java
+++ b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalCharsetTest.java
@@ -22,9 +22,10 @@ import java.util.List;
 import org.apache.camel.Exchange;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
-import org.junit.Test;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.Test;
 
+import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.core.StringStartsWith.startsWith;
 
 public class CsvMarshalCharsetTest extends CamelTestSupport {
diff --git a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalHeaderTest.java b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalHeaderTest.java
index a5a4e92..04d60c2 100644
--- a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalHeaderTest.java
+++ b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalHeaderTest.java
@@ -19,6 +19,7 @@ package org.apache.camel.dataformat.csv;
 import java.io.File;
 import java.io.IOException;
 import java.nio.file.Files;
+import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.util.Arrays;
 import java.util.Collections;
@@ -32,18 +33,19 @@ import org.apache.camel.Produce;
 import org.apache.camel.ProducerTemplate;
 import org.apache.camel.RoutesBuilder;
 import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.test.junit4.CamelTestSupport;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.TemporaryFolder;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.io.TempDir;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 /**
  * <b>Camel</b> based test cases for {@link org.apache.camel.dataformat.csv.CsvDataFormat}.
  */
 public class CsvMarshalHeaderTest extends CamelTestSupport {
 
-    @Rule
-    public TemporaryFolder folder = new TemporaryFolder();
+    @TempDir
+    public Path folder;
 
     @Produce("direct:start")
     private ProducerTemplate producerTemplate;
@@ -52,7 +54,7 @@ public class CsvMarshalHeaderTest extends CamelTestSupport {
 
     @Override
     protected void doPreSetup() throws Exception {
-        outputFile = new File(folder.newFolder(), "output.csv");
+        outputFile = new File(folder.toFile(), "output.csv");
     }
 
     @Test
diff --git a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalHeaderWithCustomMarshallFactoryTest.java b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalHeaderWithCustomMarshallFactoryTest.java
index a632fce..18e1fad 100644
--- a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalHeaderWithCustomMarshallFactoryTest.java
+++ b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalHeaderWithCustomMarshallFactoryTest.java
@@ -20,6 +20,7 @@ import java.io.File;
 import java.io.IOException;
 import java.io.OutputStream;
 import java.nio.file.Files;
+import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -36,20 +37,21 @@ import org.apache.camel.RoutesBuilder;
 import org.apache.camel.RuntimeCamelException;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.support.ObjectHelper;
-import org.apache.camel.test.junit4.CamelTestSupport;
+import org.apache.camel.test.junit5.CamelTestSupport;
 import org.apache.commons.csv.CSVFormat;
 import org.apache.commons.csv.CSVPrinter;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.TemporaryFolder;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.io.TempDir;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 /**
  * <b>Camel</b> based test cases for {@link CsvDataFormat}.
  */
 public class CsvMarshalHeaderWithCustomMarshallFactoryTest extends CamelTestSupport {
 
-    @Rule
-    public TemporaryFolder folder = new TemporaryFolder();
+    @TempDir
+    public Path folder;
 
     @Produce("direct:start")
     private ProducerTemplate producerTemplate;
@@ -58,7 +60,7 @@ public class CsvMarshalHeaderWithCustomMarshallFactoryTest extends CamelTestSupp
 
     @Override
     protected void doPreSetup() throws Exception {
-        outputFile = new File(folder.newFolder(), "output.csv");
+        outputFile = new File(folder.toFile(), "output.csv");
     }
 
     @Test
diff --git a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalPipeDelimiterSpringTest.java b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalPipeDelimiterSpringTest.java
index 70204d8..449dd13 100644
--- a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalPipeDelimiterSpringTest.java
+++ b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalPipeDelimiterSpringTest.java
@@ -23,10 +23,12 @@ import java.util.Map;
 
 import org.apache.camel.EndpointInject;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.spring.CamelSpringTestSupport;
-import org.junit.Test;
+import org.apache.camel.test.junit5.spring.CamelSpringTestSupport;
+import org.junit.jupiter.api.Test;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
 /**
  * Spring based integration test for the <code>CsvDataFormat</code>
  */
diff --git a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalPipeDelimiterTest.java b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalPipeDelimiterTest.java
index 31f6015..5e75410 100644
--- a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalPipeDelimiterTest.java
+++ b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalPipeDelimiterTest.java
@@ -24,8 +24,10 @@ import java.util.Map;
 import org.apache.camel.EndpointInject;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
-import org.junit.Test;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 public class CsvMarshalPipeDelimiterTest extends CamelTestSupport {
 
diff --git a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalTest.java b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalTest.java
index 613bc49..f474d13 100644
--- a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalTest.java
+++ b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalTest.java
@@ -23,8 +23,10 @@ import java.util.Map;
 import org.apache.camel.EndpointInject;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
-import org.junit.Test;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertArrayEquals;
 
 /**
  * This class tests standard marshalling
diff --git a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvRecordConvertersTest.java b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvRecordConvertersTest.java
index 8b1d052..e7d385e 100644
--- a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvRecordConvertersTest.java
+++ b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvRecordConvertersTest.java
@@ -23,11 +23,11 @@ import java.util.Map;
 import org.apache.commons.csv.CSVFormat;
 import org.apache.commons.csv.CSVParser;
 import org.apache.commons.csv.CSVRecord;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
 /**
  * This class tests the common {@link CsvRecordConverter} implementations of
@@ -36,7 +36,7 @@ import static org.junit.Assert.assertNotNull;
 public class CsvRecordConvertersTest {
     private CSVRecord record;
 
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         CSVFormat format = CSVFormat.DEFAULT.withHeader("A", "B", "C");
         CSVParser parser = new CSVParser(new StringReader("1,2,3"), format);
diff --git a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvRouteCharsetTest.java b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvRouteCharsetTest.java
index 9551b8a..38de54b 100644
--- a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvRouteCharsetTest.java
+++ b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvRouteCharsetTest.java
@@ -21,8 +21,10 @@ import java.util.List;
 import org.apache.camel.Exchange;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
-import org.junit.Test;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 public class CsvRouteCharsetTest extends CamelTestSupport {
 
diff --git a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvRouteTest.java b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvRouteTest.java
index dcbaa22..f5c15f5 100644
--- a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvRouteTest.java
+++ b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvRouteTest.java
@@ -25,11 +25,15 @@ import org.apache.camel.Exchange;
 import org.apache.camel.Message;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
-import org.junit.Test;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
 public class CsvRouteTest extends CamelTestSupport {
     private static final Logger LOG = LoggerFactory.getLogger(CsvRouteTest.class);
 
@@ -52,12 +56,12 @@ public class CsvRouteTest extends CamelTestSupport {
             String text = in.getBody(String.class);
 
             log.debug("Received " + text);
-            assertNotNull("Should be able to convert received body to a string", text);
+            assertNotNull(text, "Should be able to convert received body to a string");
 
             // order is not guaranteed with a Map (which was passed in before)
             // so we need to check for both combinations
-            assertTrue("Text body has wrong value.", "abc,123".equals(text.trim())
-                    || "123,abc".equals(text.trim()));
+            assertTrue("abc,123".equals(text.trim())
+                    || "123,abc".equals(text.trim()), "Text body has wrong value.");
         }
     }
 
@@ -84,8 +88,7 @@ public class CsvRouteTest extends CamelTestSupport {
         String text1 = in1.getBody(String.class);
 
         log.debug("Received " + text1);
-        assertTrue("First CSV body has wrong value",
-                Pattern.matches("(abc,123)|(123,abc)", text1.trim()));
+        assertTrue(Pattern.matches("(abc,123)|(123,abc)", text1.trim()), "First CSV body has wrong value");
 
         Message in2 = list.get(1).getIn();
         String text2 = in2.getBody(String.class);
@@ -94,11 +97,9 @@ public class CsvRouteTest extends CamelTestSupport {
 
         // fields should keep the same order from one call to the other
         if (text1.trim().equals("abc,123")) {
-            assertEquals("Second CSV body has wrong value",
-                    "def,456,789", text2.trim());
+            assertEquals("def,456,789", text2.trim(), "Second CSV body has wrong value");
         } else {
-            assertEquals("Second CSV body has wrong value",
-                    "456,def,789", text2.trim());
+            assertEquals("456,def,789", text2.trim(), "Second CSV body has wrong value");
         }
     }
 
@@ -125,15 +126,13 @@ public class CsvRouteTest extends CamelTestSupport {
         String text1 = in1.getBody(String.class);
 
         log.debug("Received " + text1);
-        assertEquals("First CSV body has wrong value",
-                "abc;;123", text1.trim());
+        assertEquals("abc;;123", text1.trim(), "First CSV body has wrong value");
 
         Message in2 = list.get(1).getIn();
         String text2 = in2.getBody(String.class);
 
         log.debug("Received " + text2);
-        assertEquals("Second CSV body has wrong value",
-                "def;789;456", text2.trim());
+        assertEquals("def;789;456", text2.trim(), "Second CSV body has wrong value");
 
     }
 
diff --git a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalMapLineSpringTest.java b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalMapLineSpringTest.java
index c917e9a..19e3f70 100644
--- a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalMapLineSpringTest.java
+++ b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalMapLineSpringTest.java
@@ -21,10 +21,12 @@ import java.util.Map;
 
 import org.apache.camel.EndpointInject;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.spring.CamelSpringTestSupport;
-import org.junit.Test;
+import org.apache.camel.test.junit5.spring.CamelSpringTestSupport;
+import org.junit.jupiter.api.Test;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
 /**
  * Spring based test for the <code>CsvDataFormat</code> demonstrating the usage of
  * the <tt>useMaps</tt> option.
diff --git a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalPipeDelimiterSpringTest.java b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalPipeDelimiterSpringTest.java
index 1e3fe43..519e6a5 100644
--- a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalPipeDelimiterSpringTest.java
+++ b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalPipeDelimiterSpringTest.java
@@ -20,10 +20,12 @@ import java.util.List;
 
 import org.apache.camel.EndpointInject;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.spring.CamelSpringTestSupport;
-import org.junit.Test;
+import org.apache.camel.test.junit5.spring.CamelSpringTestSupport;
+import org.junit.jupiter.api.Test;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
 /**
  * Spring based integration test for the <code>CsvDataFormat</code>
  */
diff --git a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalPipeDelimiterTest.java b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalPipeDelimiterTest.java
index 9d32149..33a4653 100644
--- a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalPipeDelimiterTest.java
+++ b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalPipeDelimiterTest.java
@@ -21,8 +21,10 @@ import java.util.List;
 import org.apache.camel.EndpointInject;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
-import org.junit.Test;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 /**
  * Spring based integration test for the <code>CsvDataFormat</code>
diff --git a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalSkipFirstLineSpringTest.java b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalSkipFirstLineSpringTest.java
index 6cb9a32..bbbb8c7 100644
--- a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalSkipFirstLineSpringTest.java
+++ b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalSkipFirstLineSpringTest.java
@@ -20,10 +20,12 @@ import java.util.List;
 
 import org.apache.camel.EndpointInject;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.spring.CamelSpringTestSupport;
-import org.junit.Test;
+import org.apache.camel.test.junit5.spring.CamelSpringTestSupport;
+import org.junit.jupiter.api.Test;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
 /**
  * Spring based test for the <code>CsvDataFormat</code> demonstrating the usage of
  * the <tt>skipFirstLine</tt> option.
diff --git a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalStreamSpringTest.java b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalStreamSpringTest.java
index 05ee4e3..29fdd43 100644
--- a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalStreamSpringTest.java
+++ b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalStreamSpringTest.java
@@ -21,11 +21,13 @@ import java.util.List;
 
 import org.apache.camel.EndpointInject;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.spring.CamelSpringTestSupport;
-import org.junit.Test;
+import org.apache.camel.test.junit5.spring.CamelSpringTestSupport;
+import org.junit.jupiter.api.Test;
 import org.springframework.context.support.AbstractApplicationContext;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
 public class CsvUnmarshalStreamSpringTest extends CamelSpringTestSupport {
 
     private static final String CSV_SAMPLE = "A,B,C\r1,2,3\rone,two,three";
diff --git a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalStreamTest.java b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalStreamTest.java
index e476b7c..f745e66 100644
--- a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalStreamTest.java
+++ b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalStreamTest.java
@@ -25,8 +25,10 @@ import java.util.List;
 import org.apache.camel.EndpointInject;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
-import org.junit.Test;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 /**
  * Spring based integration test for the <code>CsvDataFormat</code>
diff --git a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalTabDelimiterSpringTest.java b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalTabDelimiterSpringTest.java
index 61de960..1e971fc 100644
--- a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalTabDelimiterSpringTest.java
+++ b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalTabDelimiterSpringTest.java
@@ -20,10 +20,12 @@ import java.util.List;
 
 import org.apache.camel.EndpointInject;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.spring.CamelSpringTestSupport;
-import org.junit.Test;
+import org.apache.camel.test.junit5.spring.CamelSpringTestSupport;
+import org.junit.jupiter.api.Test;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
 public class CsvUnmarshalTabDelimiterSpringTest extends CamelSpringTestSupport {
     @EndpointInject("mock:result")
     private MockEndpoint result;
diff --git a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalTabDelimiterTest.java b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalTabDelimiterTest.java
index 3f848f6..4ff804f 100644
--- a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalTabDelimiterTest.java
+++ b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalTabDelimiterTest.java
@@ -21,8 +21,10 @@ import java.util.List;
 import org.apache.camel.EndpointInject;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
-import org.junit.Test;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 public class CsvUnmarshalTabDelimiterTest extends CamelTestSupport {
 
diff --git a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalTest.java b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalTest.java
index 63616cb..d099c64 100644
--- a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalTest.java
+++ b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalTest.java
@@ -26,10 +26,11 @@ import java.util.Map;
 import org.apache.camel.EndpointInject;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
-import org.junit.Test;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.Test;
 
 import static org.apache.camel.dataformat.csv.TestUtils.asMap;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 /**
  * This class tests standard unmarshalling
diff --git a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalTwoCsvDataFormatConcurrentTest.java b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalTwoCsvDataFormatConcurrentTest.java
index 044cd41..6f45b74 100644
--- a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalTwoCsvDataFormatConcurrentTest.java
+++ b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalTwoCsvDataFormatConcurrentTest.java
@@ -21,8 +21,10 @@ import java.util.List;
 import org.apache.camel.EndpointInject;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
-import org.junit.Test;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 public class CsvUnmarshalTwoCsvDataFormatConcurrentTest extends CamelTestSupport {
 
diff --git a/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringBootJUnit4ClassRunner.java b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringBootJUnit4ClassRunner.java
deleted file mode 100644
index d96c903..0000000
--- a/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringBootJUnit4ClassRunner.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.test.junit5.spring;
-
-import org.junit.runners.model.InitializationError;
-
-/**
- * The class {@link CamelSpringBootJUnit4ClassRunner} has been renamed to {@link CamelSpringBootRunner}
- * which is a shorter and easier to remember name.
- *
- * @deprecated use {@link CamelSpringBootRunner}
- */
-@Deprecated
-public class CamelSpringBootJUnit4ClassRunner extends CamelSpringBootRunner {
-
-    public CamelSpringBootJUnit4ClassRunner(Class<?> clazz) throws InitializationError {
-        super(clazz);
-    }
-}
diff --git a/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringDelegatingTestContextLoader.java b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringDelegatingTestContextLoader.java
deleted file mode 100644
index ce486e5..0000000
--- a/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringDelegatingTestContextLoader.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.test.junit5.spring;
-
-import java.lang.reflect.Method;
-
-import org.apache.camel.api.management.JmxSystemPropertyKeys;
-import org.apache.camel.spring.SpringCamelContext;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.support.BeanDefinitionRegistry;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.ConfigurableApplicationContext;
-import org.springframework.context.annotation.AnnotationConfigUtils;
-import org.springframework.test.context.MergedContextConfiguration;
-import org.springframework.test.context.support.DelegatingSmartContextLoader;
-
-/**
- * CamelSpringDelegatingTestContextLoader which fixes issues in Camel's JavaConfigContextLoader. (adds support for Camel's test annotations)
- * <br>
- * <em>This loader can handle either classes or locations for configuring the context.</em>
- * <br>
- * NOTE: This TestContextLoader doesn't support the annotation of ExcludeRoutes now.
- *
- * @deprecated use {@link CamelSpringRunner} or {@link CamelSpringBootRunner} instead.
- */
-@Deprecated
-public class CamelSpringDelegatingTestContextLoader extends DelegatingSmartContextLoader {
-
-    protected final Logger logger = LoggerFactory.getLogger(getClass());
-
-    @Override
-    public ApplicationContext loadContext(MergedContextConfiguration mergedConfig) throws Exception {
-        
-        Class<?> testClass = getTestClass();
-        
-        if (logger.isDebugEnabled()) {
-            logger.debug("Loading ApplicationContext for merged context configuration [{}].", mergedConfig);
-        }
-        
-        // Pre CamelContext(s) instantiation setup
-        CamelAnnotationsHandler.handleDisableJmx(null, testClass);
-
-        try {
-            SpringCamelContext.setNoStart(true);
-            System.setProperty("skipStartingCamelContext", "true");
-            ConfigurableApplicationContext context = (ConfigurableApplicationContext) super.loadContext(mergedConfig);
-            SpringCamelContext.setNoStart(false);
-            System.clearProperty("skipStartingCamelContext");
-            return loadContext(context, testClass);
-        } finally {
-            cleanup(testClass);
-        }
-    }
-
-    /**
-     * Performs the bulk of the Spring application context loading/customization.
-     *
-     * @param context the partially configured context.  The context should have the bean definitions loaded, but nothing else.
-     * @param testClass the test class being executed
-     * @return the initialized (refreshed) Spring application context
-     *
-     * @throws Exception if there is an error during initialization/customization
-     */
-    public ApplicationContext loadContext(ConfigurableApplicationContext context, Class<?> testClass)
-        throws Exception {
-            
-        AnnotationConfigUtils.registerAnnotationConfigProcessors((BeanDefinitionRegistry) context);
-
-        // Post CamelContext(s) instantiation but pre CamelContext(s) start setup
-        CamelAnnotationsHandler.handleRouteCoverage(context, testClass, s -> getTestMethod().getName());
-        CamelAnnotationsHandler.handleProvidesBreakpoint(context, testClass);
-        CamelAnnotationsHandler.handleShutdownTimeout(context, testClass);
-        CamelAnnotationsHandler.handleMockEndpoints(context, testClass);
-        CamelAnnotationsHandler.handleMockEndpointsAndSkip(context, testClass);
-        CamelAnnotationsHandler.handleUseOverridePropertiesWithPropertiesComponent(context, testClass);
-        
-        // CamelContext(s) startup
-        CamelAnnotationsHandler.handleCamelContextStartup(context, testClass);
-        
-        return context;
-    }
-    
-    /**
-     * Cleanup/restore global state to defaults / pre-test values after the test setup
-     * is complete. 
-     * 
-     * @param testClass the test class being executed
-     */
-    protected void cleanup(Class<?> testClass) {
-        SpringCamelContext.setNoStart(false);
-        
-        if (testClass.isAnnotationPresent(DisableJmx.class)) {
-            if (CamelSpringTestHelper.getOriginalJmxDisabled() == null) {
-                System.clearProperty(JmxSystemPropertyKeys.DISABLED);
-            } else {
-                System.setProperty(JmxSystemPropertyKeys.DISABLED,
-                    CamelSpringTestHelper.getOriginalJmxDisabled());
-            }
-        }
-    }
-
-    /**
-     * Returns the class under test in order to enable inspection of annotations while the
-     * Spring context is being created.
-     * 
-     * @return the test class that is being executed
-     * @see CamelSpringTestHelper
-     */
-    protected Class<?> getTestClass() {
-        return CamelSpringTestHelper.getTestClass();
-    }
-
-    /**
-     * Returns the test method under test.
-     *
-     * @return the method that is being executed
-     * @see CamelSpringTestHelper
-     */
-    protected Method getTestMethod() {
-        return CamelSpringTestHelper.getTestMethod();
-    }
-
-}
diff --git a/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringTestContextLoader.java b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringTestContextLoader.java
index 99e52e0..43829e1 100644
--- a/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringTestContextLoader.java
+++ b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringTestContextLoader.java
@@ -25,7 +25,6 @@ import java.util.LinkedList;
 import java.util.List;
 import java.util.Properties;
 import java.util.concurrent.TimeUnit;
-
 import org.apache.camel.CamelContext;
 import org.apache.camel.ExtendedCamelContext;
 import org.apache.camel.api.management.JmxSystemPropertyKeys;
diff --git a/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringTestSupport.java b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringTestSupport.java
index 839f675..0f89812 100644
--- a/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringTestSupport.java
+++ b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringTestSupport.java
@@ -21,7 +21,6 @@ import java.util.HashSet;
 import java.util.List;
 
 import org.apache.camel.CamelContext;
-import org.apache.camel.ExtendedCamelContext;
 import org.apache.camel.spring.SpringCamelContext;
 import org.apache.camel.test.ExcludingPackageScanClassResolver;
 import org.apache.camel.test.junit5.CamelTestSupport;
diff --git a/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/RouteCoverageEventNotifier.java b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/RouteCoverageEventNotifier.java
index 7d7df3d..47c137c 100644
--- a/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/RouteCoverageEventNotifier.java
+++ b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/RouteCoverageEventNotifier.java
@@ -20,7 +20,6 @@ import java.util.function.Function;
 
 import org.apache.camel.CamelContext;
 import org.apache.camel.spi.CamelEvent;
-import org.apache.camel.spi.CamelEvent.CamelContextEvent;
 import org.apache.camel.spi.CamelEvent.CamelContextStoppingEvent;
 import org.apache.camel.support.EventNotifierSupport;
 
diff --git a/components/camel-test-spring/src/test/java/org/apache/camel/test/issues/AdviceWithInterceptSendToEndpointWithLoadbalancerTest.java b/components/camel-test-spring/src/test/java/org/apache/camel/test/issues/AdviceWithInterceptSendToEndpointWithLoadbalancerTest.java
index 1456d1d..928849f 100644
--- a/components/camel-test-spring/src/test/java/org/apache/camel/test/issues/AdviceWithInterceptSendToEndpointWithLoadbalancerTest.java
+++ b/components/camel-test-spring/src/test/java/org/apache/camel/test/issues/AdviceWithInterceptSendToEndpointWithLoadbalancerTest.java
@@ -19,8 +19,8 @@ package org.apache.camel.test.issues;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.model.RouteDefinition;
 import org.apache.camel.reifier.RouteReifier;
-import org.apache.camel.test.spring.CamelSpringTestSupport;
-import org.junit.Test;
+import org.apache.camel.test.junit5.spring.CamelSpringTestSupport;
+import org.junit.jupiter.api.Test;
 import org.springframework.context.support.AbstractApplicationContext;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 
diff --git a/components/camel-test-spring/src/test/java/org/apache/camel/test/issues/AdviceWithOnCompletionTest.java b/components/camel-test-spring/src/test/java/org/apache/camel/test/issues/AdviceWithOnCompletionTest.java
index eeae215..3d9e94b 100644
--- a/components/camel-test-spring/src/test/java/org/apache/camel/test/issues/AdviceWithOnCompletionTest.java
+++ b/components/camel-test-spring/src/test/java/org/apache/camel/test/issues/AdviceWithOnCompletionTest.java
@@ -19,8 +19,8 @@ package org.apache.camel.test.issues;
 import org.apache.camel.builder.AdviceWithRouteBuilder;
 import org.apache.camel.model.RouteDefinition;
 import org.apache.camel.reifier.RouteReifier;
-import org.apache.camel.test.spring.CamelSpringTestSupport;
-import org.junit.Test;
+import org.apache.camel.test.junit5.spring.CamelSpringTestSupport;
+import org.junit.jupiter.api.Test;
 import org.springframework.context.support.AbstractApplicationContext;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 
diff --git a/components/camel-test-spring/src/test/java/org/apache/camel/test/issues/AdviceWithOnExceptionMultipleIssueTest.java b/components/camel-test-spring/src/test/java/org/apache/camel/test/issues/AdviceWithOnExceptionMultipleIssueTest.java
index a9c7007..9c56e77 100644
--- a/components/camel-test-spring/src/test/java/org/apache/camel/test/issues/AdviceWithOnExceptionMultipleIssueTest.java
+++ b/components/camel-test-spring/src/test/java/org/apache/camel/test/issues/AdviceWithOnExceptionMultipleIssueTest.java
@@ -20,8 +20,8 @@ import org.apache.camel.Exchange;
 import org.apache.camel.Processor;
 import org.apache.camel.builder.AdviceWithRouteBuilder;
 import org.apache.camel.reifier.RouteReifier;
-import org.apache.camel.test.spring.CamelSpringTestSupport;
-import org.junit.Test;
+import org.apache.camel.test.junit5.spring.CamelSpringTestSupport;
+import org.junit.jupiter.api.Test;
 import org.springframework.context.support.AbstractApplicationContext;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 
diff --git a/components/camel-test-spring/src/test/java/org/apache/camel/test/issues/MockEndpointsAndSkipTest.java b/components/camel-test-spring/src/test/java/org/apache/camel/test/issues/MockEndpointsAndSkipTest.java
index b2dcbff..132b100 100644
--- a/components/camel-test-spring/src/test/java/org/apache/camel/test/issues/MockEndpointsAndSkipTest.java
+++ b/components/camel-test-spring/src/test/java/org/apache/camel/test/issues/MockEndpointsAndSkipTest.java
@@ -16,8 +16,8 @@
  */
 package org.apache.camel.test.issues;
 
-import org.apache.camel.test.spring.CamelSpringTestSupport;
-import org.junit.Test;
+import org.apache.camel.test.junit5.spring.CamelSpringTestSupport;
+import org.junit.jupiter.api.Test;
 import org.springframework.context.support.AbstractApplicationContext;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 


[camel] 09/09: CAMEL-13342: Implemented a first version of a proof-of-concept for camel-test-spring/SprintBootTest with JUnit 5

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

aldettinger pushed a commit to branch CAMEL-13342-JUNIT5-EXPLORATORY
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 73b2c96f3bacb649d6f9b6e84e2eca02663404ab
Author: aldettinger <al...@gmail.com>
AuthorDate: Wed Jul 24 16:35:27 2019 +0200

    CAMEL-13342: Implemented a first version of a proof-of-concept for camel-test-spring/SprintBootTest with JUnit 5
---
 .../spring/boot/mockendpoints/AdviceWithTest.java  | 11 ++++----
 .../MockEndpointsAndSkipDirtiesContextTest.java    |  9 +++---
 .../boot/mockendpoints/MockEndpointsTest.java      |  9 +++---
 .../camel/spring/boot/routefilter/BarTest.java     |  7 ++---
 .../routefilter/FooExcludeRouteAnnotationTest.java |  9 +++---
 .../camel/spring/boot/routefilter/FooTest.java     |  7 ++---
 .../spring/CamelSpringBootExecutionListener.java   | 10 +++++++
 ...utionListener.java => CamelSpringBootTest.java} | 32 ++++++++++------------
 ...ringTestContextLoaderTestExecutionListener.java |  9 ++----
 .../spring/DisableJmxTestExecutionListener.java    | 10 +++++++
 .../spring/StopWatchTestExecutionListener.java     | 10 +++++++
 11 files changed, 71 insertions(+), 52 deletions(-)

diff --git a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/mockendpoints/AdviceWithTest.java b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/mockendpoints/AdviceWithTest.java
index bea0229..c902c50 100644
--- a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/mockendpoints/AdviceWithTest.java
+++ b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/mockendpoints/AdviceWithTest.java
@@ -21,17 +21,16 @@ import org.apache.camel.builder.AdviceWithRouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.model.ModelCamelContext;
 import org.apache.camel.reifier.RouteReifier;
-import org.apache.camel.test.spring.CamelSpringBootRunner;
-import org.apache.camel.test.spring.UseAdviceWith;
-import org.junit.Test;
-import org.junit.runner.RunWith;
+import org.apache.camel.test.junit5.spring.CamelSpringBootTest;
+import org.apache.camel.test.junit5.spring.UseAdviceWith;
+import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.test.context.SpringBootTest;
 
-import static org.junit.Assert.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertFalse;
 
-@RunWith(CamelSpringBootRunner.class)
+@CamelSpringBootTest
 @UseAdviceWith
 @SpringBootApplication
 @SpringBootTest(classes = AdviceWithTest.class)
diff --git a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/mockendpoints/MockEndpointsAndSkipDirtiesContextTest.java b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/mockendpoints/MockEndpointsAndSkipDirtiesContextTest.java
index 6133451..c7ac277 100644
--- a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/mockendpoints/MockEndpointsAndSkipDirtiesContextTest.java
+++ b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/mockendpoints/MockEndpointsAndSkipDirtiesContextTest.java
@@ -22,17 +22,16 @@ import org.apache.camel.Produce;
 import org.apache.camel.ProducerTemplate;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.spring.SpringRouteBuilder;
-import org.apache.camel.test.spring.CamelSpringBootRunner;
-import org.apache.camel.test.spring.MockEndpointsAndSkip;
-import org.junit.Test;
-import org.junit.runner.RunWith;
+import org.apache.camel.test.junit5.spring.CamelSpringBootTest;
+import org.apache.camel.test.junit5.spring.MockEndpointsAndSkip;
+import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.test.annotation.DirtiesContext;
 
-@RunWith(CamelSpringBootRunner.class)
+@CamelSpringBootTest
 @MockEndpointsAndSkip("direct:b")
 @SpringBootApplication
 @SpringBootTest(classes = MockEndpointsAndSkipDirtiesContextTest.class)
diff --git a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/mockendpoints/MockEndpointsTest.java b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/mockendpoints/MockEndpointsTest.java
index bacfc31..13c95e6 100644
--- a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/mockendpoints/MockEndpointsTest.java
+++ b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/mockendpoints/MockEndpointsTest.java
@@ -19,15 +19,14 @@ package org.apache.camel.spring.boot.mockendpoints;
 import org.apache.camel.CamelContext;
 import org.apache.camel.FluentProducerTemplate;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.spring.CamelSpringBootRunner;
-import org.apache.camel.test.spring.MockEndpoints;
-import org.junit.Test;
-import org.junit.runner.RunWith;
+import org.apache.camel.test.junit5.spring.CamelSpringBootTest;
+import org.apache.camel.test.junit5.spring.MockEndpoints;
+import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.test.context.SpringBootTest;
 
-@RunWith(CamelSpringBootRunner.class)
+@CamelSpringBootTest
 @MockEndpoints
 @SpringBootApplication
 @SpringBootTest(classes = MockEndpointsTest.class)
diff --git a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/routefilter/BarTest.java b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/routefilter/BarTest.java
index f563e8a..5d5e25a 100644
--- a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/routefilter/BarTest.java
+++ b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/routefilter/BarTest.java
@@ -19,14 +19,13 @@ package org.apache.camel.spring.boot.routefilter;
 import org.apache.camel.ProducerTemplate;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.model.ModelCamelContext;
-import org.apache.camel.test.spring.CamelSpringBootRunner;
-import org.junit.Test;
-import org.junit.runner.RunWith;
+import org.apache.camel.test.junit5.spring.CamelSpringBootTest;
+import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.test.context.SpringBootTest;
 
-@RunWith(CamelSpringBootRunner.class)
+@CamelSpringBootTest
 @SpringBootApplication
 @SpringBootTest(classes = BarTest.class,
     properties = {"camel.springboot.java-routes-include-pattern=**/Bar*"})
diff --git a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/routefilter/FooExcludeRouteAnnotationTest.java b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/routefilter/FooExcludeRouteAnnotationTest.java
index badc9a4..288c84a 100644
--- a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/routefilter/FooExcludeRouteAnnotationTest.java
+++ b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/routefilter/FooExcludeRouteAnnotationTest.java
@@ -19,15 +19,14 @@ package org.apache.camel.spring.boot.routefilter;
 import org.apache.camel.ProducerTemplate;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.model.ModelCamelContext;
-import org.apache.camel.test.spring.CamelSpringBootRunner;
-import org.apache.camel.test.spring.ExcludeRoutes;
-import org.junit.Test;
-import org.junit.runner.RunWith;
+import org.apache.camel.test.junit5.spring.CamelSpringBootTest;
+import org.apache.camel.test.junit5.spring.ExcludeRoutes;
+import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.test.context.SpringBootTest;
 
-@RunWith(CamelSpringBootRunner.class)
+@CamelSpringBootTest
 @SpringBootApplication()
 @SpringBootTest(classes = FooTest.class)
 @ExcludeRoutes({BarRoute.class, DrinkRoute.class})
diff --git a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/routefilter/FooTest.java b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/routefilter/FooTest.java
index f12b309..5b69324 100644
--- a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/routefilter/FooTest.java
+++ b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/routefilter/FooTest.java
@@ -19,14 +19,13 @@ package org.apache.camel.spring.boot.routefilter;
 import org.apache.camel.ProducerTemplate;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.model.ModelCamelContext;
-import org.apache.camel.test.spring.CamelSpringBootRunner;
-import org.junit.Test;
-import org.junit.runner.RunWith;
+import org.apache.camel.test.junit5.spring.CamelSpringBootTest;
+import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.test.context.SpringBootTest;
 
-@RunWith(CamelSpringBootRunner.class)
+@CamelSpringBootTest
 @SpringBootApplication()
 @SpringBootTest(classes = FooTest.class,
     properties = {"camel.springboot.java-routes-exclude-pattern=**/Bar*,**/Drink*"})
diff --git a/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringBootExecutionListener.java b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringBootExecutionListener.java
index 4192e5e..3e88a3f 100644
--- a/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringBootExecutionListener.java
+++ b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringBootExecutionListener.java
@@ -20,6 +20,7 @@ import org.apache.camel.spring.SpringCamelContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.context.ConfigurableApplicationContext;
+import org.springframework.core.Ordered;
 import org.springframework.test.context.TestContext;
 import org.springframework.test.context.support.AbstractTestExecutionListener;
 
@@ -29,6 +30,15 @@ public class CamelSpringBootExecutionListener extends AbstractTestExecutionListe
 
     private static final Logger LOG = LoggerFactory.getLogger(CamelSpringBootExecutionListener.class);
 
+    /**
+     * Ensure proper order of test execution listeners.
+     * @TODO: centralize in a kind of util precedence class ?
+     */
+    @Override
+    public int getOrder() {
+        return Ordered.HIGHEST_PRECEDENCE + 3000;
+    }
+
     @Override
     public void prepareTestInstance(TestContext testContext) throws Exception {
         LOG.info("@RunWith(CamelSpringBootRunner.class) preparing: {}", testContext.getTestClass());
diff --git a/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/DisableJmxTestExecutionListener.java b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringBootTest.java
similarity index 50%
copy from components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/DisableJmxTestExecutionListener.java
copy to components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringBootTest.java
index f3aaee6..7114927 100644
--- a/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/DisableJmxTestExecutionListener.java
+++ b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringBootTest.java
@@ -16,24 +16,22 @@
  */
 package org.apache.camel.test.junit5.spring;
 
-import org.apache.camel.api.management.JmxSystemPropertyKeys;
-import org.springframework.test.context.TestContext;
-import org.springframework.test.context.support.AbstractTestExecutionListener;
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
 
-/**
- * Provides reset to pre-test state behavior for global enable/disable of JMX
- * support in Camel through the use of {@link DisableJmx}.
- * Tries to ensure that the pre-test value is restored.
- */
-public class DisableJmxTestExecutionListener extends AbstractTestExecutionListener {
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.springframework.test.context.TestExecutionListeners;
+import org.springframework.test.context.junit.jupiter.SpringExtension;
 
-    @Override
-    public void afterTestClass(TestContext testContext) throws Exception {
-        if (CamelSpringTestHelper.getOriginalJmxDisabled() == null) {
-            System.clearProperty(JmxSystemPropertyKeys.DISABLED);
-        } else {
-            System.setProperty(JmxSystemPropertyKeys.DISABLED, CamelSpringTestHelper.getOriginalJmxDisabled());
-        }
-    }
+@Documented
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.TYPE})
+@ExtendWith(SpringExtension.class)
+@TestExecutionListeners(value = {CamelSpringTestContextLoaderTestExecutionListener.class, DisableJmxTestExecutionListener.class, CamelSpringBootExecutionListener.class,
+                                 StopWatchTestExecutionListener.class}, mergeMode = TestExecutionListeners.MergeMode.MERGE_WITH_DEFAULTS)
+public @interface CamelSpringBootTest {
 
 }
diff --git a/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringTestContextLoaderTestExecutionListener.java b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringTestContextLoaderTestExecutionListener.java
index a749104..88e7d36 100644
--- a/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringTestContextLoaderTestExecutionListener.java
+++ b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/CamelSpringTestContextLoaderTestExecutionListener.java
@@ -31,15 +31,12 @@ import org.springframework.test.context.support.AbstractTestExecutionListener;
 public class CamelSpringTestContextLoaderTestExecutionListener extends AbstractTestExecutionListener {
 
     /**
-     * The default implementation returns {@link org.springframework.core.Ordered#LOWEST_PRECEDENCE},
-     * thereby ensuring that custom listeners are ordered after default
-     * listeners supplied by the framework. Can be overridden by subclasses
-     * as necessary.
+     * Ensure proper order of test execution listeners.
+     * @TODO: centralize in a kind of util precedence class ?
      */
     @Override
     public int getOrder() {
-        //set Camel first
-        return Ordered.HIGHEST_PRECEDENCE;
+        return Ordered.HIGHEST_PRECEDENCE + 1000;
     }
 
     @Override
diff --git a/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/DisableJmxTestExecutionListener.java b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/DisableJmxTestExecutionListener.java
index f3aaee6..10e6c74 100644
--- a/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/DisableJmxTestExecutionListener.java
+++ b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/DisableJmxTestExecutionListener.java
@@ -17,6 +17,7 @@
 package org.apache.camel.test.junit5.spring;
 
 import org.apache.camel.api.management.JmxSystemPropertyKeys;
+import org.springframework.core.Ordered;
 import org.springframework.test.context.TestContext;
 import org.springframework.test.context.support.AbstractTestExecutionListener;
 
@@ -27,6 +28,15 @@ import org.springframework.test.context.support.AbstractTestExecutionListener;
  */
 public class DisableJmxTestExecutionListener extends AbstractTestExecutionListener {
 
+    /**
+     * Ensure proper order of test execution listeners.
+     * @TODO: centralize in a kind of util precedence class ?
+     */
+    @Override
+    public int getOrder() {
+        return Ordered.HIGHEST_PRECEDENCE + 2000;
+    }
+
     @Override
     public void afterTestClass(TestContext testContext) throws Exception {
         if (CamelSpringTestHelper.getOriginalJmxDisabled() == null) {
diff --git a/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/StopWatchTestExecutionListener.java b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/StopWatchTestExecutionListener.java
index 535a7dc..e4c5115 100644
--- a/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/StopWatchTestExecutionListener.java
+++ b/components/camel-test-spring/src/main/java/org/apache/camel/test/junit5/spring/StopWatchTestExecutionListener.java
@@ -20,6 +20,7 @@ import org.apache.camel.util.StopWatch;
 import org.apache.camel.util.TimeUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.springframework.core.Ordered;
 import org.springframework.test.context.TestContext;
 import org.springframework.test.context.support.AbstractTestExecutionListener;
 
@@ -37,6 +38,15 @@ public class StopWatchTestExecutionListener extends AbstractTestExecutionListene
         return threadStopWatch.get();
     }
     
+    /**
+     * Ensure proper order of test execution listeners.
+     * @TODO: centralize in a kind of util precedence class ?
+     */
+    @Override
+    public int getOrder() {
+        return Ordered.HIGHEST_PRECEDENCE + 4000;
+    }
+    
     @Override
     public void beforeTestMethod(TestContext testContext) throws Exception {
         StopWatch stopWatch = new StopWatch();