You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2022/06/17 04:51:23 UTC
[camel-karaf] branch main updated: Camel 18184/camel test blueprint junit5 (#160)
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-karaf.git
The following commit(s) were added to refs/heads/main by this push:
new 9dd8bd6c Camel 18184/camel test blueprint junit5 (#160)
9dd8bd6c is described below
commit 9dd8bd6c8b388cc5ab138abdef9794fbef4187f2
Author: Rastislav Papp <ra...@gmail.com>
AuthorDate: Fri Jun 17 06:51:19 2022 +0200
Camel 18184/camel test blueprint junit5 (#160)
* CAMEL-18184 - clone camel-test-blueprint module as a base for junit5 module
* CAMEL-18184 - use junit5 in camel-test-blueprint-junit5
---
components/camel-test-blueprint-junit5/pom.xml | 195 +++++++
.../src/main/docs/test-blueprint-junit5.adoc | 189 +++++++
.../test/blueprint/CamelBlueprintTestSupport.java | 590 +++++++++++++++++++++
.../camel/test/blueprint/AttributeNewLineTest.java | 42 ++
.../camel/test/blueprint/BeanInjectTest.java | 37 ++
.../camel/test/blueprint/BeanStaticMethodTest.java | 39 ++
.../test/blueprint/BlueprintAddServiceTest.java | 56 ++
.../test/blueprint/BlueprintBeanInjectRoute.java | 42 ++
.../BlueprintComponentPropertyPlaceholderTest.java | 48 ++
.../test/blueprint/BlueprintDefaultValuesTest.java | 49 ++
.../blueprint/BlueprintMultipleServiceTest.java | 82 +++
.../BlueprintOptionalPropertiesDslTest.java | 42 ++
.../test/blueprint/BlueprintPackageScan2Test.java | 44 ++
.../blueprint/BlueprintPackageScanBuilderTest.java | 40 ++
.../test/blueprint/BlueprintPackageScanTest.java | 44 ++
...lueprintProduceConsumeImplicitPropertyTest.java | 40 ++
...printPropertiesLocationElementImplicitTest.java | 52 ++
...printPropertiesLocationElementOptionalTest.java | 52 ++
.../BlueprintPropertiesLocationElementTest.java | 52 ++
.../test/blueprint/BlueprintPropertiesTest.java | 79 +++
.../blueprint/BlueprintPropertyInjectRoute.java | 34 ++
...tRoutesConfigurationBuilderIdOrPatternTest.java | 45 ++
.../test/blueprint/BlueprintStaticMethodRoute.java | 31 ++
.../BlueprintStreamCachingStrategyTest.java | 42 ++
.../test/blueprint/CamelEndpointInjectTest.java | 46 ++
.../test/blueprint/ConfigAdminEndpointTest.java | 40 ++
...dpointWithSynchronousBlueprintCreationTest.java | 45 ++
.../test/blueprint/ConfigAdminExtFileTest.java | 43 ++
...minInitialConfigurationUsingPropertiesTest.java | 47 ++
...gAdminLoadConfigurationFileAndOverrideTest.java | 66 +++
...nfigAdminLoadConfigurationFileNotFoundTest.java | 60 +++
.../ConfigAdminLoadConfigurationFileTest.java | 49 ++
...adMultiConfigurationFileAndOverrideAltTest.java | 64 +++
...nLoadMultiConfigurationFileAndOverrideTest.java | 64 +++
...gAdminNoDefaultValuesBlueprintCreationTest.java | 50 ++
.../ConfigAdminNoReloadDefaultPropertiesTest.java | 40 ++
...ReloadLoadConfigurationFileAndOverrideTest.java | 66 +++
...LoadConfigurationFileDefaultPropertiesTest.java | 49 ++
...nfigAdminNoReloadLoadConfigurationFileTest.java | 49 ++
...dOverridePropertiesOutsideCamelContextTest.java | 57 ++
...nOverridePropertiesOutsideCamelContextTest.java | 53 ++
.../ConfigAdminOverridePropertiesTest.java | 54 ++
.../camel/test/blueprint/ConfigAdminTest.java | 40 ++
.../test/blueprint/ContextCreationTimeoutTest.java | 143 +++++
.../camel/test/blueprint/CustomIdIssuesTest.java | 57 ++
...etterChannelLogExhaustedMessageHistoryTest.java | 33 ++
.../DeadLetterChannelOnPrepareTestTest.java | 49 ++
.../camel/test/blueprint/DebugBlueprintTest.java | 81 +++
...ErrorHandlerLogExhaustedMessageHistoryTest.java | 38 ++
.../DefaultErrorHandlerOnPrepareTestTest.java | 56 ++
.../camel/test/blueprint/EndpointPropertyTest.java | 54 ++
.../camel/test/blueprint/EventNotifierTest.java | 41 ++
.../apache/camel/test/blueprint/FilterTest.java | 63 +++
.../java/org/apache/camel/test/blueprint/Foo.java | 39 ++
.../org/apache/camel/test/blueprint/FooBar.java | 27 +
.../apache/camel/test/blueprint/FooService.java | 53 ++
.../org/apache/camel/test/blueprint/IEcho.java | 23 +
.../camel/test/blueprint/IgnoreDatatypesTest.java | 45 ++
.../test/blueprint/InflightRepositoryRefTest.java | 36 ++
.../test/blueprint/IsMockEndpointJUnit4Test.java | 78 +++
.../blueprint/LoadPropertiesFromBeansTest.java | 38 ++
.../test/blueprint/MockEndpointsAndSkipTest.java | 42 ++
.../test/blueprint/MultipleCamelContextsTest.java | 50 ++
.../apache/camel/test/blueprint/MyCoolBean.java | 52 ++
.../camel/test/blueprint/MyInflightRepository.java | 23 +
.../apache/camel/test/blueprint/MyProducer.java | 34 ++
.../apache/camel/test/blueprint/MyProperties.java | 31 ++
.../org/apache/camel/test/blueprint/MyService.java | 24 +
.../camel/test/blueprint/MyShutdownStrategy.java | 31 ++
...nExceptionOccurredProcessorOnExceptionTest.java | 59 +++
.../OnExceptionOccurredProcessorTest.java | 59 +++
.../blueprint/OnExceptionRouteIdRouteBuilder.java | 36 ++
.../test/blueprint/OnExceptionRouteIdTest.java | 45 ++
.../blueprint/PropertiesComponentFunctionTest.java | 53 ++
.../camel/test/blueprint/PropertyInjectTest.java | 44 ++
.../org/apache/camel/test/blueprint/ProxyTest.java | 37 ++
.../camel/test/blueprint/ShutdownStrategyTest.java | 43 ++
.../camel/test/blueprint/SimpleMockTest.java | 37 ++
.../SimpleTransformAnnotationsBlueprintTest.java | 61 +++
.../blueprint/SimpleTransformBlueprintTest.java | 54 ++
.../test/blueprint/SimpleWeaveAddMockLastTest.java | 52 ++
.../blueprint/SupervisingRouteControllerTest.java | 118 +++++
.../test/blueprint/ThreadNamePatternTest.java | 40 ++
...TypeConverterRegistryStatisticsEnabledTest.java | 70 +++
.../blueprint/builder/AbstractRouteBuilder.java | 30 ++
.../test/blueprint/builder/my/MyRouteBuilder.java | 30 ++
.../cloud/ServiceCallConfigurationTest.java | 51 ++
.../blueprint/cloud/ServiceCallFilterTest.java | 64 +++
.../component/rest/DummyRestConsumerFactory.java | 48 ++
.../component/rest/FromRestConfigurationTest.java | 44 ++
.../component/rest/FromRestGetInterceptTest.java | 43 ++
.../component/rest/FromRestGetOnExceptionTest.java | 42 ++
.../rest/FromRestGetRouteOnExceptionTest.java | 26 +
.../blueprint/component/rest/FromRestGetTest.java | 103 ++++
.../rest/FromRestIdAndDescriptionTest.java | 52 ++
.../component/rest/FromRestUriPrefixTest.java | 66 +++
.../test/blueprint/component/rest/RestRefTest.java | 69 +++
.../converter/CustomConverterRegressionTest.java | 46 ++
.../blueprint/converter/CustomConverterTest.java | 46 ++
.../test/blueprint/converter/FooConverter.java | 37 ++
.../converter/FooConverterRegression.java | 37 ++
.../camel/test/blueprint/converter2/Country.java | 40 ++
.../test/blueprint/converter2/MyConverters.java | 36 ++
.../blueprint/converter2/MyConvertersTest.java | 42 ++
.../ManagedEndpointInjectRefEndpointTest.java | 97 ++++
...ManagedNamePatternFixedIncludeHostNameTest.java | 59 +++
.../management/ManagedNamePatternFixedTest.java | 59 +++
.../management/ManagedRefEndpointTest.java | 92 ++++
.../test/blueprint/management/MyRouteBuilder.java | 35 ++
.../camel/test/blueprint/scan/MyCoolRoute.java | 30 ++
.../test/blueprint/scan2/MyOtherCoolRoute.java | 35 ++
.../XPathFilterRouteContextWithNamespaceTest.java | 26 +
.../xpath/XPathFilterWithNamespaceTest.java | 50 ++
.../test/blueprint/xpath/XPathHeaderNameTest.java | 65 +++
.../services/org/apache/camel/TypeConverter | 18 +
.../src/test/resources/etc/augmented.fallback.cfg | 23 +
.../test/resources/etc/augmented.no.fallback.cfg | 23 +
.../src/test/resources/etc/framework.properties | 19 +
.../src/test/resources/etc/otherstuff.cfg | 20 +
.../src/test/resources/etc/stuff.cfg | 20 +
.../src/test/resources/junit-platform.properties | 0
.../src/test/resources/log4j2.properties | 28 +
.../camel/test/blueprint/AttributeNewLineTest.xml | 47 ++
.../test/blueprint/BlueprintAddServiceTest.xml | 35 ++
.../BlueprintComponentPropertyPlaceholderTest.xml | 47 ++
.../blueprint/BlueprintMultipleServiceTest.xml | 35 ++
.../BlueprintOptionalPropertiesDslTest.xml | 50 ++
...BlueprintProduceConsumeImplicitPropertyTest.xml | 35 ++
.../BlueprintStreamCachingStrategyTest.xml | 38 ++
.../BlueprintSupervisingRouteControllerTest.xml | 50 ++
.../test/blueprint/ConfigAdminExtFileTest.xml | 69 +++
.../camel/test/blueprint/CustomIdIssuesTest.xml | 49 ++
...LetterChannelLogExhaustedMessageHistoryTest.xml | 43 ++
.../DeadLetterChannelOnPrepareTestTest.xml | 44 ++
...tErrorHandlerLogExhaustedMessageHistoryTest.xml | 43 ++
.../DefaultErrorHandlerOnPrepareTestTest.xml | 44 ++
.../camel/test/blueprint/EndpointPropertyTest.xml | 51 ++
.../camel/test/blueprint/IsMockEndpoints.xml | 48 ++
.../test/blueprint/MockEndpointsAndSkipTest.xml | 36 ++
...OnExceptionOccurredProcessorOnExceptionTest.xml | 48 ++
.../blueprint/OnExceptionOccurredProcessorTest.xml | 45 ++
.../test/blueprint/OnExceptionRouteIdTest.xml | 31 ++
.../blueprint/PropertiesComponentFunctionTest.xml | 44 ++
.../test/blueprint/SimpleWeaveAddMockLastTest.xml | 38 ++
.../apache/camel/test/blueprint/beanInjectTest.xml | 35 ++
.../camel/test/blueprint/beanStaticMethodRoute.xml | 34 ++
...ntRoutesConfigurationBuilderIdOrPatternTest.xml | 46 ++
.../apache/camel/test/blueprint/camelContext.xml | 41 ++
.../camel/test/blueprint/camelEndpointInject.xml | 28 +
.../cloud/ServiceCallConfigurationTest.xml | 51 ++
.../test/blueprint/cloud/ServiceCallFilterTest.xml | 54 ++
.../component/rest/FromRestConfigurationTest.xml | 85 +++
.../component/rest/FromRestGetInterceptTest.xml | 51 ++
.../component/rest/FromRestGetOnExceptionTest.xml | 59 +++
.../rest/FromRestGetRouteOnExceptionTest.xml | 58 ++
.../blueprint/component/rest/FromRestGetTest.xml | 78 +++
.../rest/FromRestIdAndDescriptionTest.xml | 83 +++
.../component/rest/FromRestUriPrefixTest.xml | 57 ++
.../test/blueprint/component/rest/RestRefTest.xml | 64 +++
.../blueprint/configadmin-endpoint-no-defaults.xml | 46 ++
.../camel/test/blueprint/configadmin-endpoint.xml | 50 ++
.../camel/test/blueprint/configadmin-loadfile.xml | 47 ++
.../blueprint/configadmin-loadfileoverride.xml | 56 ++
.../configadmin-loadmultifileoverride.xml | 80 +++
.../configadmin-no-reload-default-properties.xml | 52 ++
...admin-no-reload-loadfile-default-properties.xml | 52 ++
.../blueprint/configadmin-no-reload-loadfile.xml | 47 ++
.../configadmin-no-reload-loadfileoverride.xml | 56 ++
.../blueprint/configadmin-no-reload-outside.xml | 52 ++
.../camel/test/blueprint/configadmin-outside.xml | 52 ++
.../apache/camel/test/blueprint/configadmin.xml | 47 ++
.../converter/CustomConverterRegressionTest.xml | 36 ++
.../blueprint/converter/CustomConverterTest.xml | 38 ++
.../test/blueprint/converter2/MyConvertersTest.xml | 32 ++
.../apache/camel/test/blueprint/default-values.xml | 48 ++
.../apache/camel/test/blueprint/eventNotifier.xml | 37 ++
.../org/apache/camel/test/blueprint/filterTest.xml | 39 ++
.../blueprint/health/HealthCheckRegistryTest.xml | 54 ++
.../camel/test/blueprint/ignoreDatatypes.xml | 48 ++
.../test/blueprint/inflightRepositoryRefTest.xml | 36 ++
.../test/blueprint/loadPropertiesFromBeans.xml | 42 ++
.../managedEndpointInjectRefEndpointTest.xml | 35 ++
.../managedNamePatternFixedIncludeHostNameTest.xml | 40 ++
.../management/managedNamePatternFixedTest.xml | 35 ++
.../management/managedRefEndpointTest.xml | 36 ++
.../camel/test/blueprint/multipeCamelContexts.xml | 49 ++
.../camel/test/blueprint/myproperties.properties | 35 ++
.../apache/camel/test/blueprint/packagescan.xml | 31 ++
.../apache/camel/test/blueprint/packagescan2.xml | 33 ++
.../apache/camel/test/blueprint/packagescan3.xml | 29 +
.../properties-location-element-1.properties | 18 +
.../properties-location-element-2.properties | 18 +
.../properties-location-element-implicit-test.xml | 57 ++
.../properties-location-element-optional-test.xml | 58 ++
.../blueprint/properties-location-element-test.xml | 57 ++
.../camel/test/blueprint/propertyInjectTest.xml | 36 ++
.../org/apache/camel/test/blueprint/proxy.xml | 38 ++
.../org/apache/camel/test/blueprint/shutdown.xml | 38 ++
.../apache/camel/test/blueprint/simpleMockTest.xml | 35 ++
.../test/blueprint/simpleTransform-context.xml | 37 ++
.../simpleTransform-properties-context.xml | 36 ++
.../camel/test/blueprint/threadNamePatternTest.xml | 33 ++
.../typeConverterRegistryStatisticsEnabledTest.xml | 36 ++
.../test/blueprint/xpath/XPathHeaderNameTest.xml | 49 ++
.../xpathFilterRouteContextWithNamespaceTest.xml | 40 ++
.../xpath/xpathFilterWithNamespaceTest.xml | 36 ++
components/pom.xml | 1 +
207 files changed, 10435 insertions(+)
diff --git a/components/camel-test-blueprint-junit5/pom.xml b/components/camel-test-blueprint-junit5/pom.xml
new file mode 100644
index 00000000..c14c4288
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/pom.xml
@@ -0,0 +1,195 @@
+<?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.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.camel.karaf</groupId>
+ <artifactId>components</artifactId>
+ <version>3.18.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>camel-test-blueprint-junit5</artifactId>
+ <packaging>jar</packaging>
+
+ <name>Camel Karaf :: Test :: Blueprint :: Junit5</name>
+ <description>Camel unit testing with OSGi Blueprint and Junit5</description>
+
+ <properties>
+ <firstVersion>3.18.0</firstVersion>
+ <label>testing,java,osgi</label>
+
+ <camel.osgi.import>
+ javax.xml.bind*;version="[2.2,3.0)",
+ *
+ </camel.osgi.import>
+ </properties>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.camel.karaf</groupId>
+ <artifactId>camel-blueprint-main</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-test-junit5</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-core</artifactId>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-cloud</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-management</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.karaf</groupId>
+ <artifactId>camel-blueprint</artifactId>
+ <!-- exclude aries blueprint as we add these dependencies explicit -->
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.aries.blueprint</groupId>
+ <artifactId>org.apache.aries.blueprint.core</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <!-- the ordering of the dependencies can matter as we load the dependencies from the classpath
+ with felix-connect, and you may get a weird error if wrong order -->
+ <dependency>
+ <groupId>org.apache.aries.proxy</groupId>
+ <artifactId>org.apache.aries.proxy</artifactId>
+ <version>${aries-blueprint-proxy-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.aries.blueprint</groupId>
+ <artifactId>org.apache.aries.blueprint.api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.aries.blueprint</groupId>
+ <artifactId>org.apache.aries.blueprint.core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.aries.blueprint</groupId>
+ <artifactId>org.apache.aries.blueprint.cm</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.aries</groupId>
+ <artifactId>org.apache.aries.util</artifactId>
+ <version>${aries-util-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.connect</artifactId>
+ <version>${felix-connect-version}</version>
+ <exclusions>
+ <!-- felix-connect includes osgi.core and osgi.compendium version 5.0.0 -->
+ <exclusion>
+ <groupId>org.osgi</groupId>
+ <artifactId>osgi.core</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.osgi</groupId>
+ <artifactId>osgi.cmpn</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.ops4j.pax.tinybundles</groupId>
+ <artifactId>tinybundles</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.configadmin</artifactId>
+ <!-- exclude the following dependency which otherwise would pop up a lot of compilation
+ errors both by this and the camel-maven-plugin modules under eclipse. -->
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.osgi.foundation</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>osgi.core</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>osgi.cmpn</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.fileinstall</artifactId>
+ <version>${felix-fileinstall-version}</version>
+ <!-- exclude the following dependency which otherwise would pop up a lot of compilation
+ errors both by this and the camel-maven-plugin modules under eclipse. -->
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.osgi.foundation</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>osgi.core</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>osgi.cmpn</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <!-- optional dependencies for running tests -->
+
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-api</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-core</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-slf4j-impl</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+</project>
diff --git a/components/camel-test-blueprint-junit5/src/main/docs/test-blueprint-junit5.adoc b/components/camel-test-blueprint-junit5/src/main/docs/test-blueprint-junit5.adoc
new file mode 100644
index 00000000..9a1e9acc
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/main/docs/test-blueprint-junit5.adoc
@@ -0,0 +1,189 @@
+= Blueprint Testing
+
+*Since Camel 3.18.0*
+
+camel-test-blueprint-junit5 does only support testing _one_ CamelContext. So
+if you have two or more CamelContexts in your blueprint XML files, then
+only the CamelContext first found is used during testing.
+
+Testing is a crucial part of any development or
+integration work. Camel supports the definition of
+Blueprint routes, but given
+that Blueprint is an OSGi specific technology, writing unit tests is
+quite difficult. This library leverages
+http://code.google.com/p/pojosr/[PojoSR] (now Felix Connect) which
+provides a service registry without using a fully compliant OSGi
+container. This allows defining real unit tests (as opposed to
+integration tests using
+http://team.ops4j.org/wiki/display/paxexam/Pax+Exam[Pax Exam]. Please
+make sure all test jars in your classpath are OSGi bundles.
+
+Also notice the use of *`getBlueprintDescriptor`* to specify the
+location of the OSGi Blueprint XML file. +
+ If you have multiple OSGi Blueprint XML files, then you can specify
+them with a comma-separated list in the *`getBlueprintDescriptor`*
+method. Notice that only **one** `CamelContext` is supported per blueprint bundle,
+so if you have multiple XML files then only one of them should have `<camelContext>`.
+
+Here's the XML file]:
+
+[source,xml]
+----
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
+
+ <camelContext xmlns="http://camel.apache.org/schema/blueprint">
+
+ <route>
+ <from uri="direct:start"/>
+ <transform>
+ <simple>Hello ${body}</simple>
+ </transform>
+ <to uri="mock:a"/>
+ </route>
+
+ </camelContext>
+
+</blueprint>
+----
+
+In order to define blueprint tests, add the following dependency to your
+pom:
+
+[source,xml]
+-----------------------------------------------
+<dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-test-blueprint-junit5</artifactId>
+ <version>3.18.0</version>
+ <scope>test</scope>
+</dependency>
+-----------------------------------------------
+
+== Classpath scanning
+
+By default PojoSR test container scans the test classpath for all the
+OSGi bundles available there. All the bundles with Blueprint descriptor
+files will be automatically started by the test container. If you would
+like to prevent particular bundles from being started by the test
+container, override the `getBundleFilter` method, just as demonstrated
+in the snippet below.
+
+[source,java]
+--------------------------------------------------------------------------------
+@Override
+protected String getBundleFilter() {
+ // I don't want test container to scan and load Logback bundle during the test
+ return "(!(Bundle-SymbolicName=ch.qos.logback.core))";
+}
+--------------------------------------------------------------------------------
+
+Keep in mind that not specifying the Blueprint descriptor in the
+getBlueprintDescriptor method will not prevent the test container from
+loading a given descriptor. The `getBundleFilter` method is the proper
+way of filtering out bundles you don't want to start during the test.
+
+== Setting timeout when getting CamelContext
+
+`CamelBlueprintTestSupport` waits 30 seconds for Camel Context to be
+ready by default, now you can override this value in two ways:
+
+* Globally, by setting
+`org.apache.camel.test.blueprint.camelContextCreationTimeout` system
+property.
+* Locally for each test, by overriding _getCamelContextCreationTimeout_
+method.
+
+== Adding services on startup
+
+When using `camel-test-blueprint-junit5` you may do unit tests which requires
+using shared services which are not available during unit testing, but
+only in the real OSGi container, for example a shared `DataSource`.
+
+To make it easier to register services on startup, such as a standalone
+`DataSource` or any other service, you can override the method
+`addServicesOnStartup` when your unit test class extends
+`CamelBlueprintTestSupport`.
+
+In the example below we register a service
+`org.apache.camel.test.blueprint.MyService` using the name `myService`
+having a property `beer=Carlsberg`, as shown below:
+
+[source,java]
+---------------------------------------------------------------------------------------------------
+ @Override
+ protected void addServicesOnStartup(Map<String, KeyValueHolder<Object, Dictionary>> services) {
+ services.put("myService", asService(myService, "beer", "Carlsberg"));
+ }
+---------------------------------------------------------------------------------------------------
+
+The asService is a builder method that makes it easy to register a
+service with a single property. If you need more properties you can use
+the `asService` method that takes a `Dictionary` as argument. And if you
+do not need any properties, then just pass in `null`, eg:
+
+[source,java]
+------------------------------------------------------
+services.put("myService", asService(myService, null));
+------------------------------------------------------
+
+This allows us to use the service by calling a method on it from a Camel
+xref:bean-component.adoc[Bean] component in a route as shown:
+
+[source,xml]
+--------------------------------
+ <route>
+ <from uri="direct:start"/>
+ <to uri="bean:myService"/>
+ <to uri="mock:result"/>
+ </route>
+--------------------------------
+
+Notice the bean endpoint uses the service name `myService` which was the
+name we registered the service as. You can also use the fully qualified
+class name instead, which is more common with OSGi.
+
+[source,java]
+---------------------------------------------------------------------------------------------------
+ @Override
+ protected void addServicesOnStartup(Map<String, KeyValueHolder<Object, Dictionary>> services) {
+ services.put(MyService.class.getName(), asService(myService, "beer", "Carlsberg"));
+ }
+---------------------------------------------------------------------------------------------------
+
+And in the route we use the FQN name:
+
+[source,xml]
+----------------------------------------------------------------
+ <route>
+ <from uri="direct:start"/>
+ <to uri="bean:org.apache.camel.test.blueprint.MyService"/>
+ <to uri="mock:result"/>
+ </route>
+----------------------------------------------------------------
+
+An additional `addServicesOnStartup` method is
+available to be overridden making it ideal for when needing to specify
+multiple services with the same interface.
+
+[source,java]
+------------------------------------------------------------------------------------------------------------------
+ @Override
+ protected void addServicesOnStartup(List<KeyValueHolder<String, KeyValueHolder<Object, Dictionary>>> services) {
+ Dictionary<String, String> dict1 = new Hashtable<String, String>();
+ dict1.put("osgi.jndi.service.name", "jdbc/db1");
+
+ Dictionary<String, String> dict2 = new Hashtable<String, String>();
+ dict2.put("osgi.jndi.service.name", "jdbc/db2");
+
+ services.add(asKeyValueService(javax.sql.DataSource.class.getName(), mockService1, dict1));
+ services.add(asKeyValueService(javax.sql.DataSource.class.getName(), mockService2, dict2));
+ }
+------------------------------------------------------------------------------------------------------------------
+
+The `asKeyValueService` builder method can be used to construct the
+necessary parameters to create the service. The method takes in the name
+of the registered service, the object, and and a `Dictionary` as
+arguments.
diff --git a/components/camel-test-blueprint-junit5/src/main/java/org/apache/camel/test/blueprint/CamelBlueprintTestSupport.java b/components/camel-test-blueprint-junit5/src/main/java/org/apache/camel/test/blueprint/CamelBlueprintTestSupport.java
new file mode 100644
index 00000000..23ac0e66
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/main/java/org/apache/camel/test/blueprint/CamelBlueprintTestSupport.java
@@ -0,0 +1,590 @@
+/*
+ * 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.blueprint;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.reflect.Field;
+import java.net.URL;
+import java.nio.file.Files;
+import java.util.Arrays;
+import java.util.Dictionary;
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
+import java.util.LinkedHashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+import java.util.jar.JarFile;
+
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.osgi.framework.Bundle;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import org.apache.aries.blueprint.compendium.cm.CmNamespaceHandler;
+import org.apache.camel.CamelContext;
+import org.apache.camel.blueprint.CamelBlueprintHelper;
+import org.apache.camel.component.properties.PropertiesComponent;
+import org.apache.camel.model.ModelCamelContext;
+import org.apache.camel.support.builder.xml.XMLConverterHelper;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.apache.camel.util.IOHelper;
+import org.apache.camel.util.KeyValueHolder;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceRegistration;
+import org.osgi.service.blueprint.container.BlueprintEvent;
+import org.osgi.service.cm.Configuration;
+import org.osgi.service.cm.ConfigurationAdmin;
+
+/**
+ * Base class for OSGi Blueprint unit tests with Camel
+ */
+public abstract class CamelBlueprintTestSupport extends CamelTestSupport {
+
+ private static final Logger LOG = LoggerFactory.getLogger(CamelBlueprintTestSupport.class);
+
+ /** Name of a system property that sets camel context creation timeout. */
+ public static final String SPROP_CAMEL_CONTEXT_CREATION_TIMEOUT = "org.apache.camel.test.blueprint.camelContextCreationTimeout";
+
+ private static ThreadLocal<BundleContext> threadLocalBundleContext = new ThreadLocal<>();
+ private volatile BundleContext bundleContext;
+ private final Set<ServiceRegistration<?>> services = new LinkedHashSet<>();
+
+ /**
+ * Override this method if you don't want CamelBlueprintTestSupport create the test bundle
+ * @return includeTestBundle
+ * If the return value is true CamelBlueprintTestSupport creates the test bundle which includes blueprint configuration files
+ * If the return value is false CamelBlueprintTestSupport won't create the test bundle
+ */
+ protected boolean includeTestBundle() {
+ return true;
+ }
+
+ /**
+ * <p>Override this method if you want to start Blueprint containers asynchronously using the thread
+ * that starts the bundles itself.
+ * By default this method returns <code>true</code> which means Blueprint Extender will use thread pool
+ * (threads named "<code>Blueprint Extender: N</code>") to startup Blueprint containers.</p>
+ * <p>Karaf and Fuse OSGi containers use synchronous startup.</p>
+ * <p>Asynchronous startup is more in the <em>spirit</em> of OSGi and usually means that if everything works fine
+ * asynchronously, it'll work synchronously as well. This isn't always true otherwise.</p>
+ * @return <code>true</code> when blueprint containers are to be started asynchronously, otherwise <code>false</code>.
+ */
+ protected boolean useAsynchronousBlueprintStartup() {
+ return true;
+ }
+
+ @SuppressWarnings({"rawtypes", "unchecked"})
+ protected BundleContext createBundleContext() throws Exception {
+ System.setProperty("org.apache.aries.blueprint.synchronous", Boolean.toString(!useAsynchronousBlueprintStartup()));
+
+ // load configuration file
+ String[] file = loadConfigAdminConfigurationFile();
+ String[][] configAdminPidFiles = new String[0][0];
+ if (file != null) {
+ if (file.length % 2 != 0) { // This needs to return pairs of filename and pid
+ throw new IllegalArgumentException("The length of the String[] returned from loadConfigAdminConfigurationFile must divisible by 2, was " + file.length);
+ }
+ configAdminPidFiles = new String[file.length / 2][2];
+
+ int pair = 0;
+ for (int i = 0; i < file.length; i += 2) {
+ String fileName = file[i];
+ String pid = file[i + 1];
+ if (!new File(fileName).exists()) {
+ throw new IllegalArgumentException("The provided file \"" + fileName + "\" from loadConfigAdminConfigurationFile doesn't exist");
+ }
+ configAdminPidFiles[pair][0] = fileName;
+ configAdminPidFiles[pair][1] = pid;
+ pair++;
+ }
+ }
+
+ // fetch initial configadmin configuration if provided programmatically
+ Properties initialConfiguration = new Properties();
+ String pid = setConfigAdminInitialConfiguration(initialConfiguration);
+ if (pid != null) {
+ configAdminPidFiles = new String[][]{{prepareInitialConfigFile(initialConfiguration), pid}};
+ }
+
+ final String symbolicName = getClass().getSimpleName();
+ final BundleContext answer = CamelBlueprintHelper.createBundleContext(symbolicName, getBlueprintDescriptor(),
+ includeTestBundle(), getBundleFilter(), getBundleVersion(), getBundleDirectives(), configAdminPidFiles);
+
+ boolean expectReload = expectBlueprintContainerReloadOnConfigAdminUpdate();
+
+ // must register override properties early in OSGi containers
+ extra = useOverridePropertiesWithPropertiesComponent();
+ if (extra != null) {
+ answer.registerService(PropertiesComponent.OVERRIDE_PROPERTIES, extra, null);
+ }
+
+ Map<String, KeyValueHolder<Object, Dictionary>> map = new LinkedHashMap<>();
+ addServicesOnStartup(map);
+
+ List<KeyValueHolder<String, KeyValueHolder<Object, Dictionary>>> servicesList = new LinkedList<>();
+ for (Map.Entry<String, KeyValueHolder<Object, Dictionary>> entry : map.entrySet()) {
+ servicesList.add(asKeyValueService(entry.getKey(), entry.getValue().getKey(), entry.getValue().getValue()));
+ }
+
+ addServicesOnStartup(servicesList);
+
+ for (KeyValueHolder<String, KeyValueHolder<Object, Dictionary>> item : servicesList) {
+ String clazz = item.getKey();
+ Object service = item.getValue().getKey();
+ Dictionary dict = item.getValue().getValue();
+ LOG.debug("Registering service {} -> {}", clazz, service);
+ ServiceRegistration<?> reg = answer.registerService(clazz, service, dict);
+ if (reg != null) {
+ services.add(reg);
+ }
+ }
+
+ // if blueprint XML uses <cm:property-placeholder> (any update-strategy and any default properties)
+ // - org.apache.aries.blueprint.compendium.cm.ManagedObjectManager.register() is called
+ // - ManagedServiceUpdate is scheduled in felix.cm
+ // - org.apache.felix.cm.impl.ConfigurationImpl.setDynamicBundleLocation() is called
+ // - CM_LOCATION_CHANGED event is fired
+ // - if BP was already created, it's <cm:property-placeholder> receives the event and
+ // - org.apache.aries.blueprint.compendium.cm.CmPropertyPlaceholder.updated() is called,
+ // but no BP reload occurs
+ // we will however wait for BP container of the test bundle to become CREATED for the first time
+ // each configadmin update *may* lead to reload of BP container, if it uses <cm:property-placeholder>
+ // with update-strategy="reload"
+
+ // we will gather timestamps of BP events. We don't want to be fooled but repeated events related
+ // to the same state of BP container
+ Set<Long> bpEvents = new HashSet<>();
+
+ CamelBlueprintHelper.waitForBlueprintContainer(bpEvents, answer, symbolicName, BlueprintEvent.CREATED, null);
+
+ // must reuse props as we can do both load from .cfg file and override afterwards
+ final Dictionary props = new Properties();
+
+ // allow end user to override properties
+ pid = useOverridePropertiesWithConfigAdmin(props);
+ if (pid != null) {
+ // we will update the configuration again
+ ConfigurationAdmin configAdmin = CamelBlueprintHelper.getOsgiService(answer, ConfigurationAdmin.class);
+ // passing null as second argument ties the configuration to correct bundle.
+ // using single-arg method causes:
+ // *ERROR* Cannot use configuration xxx.properties for [org.osgi.service.cm.ManagedService, id=N, bundle=N/jar:file:xyz.jar!/]: No visibility to configuration bound to felix-connect
+ final Configuration config = configAdmin.getConfiguration(pid, null);
+ if (config == null) {
+ throw new IllegalArgumentException("Cannot find configuration with pid " + pid + " in OSGi ConfigurationAdmin service.");
+ }
+ // lets merge configurations
+ Dictionary<String, Object> currentProperties = config.getProperties();
+ final Dictionary newProps = new Properties();
+ if (currentProperties == null) {
+ currentProperties = newProps;
+ }
+ for (Enumeration<String> ek = currentProperties.keys(); ek.hasMoreElements();) {
+ String k = ek.nextElement();
+ newProps.put(k, currentProperties.get(k));
+ }
+ for (String p : ((Properties) props).stringPropertyNames()) {
+ newProps.put(p, ((Properties) props).getProperty(p));
+ }
+
+ LOG.info("Updating ConfigAdmin {} by overriding properties {}", config, newProps);
+ if (expectReload) {
+ CamelBlueprintHelper.waitForBlueprintContainer(bpEvents, answer, symbolicName, BlueprintEvent.CREATED, new Runnable() {
+ @Override
+ public void run() {
+ try {
+ config.update(newProps);
+ } catch (IOException e) {
+ throw new RuntimeException(e.getMessage(), e);
+ }
+ }
+ });
+ } else {
+ config.update(newProps);
+ }
+ }
+
+ return answer;
+ }
+
+ @BeforeEach
+ @Override
+ public void setUp() throws Exception {
+ System.setProperty("skipStartingCamelContext", "true");
+ System.setProperty("registerBlueprintCamelContextEager", "true");
+
+ if (isCreateCamelContextPerClass()) {
+ // test is per class, so only setup once (the first time)
+ boolean first = threadLocalBundleContext.get() == null;
+ if (first) {
+ threadLocalBundleContext.set(createBundleContext());
+ }
+ bundleContext = threadLocalBundleContext.get();
+ } else {
+ bundleContext = createBundleContext();
+ }
+
+ super.setUp();
+
+ // we don't have to wait for BP container's OSGi service - we've already waited
+ // for BlueprintEvent.CREATED
+
+ // start context when we are ready
+ LOG.debug("Starting CamelContext: {}", context.getName());
+ if (isUseAdviceWith()) {
+ LOG.info("Skipping starting CamelContext as isUseAdviceWith is set to true.");
+ } else {
+ context.start();
+ }
+ }
+
+ /**
+ * Override this method to add services to be registered on startup.
+ * <p/>
+ * You can use the builder methods {@link #asService(Object, java.util.Dictionary)}, {@link #asService(Object, String, String)}
+ * to make it easy to add the services to the map.
+ */
+ protected void addServicesOnStartup(Map<String, KeyValueHolder<Object, Dictionary>> services) {
+ // noop
+ }
+
+ /**
+ * This method may be overriden to instruct BP test support that BP container will reloaded when
+ * Config Admin configuration is updated. By default, this is expected, when blueprint XML definition
+ * contains <code><cm:property-placeholder persistent-id="PID" update-strategy="reload"></code>
+ */
+ protected boolean expectBlueprintContainerReloadOnConfigAdminUpdate() {
+ boolean expectedReload = false;
+ DocumentBuilderFactory dbf = new XMLConverterHelper().createDocumentBuilderFactory();
+ try {
+ // cm-1.0 doesn't define update-strategy attribute
+ Set<String> cmNamesaces = new HashSet<>(Arrays.asList(
+ CmNamespaceHandler.BLUEPRINT_CM_NAMESPACE_1_1,
+ CmNamespaceHandler.BLUEPRINT_CM_NAMESPACE_1_2,
+ CmNamespaceHandler.BLUEPRINT_CM_NAMESPACE_1_3
+ ));
+ for (URL descriptor : CamelBlueprintHelper.getBlueprintDescriptors(getBlueprintDescriptor())) {
+ DocumentBuilder db = dbf.newDocumentBuilder();
+ try (InputStream is = descriptor.openStream()) {
+ Document doc = db.parse(is);
+ NodeList nl = doc.getDocumentElement().getChildNodes();
+ for (int i = 0; i < nl.getLength(); i++) {
+ Node node = nl.item(i);
+ if (node instanceof Element) {
+ Element pp = (Element) node;
+ if (cmNamesaces.contains(pp.getNamespaceURI())) {
+ String us = pp.getAttribute("update-strategy");
+ if (us != null && us.equals("reload")) {
+ expectedReload = true;
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+ } catch (Exception e) {
+ throw new RuntimeException(e.getMessage(), e);
+ }
+ return expectedReload;
+ }
+
+ /**
+ * Override this method to add services to be registered on startup.
+ * <p/>
+ * You can use the builder methods {@link #asKeyValueService(String, Object, Dictionary)}
+ * to make it easy to add the services to the List.
+ */
+ protected void addServicesOnStartup(List<KeyValueHolder<String, KeyValueHolder<Object, Dictionary>>> services) {
+ // noop
+ }
+
+ /**
+ * Creates a holder for the given service, which make it easier to use {@link #addServicesOnStartup(java.util.Map)}
+ */
+ protected KeyValueHolder<Object, Dictionary> asService(Object service, Dictionary dict) {
+ return new KeyValueHolder<>(service, dict);
+ }
+
+ /**
+ * Creates a holder for the given service, which make it easier to use {@link #addServicesOnStartup(java.util.List)}
+ */
+ protected KeyValueHolder<String, KeyValueHolder<Object, Dictionary>> asKeyValueService(String name, Object service, Dictionary dict) {
+ return new KeyValueHolder<>(name, new KeyValueHolder<>(service, dict));
+ }
+
+ /**
+ * Creates a holder for the given service, which make it easier to use {@link #addServicesOnStartup(java.util.Map)}
+ */
+ protected KeyValueHolder<Object, Dictionary> asService(Object service, String key, String value) {
+ Properties prop = new Properties();
+ if (key != null && value != null) {
+ prop.put(key, value);
+ }
+ return new KeyValueHolder<>(service, prop);
+ }
+
+ /**
+ * <p>Override this method to override config admin properties. Overriden properties will be passed to
+ * {@link Configuration#update(Dictionary)} and may or may not lead to reload of Blueprint container - this
+ * depends on <code>update-strategy="reload|none"</code> in <code><cm:property-placeholder></code></p>
+ * <p>This method should be used to simulate configuration update <strong>after</strong> Blueprint container
+ * is already initialized and started. Don't use this method to initialized ConfigAdmin configuration.</p>
+ *
+ * @param props properties where you add the properties to override
+ * @return the PID of the OSGi {@link ConfigurationAdmin} which are defined in the Blueprint XML file.
+ */
+ protected String useOverridePropertiesWithConfigAdmin(Dictionary<String, String> props) throws Exception {
+ return null;
+ }
+
+ /**
+ * Override this method and provide the name of the .cfg configuration file to use for
+ * ConfigAdmin service. Provided file will be used to initialize ConfigAdmin configuration before Blueprint
+ * container is loaded.
+ *
+ * @return the name of the path for the .cfg file to load, and the persistence-id of the property placeholder.
+ */
+ protected String[] loadConfigAdminConfigurationFile() {
+ return null;
+ }
+
+ /**
+ * Override this method as an alternative to {@link #loadConfigAdminConfigurationFile()} if there's a need
+ * to set initial ConfigAdmin configuration without using files.
+ *
+ * @param props always non-null. Tests may initialize ConfigAdmin configuration by returning PID.
+ * @return persistence-id of the property placeholder. If non-null, <code>props</code> will be used as
+ * initial ConfigAdmin configuration
+ */
+ protected String setConfigAdminInitialConfiguration(Properties props) {
+ return null;
+ }
+
+ @AfterEach
+ @Override
+ public void tearDown() throws Exception {
+ System.clearProperty("skipStartingCamelContext");
+ System.clearProperty("registerBlueprintCamelContextEager");
+
+ super.tearDown();
+
+ // unregister services
+ if (bundleContext != null) {
+ for (ServiceRegistration<?> reg : services) {
+ bundleContext.ungetService(reg.getReference());
+ }
+ }
+
+ // close bundle context
+ if (bundleContext != null) {
+ // remember bundles before closing
+ Bundle[] bundles = bundleContext.getBundles();
+ // close bundle context
+ CamelBlueprintHelper.disposeBundleContext(bundleContext);
+ // now close jar files from the bundles
+ closeBundleJArFile(bundles);
+ }
+ }
+
+ @Override
+ public void cleanupResources() throws Exception {
+ if (threadLocalBundleContext.get() != null) {
+ CamelBlueprintHelper.disposeBundleContext(threadLocalBundleContext.get());
+ threadLocalBundleContext.remove();
+ }
+ super.cleanupResources();
+ }
+
+ /**
+ * Felix Connect leaks "open files" as a JarFile on Bundle Revision is not closed when stopping the bundle
+ * which can cause the JVM to open up too many file handles.
+ */
+ private void closeBundleJArFile(Bundle[] bundles) {
+ for (Bundle bundle : bundles) {
+ try {
+ // not all bundles is from PojoSRBundle that has a revision
+ Field field = bundle.getClass().getDeclaredField("m_revision");
+ field.setAccessible(true);
+ Object val = field.get(bundle);
+ field = val.getClass().getDeclaredField("m_jar");
+ field.setAccessible(true);
+ Object mJar = field.get(val);
+ if (mJar instanceof JarFile) {
+ JarFile jf = (JarFile) mJar;
+ LOG.debug("Closing bundle[{}] JarFile: {}", bundle.getBundleId(), jf.getName());
+ jf.close();
+ LOG.trace("Closed bundle[{}] JarFile: {}", bundle.getBundleId(), jf.getName());
+ }
+ } catch (Throwable e) {
+ // ignore
+ }
+ }
+ }
+
+ /**
+ * Return the system bundle context
+ */
+ protected BundleContext getBundleContext() {
+ return bundleContext;
+ }
+
+ /**
+ * Gets the bundle descriptor from the classpath.
+ * <p/>
+ * Return the location(s) of the bundle descriptors from the classpath.
+ * Separate multiple locations by comma, or return a single location.
+ * <p/>
+ * Only one CamelContext is supported per blueprint bundle,
+ * so if you have multiple XML files then only one of them should have <tt><camelContext></tt>.
+ * <p/>
+ * For example override this method and return <tt>OSGI-INF/blueprint/camel-context.xml</tt>
+ *
+ * @return the location of the bundle descriptor file.
+ */
+ protected String getBlueprintDescriptor() {
+ return null;
+ }
+
+ /**
+ * Gets filter expression of bundle descriptors.
+ * Modify this method if you wish to change default behavior.
+ *
+ * @return filter expression for OSGi bundles.
+ */
+ protected String getBundleFilter() {
+ return CamelBlueprintHelper.BUNDLE_FILTER;
+ }
+
+ /**
+ * Gets test bundle version.
+ * Modify this method if you wish to change default behavior.
+ *
+ * @return test bundle version
+ */
+ protected String getBundleVersion() {
+ return CamelBlueprintHelper.BUNDLE_VERSION;
+ }
+
+ /**
+ * Gets the bundle directives.
+ * <p/>
+ * Modify this method if you wish to add some directives.
+ */
+ protected String getBundleDirectives() {
+ return null;
+ }
+
+ /**
+ * Returns how long to wait for Camel Context
+ * to be created.
+ *
+ * @return timeout in milliseconds.
+ */
+ protected Long getCamelContextCreationTimeout() {
+ String tm = System.getProperty(SPROP_CAMEL_CONTEXT_CREATION_TIMEOUT);
+ if (tm == null) {
+ return null;
+ }
+ try {
+ Long val = Long.valueOf(tm);
+ if (val < 0) {
+ throw new IllegalArgumentException("Value of "
+ + SPROP_CAMEL_CONTEXT_CREATION_TIMEOUT
+ + " cannot be negative.");
+ }
+ return val;
+ } catch (NumberFormatException e) {
+ throw new IllegalArgumentException("Value of "
+ + SPROP_CAMEL_CONTEXT_CREATION_TIMEOUT
+ + " has wrong format.", e);
+ }
+ }
+
+ /**
+ * Gets filter expression for the Camel context you want to test.
+ * Modify this if you have multiple contexts in the OSGi registry and want to test a specific one.
+ *
+ * @return filter expression for Camel context.
+ */
+ protected String getCamelContextFilter() {
+ return null;
+ }
+
+ @Override
+ protected CamelContext createCamelContext() throws Exception {
+ CamelContext answer;
+ Long timeout = getCamelContextCreationTimeout();
+ if (timeout == null) {
+ answer = CamelBlueprintHelper.getOsgiService(bundleContext, CamelContext.class, getCamelContextFilter());
+ } else if (timeout >= 0) {
+ answer = CamelBlueprintHelper.getOsgiService(bundleContext, CamelContext.class, getCamelContextFilter(), timeout);
+ } else {
+ throw new IllegalArgumentException("getCamelContextCreationTimeout cannot return a negative value.");
+ }
+ // must override context so we use the correct one in testing
+ context = answer.adapt(ModelCamelContext.class);
+ return answer;
+ }
+
+
+ protected <T> T getOsgiService(Class<T> type) {
+ return CamelBlueprintHelper.getOsgiService(bundleContext, type);
+ }
+
+ protected <T> T getOsgiService(Class<T> type, long timeout) {
+ return CamelBlueprintHelper.getOsgiService(bundleContext, type, timeout);
+ }
+
+ protected <T> T getOsgiService(Class<T> type, String filter) {
+ return CamelBlueprintHelper.getOsgiService(bundleContext, type, filter);
+ }
+
+ protected <T> T getOsgiService(Class<T> type, String filter, long timeout) {
+ return CamelBlueprintHelper.getOsgiService(bundleContext, type, filter, timeout);
+ }
+
+ /**
+ * Create a temporary File with persisted configuration for ConfigAdmin
+ */
+ private String prepareInitialConfigFile(Properties initialConfiguration) throws IOException {
+ File dir = new File("target/etc");
+ dir.mkdirs();
+ File cfg = Files.createTempFile(dir.toPath(), "properties-", ".cfg").toFile();
+ FileWriter writer = new FileWriter(cfg);
+ try {
+ initialConfiguration.store(writer, null);
+ } finally {
+ IOHelper.close(writer);
+ }
+ return cfg.getAbsolutePath();
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/AttributeNewLineTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/AttributeNewLineTest.java
new file mode 100644
index 00000000..2a41f936
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/AttributeNewLineTest.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.blueprint;
+
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+
+public class AttributeNewLineTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/AttributeNewLineTest.xml";
+ }
+
+ @Test
+ public void testAttributeNewLineTest() throws Exception {
+ getMockEndpoint("mock:bar").expectedMessageCount(1);
+
+ template.sendBody("direct:start", "Hello World");
+
+ assertMockEndpointsSatisfied();
+
+ Object stub = context.hasEndpoint("stub:GET /v1/phonebook/companies/{companyCode}?oauth=OPTIONAL");
+ assertNotNull(stub, "Should have stub endpoint with double spaces");
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/BeanInjectTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/BeanInjectTest.java
new file mode 100644
index 00000000..1ce44fc5
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/BeanInjectTest.java
@@ -0,0 +1,37 @@
+/*
+ * 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.blueprint;
+
+import org.junit.jupiter.api.Test;
+
+public class BeanInjectTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/beanInjectTest.xml";
+ }
+
+ @Test
+ public void testBeanInject() throws Exception {
+ getMockEndpoint("mock:result").expectedBodiesReceived("Hello World");
+
+ template.sendBody("direct:start", "World");
+
+ assertMockEndpointsSatisfied();
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/BeanStaticMethodTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/BeanStaticMethodTest.java
new file mode 100644
index 00000000..7d25b2b4
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/BeanStaticMethodTest.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.blueprint;
+
+import org.junit.jupiter.api.Test;
+
+public class BeanStaticMethodTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/beanStaticMethodRoute.xml";
+ }
+
+ @Test
+ public void testStaticMethod() throws Exception {
+ getMockEndpoint("mock:result").expectedBodiesReceived("Hello World");
+ getMockEndpoint("mock:result").message(0).exchangeProperty("foo").isNotNull();
+ getMockEndpoint("mock:result").message(0).exchangeProperty("bar").isNotNull();
+
+ template.sendBody("direct:start", "Hello World");
+
+ assertMockEndpointsSatisfied();
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/BlueprintAddServiceTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/BlueprintAddServiceTest.java
new file mode 100644
index 00000000..60ca5f79
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/BlueprintAddServiceTest.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.blueprint;
+
+import java.util.Dictionary;
+import java.util.Map;
+
+import org.apache.camel.util.KeyValueHolder;
+import org.junit.jupiter.api.Test;
+import org.osgi.framework.ServiceReference;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+public class BlueprintAddServiceTest extends CamelBlueprintTestSupport {
+
+ private MyService myService = new MyService();
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/BlueprintAddServiceTest.xml";
+ }
+
+ @Override
+ protected void addServicesOnStartup(Map<String, KeyValueHolder<Object, Dictionary>> services) {
+ services.put("myService", asService(myService, "beer", "Carlsberg"));
+ }
+
+ @Test
+ public void testAddService() throws Exception {
+ getMockEndpoint("mock:result").expectedBodiesReceived("CamelCamel");
+
+ template.sendBody("direct:start", "Camel");
+
+ assertMockEndpointsSatisfied();
+
+ ServiceReference<?> ref = getBundleContext().getServiceReference("myService");
+ assertEquals("Carlsberg", ref.getProperty("beer"));
+ Object service = getBundleContext().getService(ref);
+ assertSame(myService, service);
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/BlueprintBeanInjectRoute.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/BlueprintBeanInjectRoute.java
new file mode 100644
index 00000000..fb0eba91
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/BlueprintBeanInjectRoute.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.blueprint;
+
+import org.apache.camel.BeanInject;
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+import org.apache.camel.builder.RouteBuilder;
+
+public class BlueprintBeanInjectRoute extends RouteBuilder {
+
+ @BeanInject("foo")
+ private FooBar greeting;
+
+ @Override
+ public void configure() throws Exception {
+ from("direct:start")
+ .process(new Processor() {
+ @Override
+ public void process(Exchange exchange) throws Exception {
+ String out = greeting.hello(exchange.getIn().getBody(String.class));
+ exchange.getIn().setBody(out);
+ }
+ })
+ .to("mock:result");
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/BlueprintComponentPropertyPlaceholderTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/BlueprintComponentPropertyPlaceholderTest.java
new file mode 100644
index 00000000..a6034719
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/BlueprintComponentPropertyPlaceholderTest.java
@@ -0,0 +1,48 @@
+/*
+ * 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.blueprint;
+
+import org.apache.camel.component.seda.SedaComponent;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+public class BlueprintComponentPropertyPlaceholderTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/BlueprintComponentPropertyPlaceholderTest.xml";
+ }
+
+ @Test
+ public void testComponentPropertyPlaceholder() throws Exception {
+ SedaComponent myseda = (SedaComponent) context.getComponent("myseda", false);
+ assertNotNull(myseda);
+ assertEquals(2, myseda.getQueueSize());
+
+ // test that the custom component works
+
+ int before = myseda.getQueueReference("myseda://foo").getQueue().size();
+ assertEquals(0, before);
+
+ template.sendBody("direct:start", "Hello World");
+
+ int after = myseda.getQueueReference("myseda://foo").getQueue().size();
+ assertEquals(1, after);
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/BlueprintDefaultValuesTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/BlueprintDefaultValuesTest.java
new file mode 100644
index 00000000..02935209
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/BlueprintDefaultValuesTest.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.blueprint;
+
+import java.util.Properties;
+
+import org.junit.jupiter.api.Test;
+
+/**
+ * A test showing that Blueprint XML property placeholders work correctly with
+ * placeholders containing colon in the key.
+ */
+public class BlueprintDefaultValuesTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/default-values.xml";
+ }
+
+ @Test
+ public void testPropertyResolutionFailure() throws Exception {
+ getMockEndpoint("mock:result").expectedBodiesReceived("dot=my.value colon=my:value");
+
+ template.sendBody("direct:start", null);
+
+ assertMockEndpointsSatisfied();
+ }
+
+ @Override
+ protected Properties useOverridePropertiesWithPropertiesComponent() {
+ Properties extra = new Properties();
+ extra.put("my:key", "my:value");
+ return extra;
+ }
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/BlueprintMultipleServiceTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/BlueprintMultipleServiceTest.java
new file mode 100644
index 00000000..0b3225b0
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/BlueprintMultipleServiceTest.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.blueprint;
+
+import java.util.Dictionary;
+import java.util.Hashtable;
+import java.util.List;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.EndpointInject;
+import org.apache.camel.component.mock.MockComponent;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.spi.ComponentResolver;
+import org.apache.camel.util.KeyValueHolder;
+import org.junit.jupiter.api.Test;
+
+public class BlueprintMultipleServiceTest extends CamelBlueprintTestSupport {
+
+ @EndpointInject("fakeservice1:mock")
+ private MockEndpoint fakeServiceOneMock;
+
+ @EndpointInject("fakeservice2:mock")
+ private MockEndpoint fakeServiceTwoMock;
+
+ private MockComponent mockComponentOne = new MockComponent();
+ private MockComponent mockComponentTwo = new MockComponent();
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/BlueprintMultipleServiceTest.xml";
+ }
+
+ @Override
+ @SuppressWarnings("rawtypes")
+ protected void addServicesOnStartup(List<KeyValueHolder<String, KeyValueHolder<Object, Dictionary>>> services) {
+ Dictionary<String, String> dict1 = new Hashtable<>();
+ dict1.put("component", "fakeservice1");
+
+ Dictionary<String, String> dict2 = new Hashtable<>();
+ dict2.put("component", "fakeservice2");
+
+ services.add(asKeyValueService(ComponentResolver.class.getName(), mockComponentOne, dict1));
+ services.add(asKeyValueService(ComponentResolver.class.getName(), mockComponentTwo, dict2));
+
+ }
+
+ @Override
+ protected CamelContext createCamelContext() throws Exception {
+ CamelContext context = super.createCamelContext();
+ context.addComponent("fakeservice1", mockComponentOne);
+ context.addComponent("fakeservice2", mockComponentTwo);
+
+ return context;
+ }
+
+ @Test
+ public void testMultipleService() throws Exception {
+
+ template.sendBody("direct:start", "Camel");
+
+ fakeServiceOneMock.expectedMessageCount(1);
+ fakeServiceTwoMock.expectedMessageCount(1);
+
+ assertMockEndpointsSatisfied();
+
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/BlueprintOptionalPropertiesDslTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/BlueprintOptionalPropertiesDslTest.java
new file mode 100644
index 00000000..6f8e6a45
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/BlueprintOptionalPropertiesDslTest.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.blueprint;
+
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+public class BlueprintOptionalPropertiesDslTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/BlueprintOptionalPropertiesDslTest.xml";
+ }
+
+ @Test
+ public void testPlaceholderDslTest() throws Exception {
+ getMockEndpoint("mock:a").expectedMessageCount(1);
+ getMockEndpoint("mock:b").expectedMessageCount(0);
+
+ assertThrows(Exception.class, () -> {
+ template.sendBody("direct:start", "Hello World");
+ });
+
+ assertMockEndpointsSatisfied();
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/BlueprintPackageScan2Test.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/BlueprintPackageScan2Test.java
new file mode 100644
index 00000000..de15a75e
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/BlueprintPackageScan2Test.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.blueprint;
+
+import org.junit.jupiter.api.Test;
+
+/**
+ *
+ */
+public class BlueprintPackageScan2Test extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/packagescan2.xml";
+ }
+
+ // here we have regular Junit @Test method
+ @Test
+ public void testRoute() throws Exception {
+ // set mock expectations
+ getMockEndpoint("mock:a").expectedMessageCount(1);
+
+ // send a message
+ template.sendBody("direct:start", "World");
+
+ // assert mocks
+ assertMockEndpointsSatisfied();
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/BlueprintPackageScanBuilderTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/BlueprintPackageScanBuilderTest.java
new file mode 100644
index 00000000..46a3c986
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/BlueprintPackageScanBuilderTest.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.blueprint;
+
+import org.junit.jupiter.api.Test;
+
+public class BlueprintPackageScanBuilderTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/packagescan3.xml";
+ }
+
+ // here we have regular Junit @Test method
+ @Test
+ public void testRoute() throws Exception {
+ // set mock expectations
+ getMockEndpoint("mock:result").expectedMessageCount(1);
+
+ // send a message
+ template.sendBody("direct:start", "World");
+
+ // assert mocks
+ assertMockEndpointsSatisfied();
+ }
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/BlueprintPackageScanTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/BlueprintPackageScanTest.java
new file mode 100644
index 00000000..0f5fb051
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/BlueprintPackageScanTest.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.blueprint;
+
+import org.junit.jupiter.api.Test;
+
+/**
+ *
+ */
+public class BlueprintPackageScanTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/packagescan.xml";
+ }
+
+ // here we have regular Junit @Test method
+ @Test
+ public void testRoute() throws Exception {
+ // set mock expectations
+ getMockEndpoint("mock:a").expectedMessageCount(1);
+
+ // send a message
+ template.sendBody("direct:start", "World");
+
+ // assert mocks
+ assertMockEndpointsSatisfied();
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/BlueprintProduceConsumeImplicitPropertyTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/BlueprintProduceConsumeImplicitPropertyTest.java
new file mode 100644
index 00000000..16de73da
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/BlueprintProduceConsumeImplicitPropertyTest.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.blueprint;
+
+import org.junit.jupiter.api.Test;
+
+/**
+ *
+ */
+public class BlueprintProduceConsumeImplicitPropertyTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/BlueprintProduceConsumeImplicitPropertyTest.xml";
+ }
+
+ @Test
+ public void testImplicit() throws Exception {
+ getMockEndpoint("mock:result").expectedMessageCount(1);
+
+ template.sendBody("seda:input", "Hello World");
+
+ assertMockEndpointsSatisfied();
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/BlueprintPropertiesLocationElementImplicitTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/BlueprintPropertiesLocationElementImplicitTest.java
new file mode 100644
index 00000000..956e404f
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/BlueprintPropertiesLocationElementImplicitTest.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.blueprint;
+
+import java.util.List;
+
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.component.properties.PropertiesComponent;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+public class BlueprintPropertiesLocationElementImplicitTest extends CamelBlueprintTestSupport {
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/properties-location-element-implicit-test.xml";
+ }
+
+ @Test
+ public void testPropertiesLocationElement() throws Exception {
+ MockEndpoint mock = getMockEndpoint("mock:result");
+ mock.expectedHeaderReceived("property-1", "property-value-1");
+ mock.expectedHeaderReceived("property-2", "property-value-2");
+ mock.expectedHeaderReceived("cm", "cm-value");
+
+ PropertiesComponent pc = (PropertiesComponent) context.getPropertiesComponent();
+ assertNotNull(pc, "Properties component not defined");
+
+ List<String> locations = pc.getLocations();
+
+ assertNotNull(locations);
+ assertEquals(2, locations.size(), "Properties locations");
+
+ template.sendBody("direct:start", null);
+
+ mock.assertIsSatisfied();
+ }
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/BlueprintPropertiesLocationElementOptionalTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/BlueprintPropertiesLocationElementOptionalTest.java
new file mode 100644
index 00000000..7dd0cc6f
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/BlueprintPropertiesLocationElementOptionalTest.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.blueprint;
+
+import java.util.List;
+
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.component.properties.PropertiesComponent;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+public class BlueprintPropertiesLocationElementOptionalTest extends CamelBlueprintTestSupport {
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/properties-location-element-optional-test.xml";
+ }
+
+ @Test
+ public void testPropertiesLocationElement() throws Exception {
+ MockEndpoint mock = getMockEndpoint("mock:result");
+ mock.expectedHeaderReceived("property-1", "property-value-1");
+ mock.expectedHeaderReceived("property-2", "property-value-2");
+ mock.expectedHeaderReceived("cm", "cm-value");
+
+ PropertiesComponent pc = (PropertiesComponent) context.getPropertiesComponent();
+ assertNotNull(pc, "Properties component not defined");
+
+ List<String> locations = pc.getLocations();
+
+ assertNotNull(locations);
+ assertEquals(3, locations.size(), "Properties locations");
+
+ template.sendBody("direct:start", null);
+
+ mock.assertIsSatisfied();
+ }
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/BlueprintPropertiesLocationElementTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/BlueprintPropertiesLocationElementTest.java
new file mode 100644
index 00000000..660e45a0
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/BlueprintPropertiesLocationElementTest.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.blueprint;
+
+import java.util.List;
+
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.component.properties.PropertiesComponent;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+public class BlueprintPropertiesLocationElementTest extends CamelBlueprintTestSupport {
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/properties-location-element-test.xml";
+ }
+
+ @Test
+ public void testPropertiesLocationElement() throws Exception {
+ MockEndpoint mock = getMockEndpoint("mock:result");
+ mock.expectedHeaderReceived("property-1", "property-value-1");
+ mock.expectedHeaderReceived("property-2", "property-value-2");
+ mock.expectedHeaderReceived("cm", "cm-value");
+
+ PropertiesComponent pc = (PropertiesComponent) context.getPropertiesComponent();
+ assertNotNull(pc, "Properties component not defined");
+
+ List<String> locations = pc.getLocations();
+
+ assertNotNull(locations);
+ assertEquals(3, locations.size(), "Properties locations");
+
+ template.sendBody("direct:start", null);
+
+ mock.assertIsSatisfied();
+ }
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/BlueprintPropertiesTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/BlueprintPropertiesTest.java
new file mode 100644
index 00000000..056990e9
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/BlueprintPropertiesTest.java
@@ -0,0 +1,79 @@
+/*
+ * 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.blueprint;
+
+import org.apache.camel.blueprint.CamelBlueprintHelper;
+import org.junit.jupiter.api.Test;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleException;
+import org.osgi.service.blueprint.container.BlueprintContainer;
+import org.osgi.service.blueprint.container.BlueprintEvent;
+
+import static org.junit.jupiter.api.Assertions.fail;
+
+/**
+ *
+ */
+public class BlueprintPropertiesTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/configadmin.xml";
+ }
+
+ @Test
+ public void testProperties() throws Exception {
+ Bundle camelCore = getBundleBySymbolicName("org.apache.camel.karaf.camel-blueprint");
+ Bundle test = getBundleBySymbolicName(getClass().getSimpleName());
+
+ camelCore.stop();
+ test.stop();
+
+ Thread.sleep(500);
+
+ test.start();
+ try {
+ getOsgiService(BlueprintContainer.class, "(osgi.blueprint.container.symbolicname=" + getClass().getSimpleName() + ")", 500);
+ fail("Expected a timeout");
+ } catch (RuntimeException e) {
+ // Expected timeout
+ }
+
+ CamelBlueprintHelper.waitForBlueprintContainer(null, test.getBundleContext(), getClass().getSimpleName(), BlueprintEvent.CREATED,
+ new Runnable() {
+ @Override
+ public void run() {
+ try {
+ camelCore.start();
+ } catch (BundleException e) {
+ throw new RuntimeException(e.getMessage(), e);
+ }
+ }
+ });
+ getOsgiService(BlueprintContainer.class, "(osgi.blueprint.container.symbolicname=" + getClass().getSimpleName() + ")", 500);
+ }
+
+ private Bundle getBundleBySymbolicName(String name) {
+ for (Bundle bundle : getBundleContext().getBundles()) {
+ if (bundle.getSymbolicName().equals(name)) {
+ return bundle;
+ }
+ }
+ return null;
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/BlueprintPropertyInjectRoute.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/BlueprintPropertyInjectRoute.java
new file mode 100644
index 00000000..42eb0952
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/BlueprintPropertyInjectRoute.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.blueprint;
+
+import org.apache.camel.PropertyInject;
+import org.apache.camel.builder.RouteBuilder;
+
+public class BlueprintPropertyInjectRoute extends RouteBuilder {
+
+ @PropertyInject("greeting")
+ private String greeting;
+
+ @Override
+ public void configure() throws Exception {
+ from("seda:start")
+ .transform().constant(greeting)
+ .to("{{destination}}");
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/BlueprintRoutesConfigurationBuilderIdOrPatternTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/BlueprintRoutesConfigurationBuilderIdOrPatternTest.java
new file mode 100644
index 00000000..659359ae
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/BlueprintRoutesConfigurationBuilderIdOrPatternTest.java
@@ -0,0 +1,45 @@
+/*
+ * 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.blueprint;
+
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+public class BlueprintRoutesConfigurationBuilderIdOrPatternTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/blueprintRoutesConfigurationBuilderIdOrPatternTest.xml";
+ }
+
+ @Test
+ public void testRoutesConfigurationOnException() throws Exception {
+ getMockEndpoint("mock:error").expectedBodiesReceived("Bye World");
+
+ try {
+ template.sendBody("direct:start", "Hello World");
+ fail("Should throw exception");
+ } catch (Exception e) {
+ // expected
+ }
+ template.sendBody("direct:start2", "Bye World");
+
+ assertMockEndpointsSatisfied();
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/BlueprintStaticMethodRoute.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/BlueprintStaticMethodRoute.java
new file mode 100644
index 00000000..0106ab82
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/BlueprintStaticMethodRoute.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.blueprint;
+
+import org.apache.camel.builder.RouteBuilder;
+
+public class BlueprintStaticMethodRoute extends RouteBuilder {
+
+ @Override
+ public void configure() throws Exception {
+ from("direct:start")
+ .setProperty("foo").method(System.class, "currentTimeMillis")
+ .setProperty("bar").simple("${bean:type:java.lang.System?method=currentTimeMillis}")
+ .to("mock:result");
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/BlueprintStreamCachingStrategyTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/BlueprintStreamCachingStrategyTest.java
new file mode 100644
index 00000000..7c2bdba7
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/BlueprintStreamCachingStrategyTest.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.blueprint;
+
+import org.junit.jupiter.api.Test;
+
+import static org.apache.camel.util.FileUtil.normalizePath;
+import static org.junit.jupiter.api.Assertions.*;
+
+/**
+ *
+ */
+public class BlueprintStreamCachingStrategyTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/BlueprintStreamCachingStrategyTest.xml";
+ }
+
+ @Test
+ public void testStreamCaching() {
+ assertTrue(context.getStreamCachingStrategy().isEnabled());
+ assertEquals(normalizePath("target/cachedir"), normalizePath(context.getStreamCachingStrategy().getSpoolDirectory().toString()));
+ assertEquals(Integer.valueOf(4096).intValue(), context.getStreamCachingStrategy().getBufferSize());
+ assertEquals(Long.valueOf(8192).longValue(), context.getStreamCachingStrategy().getSpoolThreshold());
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/CamelEndpointInjectTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/CamelEndpointInjectTest.java
new file mode 100644
index 00000000..91c073e2
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/CamelEndpointInjectTest.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.blueprint;
+
+import org.apache.camel.component.mock.MockEndpoint;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+/**
+ *
+ */
+public class CamelEndpointInjectTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/camelEndpointInject.xml";
+ }
+
+ @Test
+ public void testEndpointInjection() throws Exception {
+ MockEndpoint mock = context.getEndpoint("mock:result", MockEndpoint.class);
+ assertNotNull(mock);
+ mock.expectedMessageCount(1);
+
+ MyProducer producer = context.getRegistry().lookupByNameAndType("myProducer", MyProducer.class);
+ producer.doSomething("Hello World");
+
+ mock.assertIsSatisfied();
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ConfigAdminEndpointTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ConfigAdminEndpointTest.java
new file mode 100644
index 00000000..62551086
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ConfigAdminEndpointTest.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.blueprint;
+
+import org.junit.jupiter.api.Test;
+
+/**
+ *
+ */
+public class ConfigAdminEndpointTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/configadmin-endpoint.xml";
+ }
+
+ @Test
+ public void testConfigAdmin() throws Exception {
+ getMockEndpoint("mock:result").expectedBodiesReceived("Bye World");
+
+ template.sendBody("direct:start", "World");
+
+ assertMockEndpointsSatisfied();
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ConfigAdminEndpointWithSynchronousBlueprintCreationTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ConfigAdminEndpointWithSynchronousBlueprintCreationTest.java
new file mode 100644
index 00000000..6d77df1c
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ConfigAdminEndpointWithSynchronousBlueprintCreationTest.java
@@ -0,0 +1,45 @@
+/*
+ * 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.blueprint;
+
+import org.junit.jupiter.api.Test;
+
+/**
+ *
+ */
+public class ConfigAdminEndpointWithSynchronousBlueprintCreationTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected boolean useAsynchronousBlueprintStartup() {
+ return false;
+ }
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/configadmin-endpoint.xml";
+ }
+
+ @Test
+ public void testConfigAdmin() throws Exception {
+ getMockEndpoint("mock:result").expectedBodiesReceived("Bye World");
+
+ template.sendBody("direct:start", "World");
+
+ assertMockEndpointsSatisfied();
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ConfigAdminExtFileTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ConfigAdminExtFileTest.java
new file mode 100644
index 00000000..043dbd7c
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ConfigAdminExtFileTest.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.blueprint;
+
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.*;
+/**
+ *
+ */
+public class ConfigAdminExtFileTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/ConfigAdminExtFileTest.xml";
+ }
+
+ @Test
+ public void testConfigAdmin() throws Exception {
+ getMockEndpoint("mock:result").expectedBodiesReceived("Camel World");
+
+ template.sendBody("direct:start", "World");
+
+ assertMockEndpointsSatisfied();
+
+ assertFalse(context.isMessageHistory(), "Message history should be disabled");
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ConfigAdminInitialConfigurationUsingPropertiesTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ConfigAdminInitialConfigurationUsingPropertiesTest.java
new file mode 100644
index 00000000..1de3d8fc
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ConfigAdminInitialConfigurationUsingPropertiesTest.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.blueprint;
+
+import java.util.Properties;
+
+import org.junit.jupiter.api.Test;
+
+/**
+ * A test showing that if Blueprint XML contains property placeholders, some property source has to be defined.
+ */
+public class ConfigAdminInitialConfigurationUsingPropertiesTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/configadmin-endpoint-no-defaults.xml";
+ }
+
+ @Override
+ protected String setConfigAdminInitialConfiguration(Properties props) {
+ props.put("greeting", "Bye");
+ props.put("destination", "mock:result");
+ return "my-placeholders";
+ }
+
+ @Test
+ public void testConfigAdmin() throws Exception {
+ getMockEndpoint("mock:result").expectedBodiesReceived("Bye World");
+ template.sendBody("direct:start", "World");
+ assertMockEndpointsSatisfied();
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ConfigAdminLoadConfigurationFileAndOverrideTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ConfigAdminLoadConfigurationFileAndOverrideTest.java
new file mode 100644
index 00000000..7d297e0f
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ConfigAdminLoadConfigurationFileAndOverrideTest.java
@@ -0,0 +1,66 @@
+/*
+ * 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.blueprint;
+
+import java.util.Dictionary;
+
+import org.junit.jupiter.api.Test;
+
+// START SNIPPET: e1
+/**
+ * This example will load a Blueprint .cfg file (which will initialize configadmin), and also override its property
+ * placeholders from this unit test source code directly (the change will reload blueprint container).
+ */
+public class ConfigAdminLoadConfigurationFileAndOverrideTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ // which blueprint XML file to use for this test
+ return "org/apache/camel/test/blueprint/configadmin-loadfileoverride.xml";
+ }
+
+ @Override
+ protected String[] loadConfigAdminConfigurationFile() {
+ // which .cfg file to use, and the name of the persistence-id
+ return new String[]{"src/test/resources/etc/stuff.cfg", "stuff"};
+ }
+
+ @Override
+ protected String useOverridePropertiesWithConfigAdmin(Dictionary props) throws Exception {
+ // override / add extra properties
+ props.put("destination", "mock:extra");
+
+ // return the persistence-id to use
+ return "stuff";
+ }
+
+ @Test
+ public void testConfigAdmin() throws Exception {
+ // mock:original comes from <cm:default-properties>/<cm:property name="destination" value="mock:original" />
+ getMockEndpoint("mock:original").setExpectedMessageCount(0);
+ // mock:result comes from loadConfigAdminConfigurationFile()
+ getMockEndpoint("mock:result").setExpectedMessageCount(0);
+ // mock:extra comes from useOverridePropertiesWithConfigAdmin()
+ getMockEndpoint("mock:extra").expectedBodiesReceived("Bye World", "Yay Bye WorldYay Bye World");
+
+ template.sendBody("direct:start", "World");
+
+ assertMockEndpointsSatisfied();
+ }
+
+}
+// END SNIPPET: e1
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ConfigAdminLoadConfigurationFileNotFoundTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ConfigAdminLoadConfigurationFileNotFoundTest.java
new file mode 100644
index 00000000..948f0dba
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ConfigAdminLoadConfigurationFileNotFoundTest.java
@@ -0,0 +1,60 @@
+/*
+ * 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.blueprint;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+/**
+ *
+ */
+public class ConfigAdminLoadConfigurationFileNotFoundTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/configadmin-loadfile.xml";
+ }
+
+ @Override
+ @BeforeEach
+ public void setUp() throws Exception {
+ try {
+ super.setUp();
+ fail("Should throw IllegalArgumentException, because the config file wasn't found");
+ } catch (IllegalArgumentException e) {
+ assertTrue(e.getMessage().contains("../../src/test/resources/etc/stuff.cfg"));
+ }
+ }
+
+ // START SNIPPET: e1
+ @Override
+ protected String[] loadConfigAdminConfigurationFile() {
+ // String[0] = tell Camel the path of the .cfg file to use for OSGi ConfigAdmin in the blueprint XML file
+ // this file should exist
+ // String[1] = tell Camel the persistence-id of the cm:property-placeholder in the blueprint XML file
+ return new String[]{"../../src/test/resources/etc/stuff.cfg", "stuff"};
+ }
+ // END SNIPPET: e1
+
+ @Test
+ public void test() throws Exception {
+ // irrelevant
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ConfigAdminLoadConfigurationFileTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ConfigAdminLoadConfigurationFileTest.java
new file mode 100644
index 00000000..b9844831
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ConfigAdminLoadConfigurationFileTest.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.blueprint;
+
+import org.junit.jupiter.api.Test;
+
+/**
+ * Same as {@link ConfigAdminNoReloadLoadConfigurationFileTest} except this time Blueprint container will reloaded
+ */
+public class ConfigAdminLoadConfigurationFileTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/configadmin-loadfile.xml";
+ }
+
+ // START SNIPPET: e1
+ @Override
+ protected String[] loadConfigAdminConfigurationFile() {
+ // String[0] = tell Camel the path of the .cfg file to use for OSGi ConfigAdmin in the blueprint XML file
+ // String[1] = tell Camel the persistence-id of the cm:property-placeholder in the blueprint XML file
+ return new String[]{"src/test/resources/etc/stuff.cfg", "stuff"};
+ }
+ // END SNIPPET: e1
+
+ @Test
+ public void testConfigAdmin() throws Exception {
+ getMockEndpoint("mock:result").expectedBodiesReceived("Bye World");
+
+ template.sendBody("direct:start", "World");
+
+ assertMockEndpointsSatisfied();
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ConfigAdminLoadMultiConfigurationFileAndOverrideAltTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ConfigAdminLoadMultiConfigurationFileAndOverrideAltTest.java
new file mode 100644
index 00000000..b1d1e4f7
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ConfigAdminLoadMultiConfigurationFileAndOverrideAltTest.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.blueprint;
+
+import java.util.Dictionary;
+
+import org.junit.jupiter.api.Test;
+
+/**
+ * This test should be run in tandem with ConfigAdminLoadConfigurationFileAndOverrideTest. These examples will load a
+ * Blueprint .cfg file with multiple property placeholders defined. We need two tests to make sure we
+ * process both of them correctly
+ */
+public class ConfigAdminLoadMultiConfigurationFileAndOverrideAltTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ // which blueprint XML file to use for this test
+ return "org/apache/camel/test/blueprint/configadmin-loadmultifileoverride.xml";
+ }
+
+ @Override
+ protected String[] loadConfigAdminConfigurationFile() {
+ // which .cfg files to use, and their corresponding persistence-ids
+ return new String[]{"src/test/resources/etc/stuff.cfg", "stuff", "src/test/resources/etc/otherstuff.cfg", "otherstuff"};
+ }
+
+ @Override
+ protected String useOverridePropertiesWithConfigAdmin(Dictionary props) throws Exception {
+ // override / add extra properties
+ props.put("destination", "mock:extra");
+
+ // return the persistence-id to use
+ return "stuff";
+ }
+
+ @Test
+ public void testConfigAdmin() throws Exception {
+ // mock:original comes from <cm:default-properties>/<cm:property name="destination" value="mock:original" />
+ getMockEndpoint("mock:original").setExpectedMessageCount(0);
+ // mock:result comes from loadConfigAdminConfigurationFile()
+ getMockEndpoint("mock:result").setExpectedMessageCount(0);
+ // mock:extra comes from useOverridePropertiesWithConfigAdmin()
+ getMockEndpoint("mock:extra").expectedBodiesReceived("Bye World", "Yay Bye WorldYay Bye World");
+
+ template.sendBody("direct:start", "World");
+
+ assertMockEndpointsSatisfied();
+ }
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ConfigAdminLoadMultiConfigurationFileAndOverrideTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ConfigAdminLoadMultiConfigurationFileAndOverrideTest.java
new file mode 100644
index 00000000..c85d672f
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ConfigAdminLoadMultiConfigurationFileAndOverrideTest.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.blueprint;
+
+import java.util.Dictionary;
+
+import org.junit.jupiter.api.Test;
+
+/**
+ * This is the first of two tests which will load a Blueprint .cfg file (which will initialize configadmin), containing
+ * multiple property placeholders and also override its property placeholders directly (the change will reload blueprint
+ * container).
+ */
+public class ConfigAdminLoadMultiConfigurationFileAndOverrideTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ // which blueprint XML file to use for this test
+ return "org/apache/camel/test/blueprint/configadmin-loadmultifileoverride.xml";
+ }
+
+ @Override
+ protected String[] loadConfigAdminConfigurationFile() {
+ // which .cfg files to use, and their corresponding persistence-ids
+ return new String[]{"src/test/resources/etc/stuff.cfg", "stuff", "src/test/resources/etc/otherstuff.cfg", "otherstuff"};
+ }
+
+ @Override
+ protected String useOverridePropertiesWithConfigAdmin(Dictionary properties) throws Exception {
+ // override / add extra properties
+ properties.put("arrive", "mock:otherExtra");
+
+ // return the persistence-id to use
+ return "otherstuff";
+ }
+
+ @Test
+ public void testConfigAdminWithMultiplePids() throws Exception {
+ // mock:otherOriginal comes from <cm:default-properties>/<cm:property name="arrive" value="mock:otherOriginal" />
+ getMockEndpoint("mock:otherOriginal").setExpectedMessageCount(0);
+ // mock:result comes from loadConfigAdminConfigurationFile()
+ getMockEndpoint("mock:otherResult").setExpectedMessageCount(0);
+ // mock:extra comes from useOverridePropertiesWithConfigAdmin()
+ getMockEndpoint("mock:otherExtra").expectedBodiesReceived("Adieu World", "tiens! Adieu Worldtiens! Adieu World");
+
+ template.sendBody("direct:otherStart", "World");
+
+ assertMockEndpointsSatisfied();
+ }
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ConfigAdminNoDefaultValuesBlueprintCreationTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ConfigAdminNoDefaultValuesBlueprintCreationTest.java
new file mode 100644
index 00000000..f71c5068
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ConfigAdminNoDefaultValuesBlueprintCreationTest.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.blueprint;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+/**
+ * A test showing that if Blueprint XML contains property placeholders, some property source has to be defined.
+ */
+public class ConfigAdminNoDefaultValuesBlueprintCreationTest extends CamelBlueprintTestSupport {
+
+ @Override
+ @BeforeEach
+ public void setUp() throws Exception {
+ try {
+ super.setUp();
+ fail("Should fail, because Blueprint XML uses property placeholders, but we didn't define any property sources");
+ } catch (Exception e) {
+ assertEquals("Property with key [destination] not found in properties from text: {{destination}}",
+ e.getCause().getCause().getCause().getMessage());
+ }
+ }
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/configadmin-endpoint-no-defaults.xml";
+ }
+
+ @Test
+ public void test() throws Exception {
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ConfigAdminNoReloadDefaultPropertiesTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ConfigAdminNoReloadDefaultPropertiesTest.java
new file mode 100644
index 00000000..c45c71cb
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ConfigAdminNoReloadDefaultPropertiesTest.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.blueprint;
+
+import org.junit.jupiter.api.Test;
+
+/**
+ *
+ */
+public class ConfigAdminNoReloadDefaultPropertiesTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/configadmin-no-reload-default-properties.xml";
+ }
+
+ @Test
+ public void testConfigAdmin() throws Exception {
+ getMockEndpoint("mock:result").expectedBodiesReceived("Good morning World");
+
+ template.sendBody("direct:start", "World");
+
+ assertMockEndpointsSatisfied();
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ConfigAdminNoReloadLoadConfigurationFileAndOverrideTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ConfigAdminNoReloadLoadConfigurationFileAndOverrideTest.java
new file mode 100644
index 00000000..2f739279
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ConfigAdminNoReloadLoadConfigurationFileAndOverrideTest.java
@@ -0,0 +1,66 @@
+/*
+ * 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.blueprint;
+
+import java.util.Dictionary;
+
+import org.junit.jupiter.api.Test;
+
+// START SNIPPET: e1
+/**
+ * This example will load a Blueprint .cfg file (which will initialize configadmin), and also override its property
+ * placeholders from this unit test source code directly (the change won't reload blueprint container).
+ */
+public class ConfigAdminNoReloadLoadConfigurationFileAndOverrideTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ // which blueprint XML file to use for this test
+ return "org/apache/camel/test/blueprint/configadmin-no-reload-loadfileoverride.xml";
+ }
+
+ @Override
+ protected String[] loadConfigAdminConfigurationFile() {
+ // which .cfg file to use, and the name of the persistence-id
+ return new String[]{"src/test/resources/etc/stuff.cfg", "stuff"};
+ }
+
+ @Override
+ protected String useOverridePropertiesWithConfigAdmin(Dictionary props) throws Exception {
+ // override / add extra properties
+ props.put("destination", "mock:extra");
+
+ // return the persistence-id to use
+ return "stuff";
+ }
+
+ @Test
+ public void testConfigAdmin() throws Exception {
+ // mock:original comes from <cm:default-properties>/<cm:property name="destination" value="mock:original" />
+ getMockEndpoint("mock:original").setExpectedMessageCount(0);
+ // mock:result comes from loadConfigAdminConfigurationFile()
+ getMockEndpoint("mock:result").expectedBodiesReceived("Bye World", "Yay Bye WorldYay Bye World");
+ // mock:extra comes from useOverridePropertiesWithConfigAdmin(), but BP container isn't reloaded
+ getMockEndpoint("mock:extra").setExpectedMessageCount(0);
+
+ template.sendBody("direct:start", "World");
+
+ assertMockEndpointsSatisfied();
+ }
+
+}
+// END SNIPPET: e1
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ConfigAdminNoReloadLoadConfigurationFileDefaultPropertiesTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ConfigAdminNoReloadLoadConfigurationFileDefaultPropertiesTest.java
new file mode 100644
index 00000000..76e5b9cf
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ConfigAdminNoReloadLoadConfigurationFileDefaultPropertiesTest.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.blueprint;
+
+import org.junit.jupiter.api.Test;
+
+/**
+ * {@link #loadConfigAdminConfigurationFile()} will override properties set by <code><cm:default-properties></code>
+ */
+public class ConfigAdminNoReloadLoadConfigurationFileDefaultPropertiesTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/configadmin-no-reload-loadfile-default-properties.xml";
+ }
+
+ // START SNIPPET: e1
+ @Override
+ protected String[] loadConfigAdminConfigurationFile() {
+ // String[0] = tell Camel the path of the .cfg file to use for OSGi ConfigAdmin in the blueprint XML file
+ // String[1] = tell Camel the persistence-id of the cm:property-placeholder in the blueprint XML file
+ return new String[]{"src/test/resources/etc/stuff.cfg", "stuff"};
+ }
+ // END SNIPPET: e1
+
+ @Test
+ public void testConfigAdmin() throws Exception {
+ getMockEndpoint("mock:result").expectedBodiesReceived("Bye World");
+
+ template.sendBody("direct:start", "World");
+
+ assertMockEndpointsSatisfied();
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ConfigAdminNoReloadLoadConfigurationFileTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ConfigAdminNoReloadLoadConfigurationFileTest.java
new file mode 100644
index 00000000..4f3a6925
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ConfigAdminNoReloadLoadConfigurationFileTest.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.blueprint;
+
+import org.junit.jupiter.api.Test;
+
+/**
+ *
+ */
+public class ConfigAdminNoReloadLoadConfigurationFileTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/configadmin-no-reload-loadfile.xml";
+ }
+
+ // START SNIPPET: e1
+ @Override
+ protected String[] loadConfigAdminConfigurationFile() {
+ // String[0] = tell Camel the path of the .cfg file to use for OSGi ConfigAdmin in the blueprint XML file
+ // String[1] = tell Camel the persistence-id of the cm:property-placeholder in the blueprint XML file
+ return new String[]{"src/test/resources/etc/stuff.cfg", "stuff"};
+ }
+ // END SNIPPET: e1
+
+ @Test
+ public void testConfigAdmin() throws Exception {
+ getMockEndpoint("mock:result").expectedBodiesReceived("Bye World");
+
+ template.sendBody("direct:start", "World");
+
+ assertMockEndpointsSatisfied();
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ConfigAdminNoReloadOverridePropertiesOutsideCamelContextTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ConfigAdminNoReloadOverridePropertiesOutsideCamelContextTest.java
new file mode 100644
index 00000000..8796b478
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ConfigAdminNoReloadOverridePropertiesOutsideCamelContextTest.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.blueprint;
+
+import java.util.Dictionary;
+
+import org.junit.jupiter.api.Test;
+
+/**
+ *
+ */
+public class ConfigAdminNoReloadOverridePropertiesOutsideCamelContextTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/configadmin-no-reload-outside.xml";
+ }
+
+ // START SNIPPET: e1
+ @Override
+ protected String useOverridePropertiesWithConfigAdmin(Dictionary props) {
+ // add the properties we want to override
+ props.put("greeting", "Bye");
+ props.put("destination", "mock:extra");
+
+ // return the PID of the config-admin we are using in the blueprint xml file
+ return "my-placeholders";
+ }
+ // END SNIPPET: e1
+
+ @Test
+ public void testConfigAdmin() throws Exception {
+ // Even if we update config admin configuration, update-strategy="none" won't cause reload of BP
+ // container and reinjection of bean properties
+ getMockEndpoint("mock:result").expectedBodiesReceived("Hello World");
+ getMockEndpoint("mock:extra").setExpectedMessageCount(0);
+
+ template.sendBody("direct:start", "World");
+
+ assertMockEndpointsSatisfied();
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ConfigAdminOverridePropertiesOutsideCamelContextTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ConfigAdminOverridePropertiesOutsideCamelContextTest.java
new file mode 100644
index 00000000..081ce694
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ConfigAdminOverridePropertiesOutsideCamelContextTest.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.blueprint;
+
+import java.util.Dictionary;
+
+import org.junit.jupiter.api.Test;
+
+/**
+ *
+ */
+public class ConfigAdminOverridePropertiesOutsideCamelContextTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/configadmin-outside.xml";
+ }
+
+ // START SNIPPET: e1
+ @Override
+ protected String useOverridePropertiesWithConfigAdmin(Dictionary props) {
+ // add the properties we want to override
+ props.put("greeting", "Bye");
+
+ // return the PID of the config-admin we are using in the blueprint xml file
+ return "my-placeholders";
+ }
+ // END SNIPPET: e1
+
+ @Test
+ public void testConfigAdmin() throws Exception {
+ getMockEndpoint("mock:result").expectedBodiesReceived("Bye World");
+
+ template.sendBody("direct:start", "World");
+
+ assertMockEndpointsSatisfied();
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ConfigAdminOverridePropertiesTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ConfigAdminOverridePropertiesTest.java
new file mode 100644
index 00000000..6f0507a0
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ConfigAdminOverridePropertiesTest.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.blueprint;
+
+import java.util.Properties;
+
+import org.junit.jupiter.api.Test;
+
+/**
+ *
+ */
+public class ConfigAdminOverridePropertiesTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/configadmin.xml";
+ }
+
+ // START SNIPPET: e1
+ // override this method to provide our custom properties we use in this unit test
+ @Override
+ protected Properties useOverridePropertiesWithPropertiesComponent() {
+ Properties extra = new Properties();
+ extra.put("destination", "mock:extra");
+ extra.put("greeting", "Bye");
+ return extra;
+ }
+ // END SNIPPET: e1
+
+ @Test
+ public void testConfigAdmin() throws Exception {
+ getMockEndpoint("mock:extra").expectedBodiesReceived("Bye World");
+ getMockEndpoint("mock:result").expectedMessageCount(0);
+
+ template.sendBody("direct:start", "World");
+
+ assertMockEndpointsSatisfied();
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ConfigAdminTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ConfigAdminTest.java
new file mode 100644
index 00000000..76c23102
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ConfigAdminTest.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.blueprint;
+
+import org.junit.jupiter.api.Test;
+
+/**
+ *
+ */
+public class ConfigAdminTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/configadmin.xml";
+ }
+
+ @Test
+ public void testConfigAdmin() throws Exception {
+ getMockEndpoint("mock:result").expectedBodiesReceived("Hello World");
+
+ template.sendBody("direct:start", "World");
+
+ assertMockEndpointsSatisfied();
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ContextCreationTimeoutTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ContextCreationTimeoutTest.java
new file mode 100644
index 00000000..ef85b2c0
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ContextCreationTimeoutTest.java
@@ -0,0 +1,143 @@
+/*
+ * 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.blueprint;
+
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+public class ContextCreationTimeoutTest {
+
+ @AfterEach
+ public void cleanup() {
+ System.clearProperty(CamelBlueprintTestSupport.SPROP_CAMEL_CONTEXT_CREATION_TIMEOUT);
+ }
+
+ @Test
+ public void testDefault() {
+ System.clearProperty(CamelBlueprintTestSupport.SPROP_CAMEL_CONTEXT_CREATION_TIMEOUT);
+ CamelBlueprintTestSupport ts = new DefaultTestSupport();
+ assertNull(ts.getCamelContextCreationTimeout());
+ }
+
+ @Test
+ public void testSystemPropertyNormal() {
+ final Long someValue = 60000L;
+ System.setProperty(
+ CamelBlueprintTestSupport.SPROP_CAMEL_CONTEXT_CREATION_TIMEOUT,
+ someValue.toString());
+ CamelBlueprintTestSupport ts = new DefaultTestSupport();
+ assertEquals(someValue, ts.getCamelContextCreationTimeout());
+ }
+
+ @Test
+ public void testSystemPropertyMaxVal() {
+ final Long someValue = Long.MAX_VALUE;
+ System.setProperty(
+ CamelBlueprintTestSupport.SPROP_CAMEL_CONTEXT_CREATION_TIMEOUT,
+ someValue.toString());
+ CamelBlueprintTestSupport ts = new DefaultTestSupport();
+ assertEquals(someValue, ts.getCamelContextCreationTimeout());
+ }
+
+ @Test
+ public void testSystemPropertyZero() {
+ final Long zeroValue = 0L;
+ System.setProperty(
+ CamelBlueprintTestSupport.SPROP_CAMEL_CONTEXT_CREATION_TIMEOUT,
+ zeroValue.toString());
+ CamelBlueprintTestSupport ts = new DefaultTestSupport();
+ assertEquals(zeroValue, ts.getCamelContextCreationTimeout());
+ }
+
+ @Test
+ public void testSystemPropertyNegative() {
+ System.setProperty(
+ CamelBlueprintTestSupport.SPROP_CAMEL_CONTEXT_CREATION_TIMEOUT,
+ "-100");
+ CamelBlueprintTestSupport ts = new DefaultTestSupport();
+ try {
+ ts.getCamelContextCreationTimeout();
+ fail();
+ } catch (IllegalArgumentException e) {
+ assertNull(e.getCause());
+ }
+ }
+
+ @Test
+ public void testSystemPropertyWrongFormat() {
+ System.setProperty(
+ CamelBlueprintTestSupport.SPROP_CAMEL_CONTEXT_CREATION_TIMEOUT,
+ "NaN");
+ CamelBlueprintTestSupport ts = new DefaultTestSupport();
+ try {
+ ts.getCamelContextCreationTimeout();
+ fail();
+ } catch (IllegalArgumentException e) {
+ assertTrue(e.getCause() instanceof NumberFormatException);
+ }
+ }
+
+ @Test
+ public void testOverrideNormal() {
+ final Long someValue = 60000L;
+ System.clearProperty(CamelBlueprintTestSupport.SPROP_CAMEL_CONTEXT_CREATION_TIMEOUT);
+ CamelBlueprintTestSupport ts = new OverridingTestSupport(someValue);
+ assertEquals(someValue, ts.getCamelContextCreationTimeout());
+ }
+
+ @Test
+ public void testOverrideSystemPropNormal() {
+ final Long someValue = 60000L;
+ final Long syspropValue = someValue + 60000L;
+ System.setProperty(
+ CamelBlueprintTestSupport.SPROP_CAMEL_CONTEXT_CREATION_TIMEOUT,
+ syspropValue.toString());
+ CamelBlueprintTestSupport ts = new OverridingTestSupport(someValue);
+ assertEquals(someValue, ts.getCamelContextCreationTimeout());
+ }
+
+ @Test
+ public void testOverrideSystemPropNegative() {
+ final Long someValue = 60000L;
+ final Long syspropValue = (Math.abs(someValue) + 10) * -1;
+ System.setProperty(
+ CamelBlueprintTestSupport.SPROP_CAMEL_CONTEXT_CREATION_TIMEOUT,
+ syspropValue.toString());
+ CamelBlueprintTestSupport ts = new OverridingTestSupport(someValue);
+ assertEquals(someValue, ts.getCamelContextCreationTimeout());
+ }
+
+ private static class DefaultTestSupport extends CamelBlueprintTestSupport {
+
+ }
+
+ private static class OverridingTestSupport extends CamelBlueprintTestSupport {
+
+ private final Long timeout;
+
+ OverridingTestSupport(Long timeout) {
+ this.timeout = timeout;
+ }
+
+ @Override
+ protected Long getCamelContextCreationTimeout() {
+ return timeout;
+ }
+ }
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/CustomIdIssuesTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/CustomIdIssuesTest.java
new file mode 100644
index 00000000..68e567d8
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/CustomIdIssuesTest.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.blueprint;
+
+import org.apache.camel.model.ChoiceDefinition;
+import org.apache.camel.model.FromDefinition;
+import org.apache.camel.model.LogDefinition;
+import org.apache.camel.model.RouteDefinition;
+import org.apache.camel.model.WhenDefinition;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+public class CustomIdIssuesTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/CustomIdIssuesTest.xml";
+ }
+
+ @Test
+ public void testCustomId() {
+ RouteDefinition route = context.getRouteDefinition("myRoute");
+ assertNotNull(route);
+ assertTrue(route.hasCustomIdAssigned());
+
+ FromDefinition from = route.getInput();
+ assertEquals("fromFile", from.getId());
+ assertTrue(from.hasCustomIdAssigned());
+
+ ChoiceDefinition choice = (ChoiceDefinition) route.getOutputs().get(0);
+ assertEquals("myChoice", choice.getId());
+ assertTrue(choice.hasCustomIdAssigned());
+
+ WhenDefinition when = choice.getWhenClauses().get(0);
+ assertTrue(when.hasCustomIdAssigned());
+ assertEquals("UK", when.getId());
+
+ LogDefinition log = (LogDefinition) choice.getOtherwise().getOutputs().get(0);
+ assertFalse(log.hasCustomIdAssigned());
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/DeadLetterChannelLogExhaustedMessageHistoryTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/DeadLetterChannelLogExhaustedMessageHistoryTest.java
new file mode 100644
index 00000000..670f96ba
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/DeadLetterChannelLogExhaustedMessageHistoryTest.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.blueprint;
+
+import org.junit.jupiter.api.Test;
+
+public class DeadLetterChannelLogExhaustedMessageHistoryTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/DeadLetterChannelLogExhaustedMessageHistoryTest.xml";
+ }
+
+ @Test
+ public void testLogExhaustedMessageHistory() throws Exception {
+ template.sendBody("direct:start", "Hello World");
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/DeadLetterChannelOnPrepareTestTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/DeadLetterChannelOnPrepareTestTest.java
new file mode 100644
index 00000000..54be372e
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/DeadLetterChannelOnPrepareTestTest.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.blueprint;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+import org.junit.jupiter.api.Test;
+
+public class DeadLetterChannelOnPrepareTestTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/DeadLetterChannelOnPrepareTestTest.xml";
+ }
+
+ @Test
+ public void testDeadLetterChannelOnPrepare() throws Exception {
+ getMockEndpoint("mock:dead").expectedBodiesReceived("Hello World");
+ getMockEndpoint("mock:dead").expectedHeaderReceived("FailedBecause", "Forced");
+
+ template.sendBody("direct:start", "Hello World");
+
+ assertMockEndpointsSatisfied();
+ }
+
+ public static class MyPrepareProcessor implements Processor {
+
+ @Override
+ public void process(Exchange exchange) throws Exception {
+ Exception cause = exchange.getProperty(Exchange.EXCEPTION_CAUGHT, Exception.class);
+ exchange.getIn().setHeader("FailedBecause", cause.getMessage());
+ }
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/DebugBlueprintTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/DebugBlueprintTest.java
new file mode 100644
index 00000000..d2328dfc
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/DebugBlueprintTest.java
@@ -0,0 +1,81 @@
+/*
+ * 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.blueprint;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.model.ProcessorDefinition;
+import org.junit.jupiter.api.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+// START SNIPPET: example
+// tag::example[]
+// to use camel-test-blueprint, then extend the CamelBlueprintTestSupport class,
+// and add your unit tests methods as shown below.
+public class DebugBlueprintTest extends CamelBlueprintTestSupport {
+
+ private static final Logger LOG = LoggerFactory.getLogger(DebugBlueprintTest.class);
+
+ private boolean debugBeforeMethodCalled;
+ private boolean debugAfterMethodCalled;
+
+ // override this method, and return the location of our Blueprint XML file to be used for testing
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/camelContext.xml";
+ }
+
+ // here we have regular JUnit @Test method
+ @Test
+ public void testRoute() throws Exception {
+
+ // set mock expectations
+ getMockEndpoint("mock:a").expectedMessageCount(1);
+
+ // send a message
+ template.sendBody("direct:start", "World");
+
+ // assert mocks
+ assertMockEndpointsSatisfied();
+
+ // assert on the debugBefore/debugAfter methods below being called as we've enabled the debugger
+ assertTrue(debugBeforeMethodCalled);
+ assertTrue(debugAfterMethodCalled);
+ }
+
+ @Override
+ public boolean isUseDebugger() {
+ // must enable debugger
+ return true;
+ }
+
+ @Override
+ protected void debugBefore(Exchange exchange, org.apache.camel.Processor processor, ProcessorDefinition<?> definition, String id, String label) {
+ LOG.info("Before " + definition + " with body " + exchange.getIn().getBody());
+ debugBeforeMethodCalled = true;
+ }
+
+ @Override
+ protected void debugAfter(Exchange exchange, org.apache.camel.Processor processor, ProcessorDefinition<?> definition, String id, String label, long timeTaken) {
+ LOG.info("After " + definition + " with body " + exchange.getIn().getBody());
+ debugAfterMethodCalled = true;
+ }
+}
+// end::example[]
+// END SNIPPET: example
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/DefaultErrorHandlerLogExhaustedMessageHistoryTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/DefaultErrorHandlerLogExhaustedMessageHistoryTest.java
new file mode 100644
index 00000000..eb00476a
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/DefaultErrorHandlerLogExhaustedMessageHistoryTest.java
@@ -0,0 +1,38 @@
+/*
+ * 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.blueprint;
+
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.fail;
+
+public class DefaultErrorHandlerLogExhaustedMessageHistoryTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/DefaultErrorHandlerLogExhaustedMessageHistoryTest.xml";
+ }
+
+ @Test
+ public void testLogExhaustedMessageHistory() {
+ assertThrows(Exception.class, () -> {
+ template.sendBody("direct:start", "Hello World");
+ });
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/DefaultErrorHandlerOnPrepareTestTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/DefaultErrorHandlerOnPrepareTestTest.java
new file mode 100644
index 00000000..98e8c22c
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/DefaultErrorHandlerOnPrepareTestTest.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.blueprint;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+import org.junit.jupiter.api.Test;
+
+import static org.apache.camel.test.junit5.TestSupport.assertIsInstanceOf;
+import static org.junit.jupiter.api.Assertions.*;
+
+public class DefaultErrorHandlerOnPrepareTestTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/DefaultErrorHandlerOnPrepareTestTest.xml";
+ }
+
+ @Test
+ public void testDefaultErrorHandlerOnPrepare() throws Exception {
+ Exchange out = template.request("direct:start", new Processor() {
+ @Override
+ public void process(Exchange exchange) throws Exception {
+ exchange.getIn().setBody("Hello World");
+ }
+ });
+ assertNotNull(out);
+ assertTrue(out.isFailed(), "Should be failed");
+ assertIsInstanceOf(IllegalArgumentException.class, out.getException());
+ assertEquals("Forced", out.getIn().getHeader("FailedBecause"));
+ }
+
+ public static class MyPrepareProcessor implements Processor {
+
+ @Override
+ public void process(Exchange exchange) throws Exception {
+ Exception cause = exchange.getProperty(Exchange.EXCEPTION_CAUGHT, Exception.class);
+ exchange.getIn().setHeader("FailedBecause", cause.getMessage());
+ }
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/EndpointPropertyTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/EndpointPropertyTest.java
new file mode 100644
index 00000000..6402e02d
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/EndpointPropertyTest.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.blueprint;
+
+import org.apache.camel.blueprint.BlueprintCamelContext;
+import org.apache.camel.component.seda.SedaEndpoint;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+public class EndpointPropertyTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/EndpointPropertyTest.xml";
+ }
+
+ @Test
+ public void testEndpointProperty() throws Exception {
+ getMockEndpoint("mock:result").expectedMessageCount(2);
+ template.sendBody("ref:foo", "Hello World");
+ template.sendBody("ref:bar", "Bye World");
+ assertMockEndpointsSatisfied();
+
+ BlueprintCamelContext blue = context().adapt(BlueprintCamelContext.class);
+
+ SedaEndpoint foo = (SedaEndpoint) blue.getBlueprintContainer().getComponentInstance("foo");
+ assertNotNull(foo);
+ assertEquals(100, foo.getSize());
+ assertEquals(5000, foo.getPollTimeout());
+ assertEquals(true, foo.isBlockWhenFull());
+ assertEquals("seda://foo?blockWhenFull=true&pollTimeout=5000&size=100", foo.getEndpointUri());
+
+ SedaEndpoint bar = (SedaEndpoint) blue.getBlueprintContainer().getComponentInstance("bar");
+ assertNotNull(bar);
+ assertEquals(200, bar.getSize());
+ assertEquals("seda://bar?size=200", bar.getEndpointUri());
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/EventNotifierTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/EventNotifierTest.java
new file mode 100644
index 00000000..bfd4af5b
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/EventNotifierTest.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.blueprint;
+
+import org.junit.jupiter.api.Test;
+
+/**
+ * Tests using custom event notifier
+ */
+public class EventNotifierTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/eventNotifier.xml";
+ }
+
+ @Test
+ public void testCustomEvent() throws Exception {
+ getMockEndpoint("mock:result").expectedMessageCount(1);
+ getMockEndpoint("mock:event").expectedMinimumMessageCount(8);
+
+ template.sendBody("direct:start", "Hello World");
+
+ assertMockEndpointsSatisfied();
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/FilterTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/FilterTest.java
new file mode 100644
index 00000000..a3da0f57
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/FilterTest.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.blueprint;
+
+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;
+
+/**
+ * Tests filtering using Camel Blueprint Test
+ *
+ */
+// START SNIPPET: example
+public class FilterTest extends CamelBlueprintTestSupport {
+
+ @EndpointInject("mock:result")
+ protected MockEndpoint resultEndpoint;
+
+ @Produce("direct:start")
+ protected ProducerTemplate template;
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/filterTest.xml";
+ }
+
+ @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();
+ }
+}
+// END SNIPPET: example
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/Foo.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/Foo.java
new file mode 100644
index 00000000..54b86abf
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/Foo.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.blueprint;
+
+public class Foo {
+
+ private String first;
+ private String last;
+
+ public String getFirst() {
+ return first;
+ }
+
+ public void setFirst(String first) {
+ this.first = first;
+ }
+
+ public String getLast() {
+ return last;
+ }
+
+ public void setLast(String last) {
+ this.last = last;
+ }
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/FooBar.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/FooBar.java
new file mode 100644
index 00000000..810243d5
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/FooBar.java
@@ -0,0 +1,27 @@
+/*
+ * 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.blueprint;
+
+public class FooBar {
+
+ private String greeting = "Hello";
+
+ public String hello(String name) {
+ return greeting + " " + name;
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/FooService.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/FooService.java
new file mode 100644
index 00000000..381ba4cc
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/FooService.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.blueprint;
+
+import org.apache.camel.Consume;
+import org.apache.camel.Produce;
+import org.apache.camel.ProducerTemplate;
+
+/**
+ *
+ */
+public class FooService {
+ private String fooEndpoint;
+ private String barEndpoint;
+ @Produce
+ private ProducerTemplate bar;
+
+ public String getFooEndpoint() {
+ return fooEndpoint;
+ }
+
+ public void setFooEndpoint(String fooEndpoint) {
+ this.fooEndpoint = fooEndpoint;
+ }
+
+ public String getBarEndpoint() {
+ return barEndpoint;
+ }
+
+ public void setBarEndpoint(String barEndpoint) {
+ this.barEndpoint = barEndpoint;
+ }
+
+ @Consume
+ public void onFoo(String input) {
+ bar.sendBody(input);
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/IEcho.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/IEcho.java
new file mode 100644
index 00000000..79a869c9
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/IEcho.java
@@ -0,0 +1,23 @@
+/*
+ * 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.blueprint;
+
+public interface IEcho {
+
+ String echo(String hello);
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/IgnoreDatatypesTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/IgnoreDatatypesTest.java
new file mode 100644
index 00000000..b3af3a38
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/IgnoreDatatypesTest.java
@@ -0,0 +1,45 @@
+/*
+ * 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.blueprint;
+
+import org.junit.jupiter.api.Test;
+
+/**
+ *
+ */
+public class IgnoreDatatypesTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/ignoreDatatypes.xml";
+ }
+
+ @Override
+ protected String getBundleDirectives() {
+ return "blueprint.aries.xml-validation:=false";
+ }
+
+ @Test
+ public void testConfigAdmin() throws Exception {
+ getMockEndpoint("mock:result").expectedBodiesReceived("Hello World");
+
+ template.sendBody("direct:start", "World");
+
+ assertMockEndpointsSatisfied();
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/InflightRepositoryRefTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/InflightRepositoryRefTest.java
new file mode 100644
index 00000000..3cf7196b
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/InflightRepositoryRefTest.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.blueprint;
+
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+public class InflightRepositoryRefTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/inflightRepositoryRefTest.xml";
+ }
+
+ @Test
+ public void testEndpointConfiguration() throws Exception {
+ assertTrue(context.getInflightRepository() instanceof MyInflightRepository,
+ "Get a wrong inflight repository");
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/IsMockEndpointJUnit4Test.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/IsMockEndpointJUnit4Test.java
new file mode 100644
index 00000000..43280496
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/IsMockEndpointJUnit4Test.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.blueprint;
+
+import org.apache.camel.EndpointInject;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+public class IsMockEndpointJUnit4Test extends CamelBlueprintTestSupport {
+
+ @EndpointInject (value = "mock:seda:result")
+ private MockEndpoint mockSeda;
+
+ @EndpointInject (value = "mock:bar")
+ private MockEndpoint mockBar;
+
+ @EndpointInject (value = "mock:baz")
+ private MockEndpoint mockBaz;
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/IsMockEndpoints.xml";
+ }
+
+ @Override
+ public String isMockEndpoints() {
+ return "*";
+ }
+
+
+ @Test
+ public void testMockAllEndpoints() throws Exception {
+ mockSeda.expectedBodiesReceived("bar");
+ mockBar.expectedBodiesReceived("bar");
+
+ template.sendBody("direct:foo", "Hello World");
+
+ assertNotNull(context.hasEndpoint("mock:seda:result"));
+ assertNotNull(context.hasEndpoint("mock:baz"));
+ assertMockEndpointsSatisfied();
+ }
+
+ @Test
+ public void testMockBar() throws Exception {
+ mockBar.expectedBodiesReceived("bar");
+
+ template.sendBody("direct:foo", "Hello World");
+
+ assertNotNull(context.hasEndpoint("mock:bar"));
+ assertMockEndpointsSatisfied();
+ }
+
+ @Test
+ public void testMockBaz() throws Exception {
+ mockBaz.expectedBodiesReceived("baz");
+
+ template.sendBody("direct:foo", "Hello World");
+
+ assertNotNull(context.hasEndpoint("mock:baz"));
+ assertMockEndpointsSatisfied();
+ }
+}
\ No newline at end of file
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/LoadPropertiesFromBeansTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/LoadPropertiesFromBeansTest.java
new file mode 100644
index 00000000..19cb6a15
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/LoadPropertiesFromBeansTest.java
@@ -0,0 +1,38 @@
+/*
+ * 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.blueprint;
+
+import org.junit.jupiter.api.Test;
+
+public class LoadPropertiesFromBeansTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/loadPropertiesFromBeans.xml";
+ }
+
+ @Test
+ public void testConfigAdmin() throws Exception {
+ getMockEndpoint("mock:result").expectedBodiesReceived("Hello World");
+
+ template.sendBody("direct:start", "World");
+
+ assertMockEndpointsSatisfied();
+ }
+
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/MockEndpointsAndSkipTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/MockEndpointsAndSkipTest.java
new file mode 100644
index 00000000..50c40132
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/MockEndpointsAndSkipTest.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.blueprint;
+
+import org.junit.jupiter.api.Test;
+
+public class MockEndpointsAndSkipTest extends CamelBlueprintTestSupport {
+
+ @Override
+ public String isMockEndpointsAndSkip() {
+ return "seda*";
+ }
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/MockEndpointsAndSkipTest.xml";
+ }
+
+ @Test
+ public void testHelloWorld() throws Exception {
+ getMockEndpoint("mock:seda:foo").expectedBodiesReceived("Hello World");
+
+ template.sendBody("direct:start", "Hello World");
+
+ assertMockEndpointsSatisfied();
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/MultipleCamelContextsTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/MultipleCamelContextsTest.java
new file mode 100644
index 00000000..d093cdda
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/MultipleCamelContextsTest.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.blueprint;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.junit.jupiter.api.Test;
+
+import static org.apache.camel.test.junit5.TestSupport.assertStringContains;
+
+public class MultipleCamelContextsTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/multipeCamelContexts.xml";
+ }
+
+ @Override
+ protected String getCamelContextFilter() {
+ return "(camel.context.name=secondCamelContext)";
+ }
+
+ @Test
+ public void testSecondCamelContext() throws Exception {
+ MockEndpoint result = getMockEndpoint("mock:result");
+ result.expectedMessageCount(1);
+
+ template.sendBody("direct:second", "World");
+
+ assertMockEndpointsSatisfied();
+
+ for (Exchange exchange : result.getExchanges()) {
+ assertStringContains(exchange.getIn().getBody(String.class), "from second context");
+ }
+ }
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/MyCoolBean.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/MyCoolBean.java
new file mode 100644
index 00000000..6a174d51
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/MyCoolBean.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.blueprint;
+
+/**
+ *
+ */
+public class MyCoolBean {
+
+ private String say;
+ private String echo;
+
+ public String getSay() {
+ return say;
+ }
+
+ public void setSay(String say) {
+ this.say = say;
+ }
+
+ public String getEcho() {
+ return echo;
+ }
+
+ public void setEcho(String echo) {
+ this.echo = echo;
+ }
+
+ public String saySomething(String s) {
+ return say + " " + s;
+ }
+
+ public String echoSomething(String s) {
+ return echo + " " + s + echo + " " + s;
+ }
+
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/MyInflightRepository.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/MyInflightRepository.java
new file mode 100644
index 00000000..d466af53
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/MyInflightRepository.java
@@ -0,0 +1,23 @@
+/*
+ * 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.blueprint;
+
+import org.apache.camel.impl.engine.DefaultInflightRepository;
+
+public class MyInflightRepository extends DefaultInflightRepository {
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/MyProducer.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/MyProducer.java
new file mode 100644
index 00000000..3f8fa4f4
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/MyProducer.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.blueprint;
+
+import org.apache.camel.EndpointInject;
+import org.apache.camel.ProducerTemplate;
+
+/**
+ *
+ */
+public class MyProducer {
+
+ @EndpointInject("ref:testEndpoint")
+ private ProducerTemplate endpoint;
+
+ public void doSomething(String body) {
+ endpoint.sendBody(body);
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/MyProperties.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/MyProperties.java
new file mode 100644
index 00000000..3bcd16ca
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/MyProperties.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.blueprint;
+
+import java.util.Properties;
+
+public class MyProperties extends Properties {
+
+ private static final long serialVersionUID = -2082205766653164835L;
+
+ public MyProperties() {
+ setProperty("greeting", "Hello");
+ setProperty("hello", "Hello Camel");
+ setProperty("destination", "mock:result");
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/MyService.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/MyService.java
new file mode 100644
index 00000000..2bd1b430
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/MyService.java
@@ -0,0 +1,24 @@
+/*
+ * 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.blueprint;
+
+public class MyService {
+
+ public String echo(String hello) {
+ return hello + hello;
+ }
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/MyShutdownStrategy.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/MyShutdownStrategy.java
new file mode 100644
index 00000000..6573406f
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/MyShutdownStrategy.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.blueprint;
+
+import org.apache.camel.impl.engine.DefaultShutdownStrategy;
+
+public class MyShutdownStrategy extends DefaultShutdownStrategy {
+
+ @Override
+ public void setTimeout(long timeout) {
+ // only accept if its 5, as camel-test-blueprint sets a default timeout to 10 sec
+ // and we want to unit test that we can change that to 5 seconds
+ if (timeout == 5) {
+ super.setTimeout(timeout);
+ }
+ }
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/OnExceptionOccurredProcessorOnExceptionTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/OnExceptionOccurredProcessorOnExceptionTest.java
new file mode 100644
index 00000000..0048c8a3
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/OnExceptionOccurredProcessorOnExceptionTest.java
@@ -0,0 +1,59 @@
+/*
+ * 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.blueprint;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+public class OnExceptionOccurredProcessorOnExceptionTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/OnExceptionOccurredProcessorOnExceptionTest.xml";
+ }
+
+ @Test
+ public void testOnExceptionOccurred() throws Exception {
+ getMockEndpoint("mock:dead").expectedMessageCount(1);
+
+ template.sendBody("direct:start", "Hello World");
+
+ assertMockEndpointsSatisfied();
+
+ MyProcessor myProcessor = context.getRegistry().lookupByNameAndType("myProcessor", MyProcessor.class);
+ // 1 = first time + 3 redelivery attempts
+ assertEquals(1 + 3, myProcessor.getInvoked());
+ }
+
+ public static class MyProcessor implements Processor {
+
+ private int invoked;
+
+ @Override
+ public void process(Exchange exchange) throws Exception {
+ invoked++;
+ }
+
+ public int getInvoked() {
+ return invoked;
+ }
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/OnExceptionOccurredProcessorTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/OnExceptionOccurredProcessorTest.java
new file mode 100644
index 00000000..539b0b6e
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/OnExceptionOccurredProcessorTest.java
@@ -0,0 +1,59 @@
+/*
+ * 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.blueprint;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+public class OnExceptionOccurredProcessorTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/OnExceptionOccurredProcessorTest.xml";
+ }
+
+ @Test
+ public void testOnExceptionOccurred() throws Exception {
+ getMockEndpoint("mock:dead").expectedMessageCount(1);
+
+ template.sendBody("direct:start", "Hello World");
+
+ assertMockEndpointsSatisfied();
+
+ MyProcessor myProcessor = context.getRegistry().lookupByNameAndType("myProcessor", MyProcessor.class);
+ // 1 = first time + 3 redelivery attempts
+ assertEquals(1 + 3, myProcessor.getInvoked());
+ }
+
+ public static class MyProcessor implements Processor {
+
+ private int invoked;
+
+ @Override
+ public void process(Exchange exchange) throws Exception {
+ invoked++;
+ }
+
+ public int getInvoked() {
+ return invoked;
+ }
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/OnExceptionRouteIdRouteBuilder.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/OnExceptionRouteIdRouteBuilder.java
new file mode 100644
index 00000000..77318a07
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/OnExceptionRouteIdRouteBuilder.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.blueprint;
+
+import org.apache.camel.builder.RouteBuilder;
+
+public class OnExceptionRouteIdRouteBuilder extends RouteBuilder {
+
+ @Override
+ public void configure() throws Exception {
+ onException(Exception.class).id("myError")
+ .maximumRedeliveries(0)
+ .handled(true)
+ .setHeader("error", constant("true"))
+ .end()
+ .stop();
+
+ from("direct:foo").routeId("foo")
+ .to("mock:foo")
+ .end();
+ }
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/OnExceptionRouteIdTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/OnExceptionRouteIdTest.java
new file mode 100644
index 00000000..008bd7da
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/OnExceptionRouteIdTest.java
@@ -0,0 +1,45 @@
+/*
+ * 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.blueprint;
+
+import org.apache.camel.model.RouteDefinition;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+public class OnExceptionRouteIdTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/OnExceptionRouteIdTest.xml";
+ }
+
+ @Test
+ public void testOnExceptionRouteId() throws Exception {
+ getMockEndpoint("mock:error").expectedMessageCount(0);
+ getMockEndpoint("mock:foo").expectedMessageCount(1);
+
+ template.sendBody("direct:foo", "Hello World");
+
+ assertMockEndpointsSatisfied();
+
+ RouteDefinition route = context.getRouteDefinition("foo");
+ assertNotNull(route);
+ assertEquals("foo", route.getId());
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/PropertiesComponentFunctionTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/PropertiesComponentFunctionTest.java
new file mode 100644
index 00000000..d7eed1ea
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/PropertiesComponentFunctionTest.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.blueprint;
+
+import org.apache.camel.spi.PropertiesFunction;
+import org.junit.jupiter.api.Test;
+
+public class PropertiesComponentFunctionTest extends CamelBlueprintTestSupport {
+
+ public static final class MyFunction implements PropertiesFunction {
+
+ @Override
+ public String getName() {
+ return "beer";
+ }
+
+ @Override
+ public String apply(String remainder) {
+ return "mock:" + remainder.toLowerCase();
+ }
+ }
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/PropertiesComponentFunctionTest.xml";
+ }
+
+ @Test
+ public void testFunction() throws Exception {
+ getMockEndpoint("mock:foo").expectedMessageCount(1);
+ getMockEndpoint("mock:bar").expectedMessageCount(1);
+
+ template.sendBody("direct:start", "Hello World");
+
+ assertMockEndpointsSatisfied();
+ }
+
+}
+
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/PropertyInjectTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/PropertyInjectTest.java
new file mode 100644
index 00000000..154d981d
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/PropertyInjectTest.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.blueprint;
+
+import org.junit.jupiter.api.Test;
+
+import static org.apache.camel.test.junit5.TestSupport.isPlatform;
+
+public class PropertyInjectTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/propertyInjectTest.xml";
+ }
+
+ @Test
+ public void testPropertyInject() throws Exception {
+ if (isPlatform("windows")) {
+ // need a bit slack
+ Thread.sleep(1000);
+ }
+
+ getMockEndpoint("mock:result").expectedBodiesReceived("Hello");
+
+ template.sendBody("seda:start", "Camel");
+
+ assertMockEndpointsSatisfied();
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ProxyTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ProxyTest.java
new file mode 100644
index 00000000..2f00af0e
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ProxyTest.java
@@ -0,0 +1,37 @@
+/*
+ * 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.blueprint;
+
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+public class ProxyTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/proxy.xml";
+ }
+
+ @Test
+ public void testProxy() throws Exception {
+ IEcho my = context.getRegistry().lookupByNameAndType("myProxy", IEcho.class);
+ String out = my.echo("Camel");
+ assertEquals("Bye Camel", out);
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ShutdownStrategyTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ShutdownStrategyTest.java
new file mode 100644
index 00000000..4b5518b3
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ShutdownStrategyTest.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.blueprint;
+
+import org.junit.jupiter.api.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import static org.apache.camel.test.junit5.TestSupport.assertIsInstanceOf;
+import static org.junit.jupiter.api.Assertions.*;
+
+public class ShutdownStrategyTest extends CamelBlueprintTestSupport {
+
+ private static final Logger LOG = LoggerFactory.getLogger(ShutdownStrategyTest.class);
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/shutdown.xml";
+ }
+
+ @Test
+ public void testShutdown() throws Exception {
+ LOG.info("Using shutdown strategy {}", context.getShutdownStrategy());
+ assertIsInstanceOf(MyShutdownStrategy.class, context.getShutdownStrategy());
+
+ assertEquals(5, context.getShutdownStrategy().getTimeout());
+ }
+}
+
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/SimpleMockTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/SimpleMockTest.java
new file mode 100644
index 00000000..22022cf2
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/SimpleMockTest.java
@@ -0,0 +1,37 @@
+/*
+ * 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.blueprint;
+
+import org.junit.jupiter.api.Test;
+
+public class SimpleMockTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/simpleMockTest.xml";
+ }
+
+ @Test
+ public void testHelloWorld() throws Exception {
+ getMockEndpoint("mock:result").expectedBodiesReceived("Hello World");
+
+ template.sendBody("direct:start", "Hello World");
+
+ assertMockEndpointsSatisfied();
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/SimpleTransformAnnotationsBlueprintTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/SimpleTransformAnnotationsBlueprintTest.java
new file mode 100644
index 00000000..d449d28b
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/SimpleTransformAnnotationsBlueprintTest.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.blueprint;
+
+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;
+
+/**
+ * Test class that demonstrates the fundamental interactions going on to verify that a route behaves as it should.
+ */
+public class SimpleTransformAnnotationsBlueprintTest extends CamelBlueprintTestSupport {
+
+ @Produce("direct:in")
+ private ProducerTemplate producerTemplate;
+
+ @EndpointInject("mock:out")
+ private MockEndpoint mockOut;
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/simpleTransform-context.xml,"
+ + "org/apache/camel/test/blueprint/simpleTransform-properties-context.xml";
+ }
+
+ @Test
+ public void testPayloadIsTransformed() throws InterruptedException {
+ mockOut.setExpectedMessageCount(1);
+ mockOut.message(0).body().isEqualTo("Modified: Cheese");
+
+ producerTemplate.sendBody("Cheese");
+
+ assertMockEndpointsSatisfied();
+ }
+
+ @Test
+ public void testPayloadIsTransformedAgain() throws InterruptedException {
+ mockOut.setExpectedMessageCount(1);
+ mockOut.message(0).body().isEqualTo("Modified: Foo");
+
+ producerTemplate.sendBody("Foo");
+
+ assertMockEndpointsSatisfied();
+ }
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/SimpleTransformBlueprintTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/SimpleTransformBlueprintTest.java
new file mode 100644
index 00000000..4dc406be
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/SimpleTransformBlueprintTest.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.blueprint;
+
+import org.apache.camel.component.mock.MockEndpoint;
+import org.junit.jupiter.api.Test;
+
+/**
+ * Test class that demonstrates the fundamental interactions going on to verify that a route behaves as it should.
+ */
+public class SimpleTransformBlueprintTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/simpleTransform-context.xml,"
+ + "org/apache/camel/test/blueprint/simpleTransform-properties-context.xml";
+ }
+
+ @Test
+ public void testPayloadIsTransformed() throws InterruptedException {
+ MockEndpoint mockOut = getMockEndpoint("mock:out");
+ mockOut.setExpectedMessageCount(1);
+ mockOut.message(0).body().isEqualTo("Modified: Cheese");
+
+ template.sendBody("direct:in", "Cheese");
+
+ assertMockEndpointsSatisfied();
+ }
+
+ @Test
+ public void testPayloadIsTransformedAgain() throws InterruptedException {
+ MockEndpoint mockOut = getMockEndpoint("mock:out");
+ mockOut.setExpectedMessageCount(1);
+ mockOut.message(0).body().isEqualTo("Modified: Foo");
+
+ template.sendBody("direct:in", "Foo");
+
+ assertMockEndpointsSatisfied();
+ }
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/SimpleWeaveAddMockLastTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/SimpleWeaveAddMockLastTest.java
new file mode 100644
index 00000000..856db861
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/SimpleWeaveAddMockLastTest.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.blueprint;
+
+import org.apache.camel.builder.AdviceWith;
+import org.apache.camel.builder.AdviceWithRouteBuilder;
+import org.junit.jupiter.api.Test;
+
+public class SimpleWeaveAddMockLastTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/SimpleWeaveAddMockLastTest.xml";
+ }
+
+ @Override
+ public boolean isUseAdviceWith() {
+ return true;
+ }
+
+ @Test
+ public void testWeaveAddMockLast() throws Exception {
+ AdviceWith.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();
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/SupervisingRouteControllerTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/SupervisingRouteControllerTest.java
new file mode 100644
index 00000000..11bf53b3
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/SupervisingRouteControllerTest.java
@@ -0,0 +1,118 @@
+/*
+ * 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.blueprint;
+
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+
+import org.apache.camel.Consumer;
+import org.apache.camel.Endpoint;
+import org.apache.camel.Processor;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.component.seda.SedaComponent;
+import org.apache.camel.component.seda.SedaConsumer;
+import org.apache.camel.component.seda.SedaEndpoint;
+import org.apache.camel.spi.SupervisingRouteController;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+public class SupervisingRouteControllerTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/BlueprintSupervisingRouteControllerTest.xml";
+ }
+
+ @Test
+ public void testSupervising() throws Exception {
+ MockEndpoint mock = context.getEndpoint("mock:foo", MockEndpoint.class);
+ mock.expectedMinimumMessageCount(3);
+
+ MockEndpoint mock2 = context.getEndpoint("mock:cheese", MockEndpoint.class);
+ mock2.expectedMessageCount(0);
+
+ MockEndpoint mock3 = context.getEndpoint("mock:cake", MockEndpoint.class);
+ mock3.expectedMessageCount(0);
+
+ MockEndpoint mock4 = context.getEndpoint("mock:bar", MockEndpoint.class);
+ mock4.expectedMessageCount(0);
+
+ MockEndpoint.assertIsSatisfied(5, TimeUnit.SECONDS, mock, mock2, mock3, mock4);
+
+ assertEquals("Started", context.getRouteController().getRouteStatus("foo").toString());
+ // cheese was not able to start
+ assertEquals("Stopped", context.getRouteController().getRouteStatus("cheese").toString());
+ // cake was not able to start
+ assertEquals("Stopped", context.getRouteController().getRouteStatus("cake").toString());
+
+ SupervisingRouteController src = context.getRouteController().adapt(SupervisingRouteController.class);
+
+ Throwable e = src.getRestartException("cake");
+ assertNotNull(e);
+ assertEquals("Cannot start", e.getMessage());
+ assertTrue(e instanceof IllegalArgumentException);
+
+ // bar is no auto startup
+ assertEquals("Stopped", context.getRouteController().getRouteStatus("bar").toString());
+ }
+
+ public static class MyJmsComponent extends SedaComponent {
+
+ @Override
+ protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
+ return new MyJmsEndpoint(remaining);
+ }
+ }
+
+ public static class MyJmsEndpoint extends SedaEndpoint {
+
+ private String name;
+
+ public MyJmsEndpoint(String name) {
+ super();
+ this.name = name;
+ }
+
+ @Override
+ public Consumer createConsumer(Processor processor) throws Exception {
+ return new MyJmsConsumer(this, processor);
+ }
+
+ @Override
+ protected String createEndpointUri() {
+ return "jms:" + name;
+ }
+ }
+
+ public static class MyJmsConsumer extends SedaConsumer {
+
+ private int counter;
+
+ public MyJmsConsumer(SedaEndpoint endpoint, Processor processor) {
+ super(endpoint, processor);
+ }
+
+ @Override
+ protected void doStart() throws Exception {
+ if (counter++ < 5) {
+ throw new IllegalArgumentException("Cannot start");
+ }
+ }
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ThreadNamePatternTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ThreadNamePatternTest.java
new file mode 100644
index 00000000..3f16122d
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/ThreadNamePatternTest.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.blueprint;
+
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+public class ThreadNamePatternTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/threadNamePatternTest.xml";
+ }
+
+ @Test
+ public void testThreadNamePattern() throws Exception {
+ assertEquals("Riding the thread #counter#", context.getExecutorServiceManager().getThreadNamePattern());
+
+ getMockEndpoint("mock:result").expectedMessageCount(1);
+
+ template.sendBody("seda:start", "Hello World");
+
+ assertMockEndpointsSatisfied();
+ }
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/TypeConverterRegistryStatisticsEnabledTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/TypeConverterRegistryStatisticsEnabledTest.java
new file mode 100644
index 00000000..4c71826e
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/TypeConverterRegistryStatisticsEnabledTest.java
@@ -0,0 +1,70 @@
+/*
+ * 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.blueprint;
+
+import org.apache.camel.spi.TypeConverterRegistry;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+public class TypeConverterRegistryStatisticsEnabledTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/typeConverterRegistryStatisticsEnabledTest.xml";
+ }
+
+ @Test
+ public void testTypeConverterRegistry() throws Exception {
+ getMockEndpoint("mock:a").expectedMessageCount(2);
+
+ template.sendBody("direct:start", "3");
+ template.sendBody("direct:start", "7");
+
+ assertMockEndpointsSatisfied();
+
+ TypeConverterRegistry reg = context.getTypeConverterRegistry();
+ assertTrue(reg.getStatistics().isStatisticsEnabled(), "Should be enabled");
+
+ Long failed = reg.getStatistics().getFailedCounter();
+ assertEquals(0, failed.intValue());
+ Long miss = reg.getStatistics().getMissCounter();
+ assertEquals(0, miss.intValue());
+
+ try {
+ template.sendBody("direct:start", "foo");
+ fail("Should have thrown exception");
+ } catch (Exception e) {
+ // expected
+ }
+
+ // should now have a failed
+ failed = reg.getStatistics().getFailedCounter();
+ assertEquals(1, failed.intValue());
+ miss = reg.getStatistics().getMissCounter();
+ assertEquals(0, miss.intValue());
+
+ // reset
+ reg.getStatistics().reset();
+
+ failed = reg.getStatistics().getFailedCounter();
+ assertEquals(0, failed.intValue());
+ miss = reg.getStatistics().getMissCounter();
+ assertEquals(0, miss.intValue());
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/builder/AbstractRouteBuilder.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/builder/AbstractRouteBuilder.java
new file mode 100644
index 00000000..0909c2bf
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/builder/AbstractRouteBuilder.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.blueprint.builder;
+
+import org.apache.camel.builder.RouteBuilder;
+
+public abstract class AbstractRouteBuilder extends RouteBuilder {
+
+ protected abstract String getResult();
+
+ @Override
+ public void configure() throws Exception {
+ from("direct:start").to(getResult());
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/builder/my/MyRouteBuilder.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/builder/my/MyRouteBuilder.java
new file mode 100644
index 00000000..b582d0a5
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/builder/my/MyRouteBuilder.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.blueprint.builder.my;
+
+import org.apache.camel.test.blueprint.builder.AbstractRouteBuilder;
+
+public class MyRouteBuilder extends AbstractRouteBuilder {
+
+ @Override
+ protected String getResult() {
+ return "mock:result";
+ }
+
+
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/cloud/ServiceCallConfigurationTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/cloud/ServiceCallConfigurationTest.java
new file mode 100644
index 00000000..bbe5c71e
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/cloud/ServiceCallConfigurationTest.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.blueprint.cloud;
+
+import org.apache.camel.model.cloud.ServiceCallConfigurationDefinition;
+import org.apache.camel.model.cloud.StaticServiceCallServiceDiscoveryConfiguration;
+import org.apache.camel.test.blueprint.CamelBlueprintTestSupport;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+public class ServiceCallConfigurationTest extends CamelBlueprintTestSupport {
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/cloud/ServiceCallConfigurationTest.xml";
+ }
+
+ @Test
+ public void testServiceDiscoveryConfiguration() {
+ ServiceCallConfigurationDefinition conf1 = context.getServiceCallConfiguration("conf1");
+ assertNotNull(conf1, "No ServiceCallConfiguration (1)");
+ assertNotNull(conf1.getServiceDiscoveryConfiguration(), "No ServiceDiscoveryConfiguration (1)");
+
+ StaticServiceCallServiceDiscoveryConfiguration discovery1 = (StaticServiceCallServiceDiscoveryConfiguration)conf1.getServiceDiscoveryConfiguration();
+ assertEquals(1, discovery1.getServers().size());
+ assertEquals("localhost:9091", discovery1.getServers().get(0));
+
+ ServiceCallConfigurationDefinition conf2 = context.getServiceCallConfiguration("conf2");
+ assertNotNull(conf2, "No ServiceCallConfiguration (2)");
+ assertNotNull(conf2.getServiceDiscoveryConfiguration(), "No ServiceDiscoveryConfiguration (2)");
+
+ StaticServiceCallServiceDiscoveryConfiguration discovery2 = (StaticServiceCallServiceDiscoveryConfiguration)conf2.getServiceDiscoveryConfiguration();
+ assertEquals(2, discovery2.getServers().size());
+ assertEquals("localhost:9092", discovery2.getServers().get(0));
+ assertEquals("localhost:9093,localhost:9094", discovery2.getServers().get(1));
+ }
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/cloud/ServiceCallFilterTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/cloud/ServiceCallFilterTest.java
new file mode 100644
index 00000000..dcdd2ceb
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/cloud/ServiceCallFilterTest.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.blueprint.cloud;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.cloud.ServiceCallConstants;
+import org.apache.camel.test.blueprint.CamelBlueprintTestSupport;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+public class ServiceCallFilterTest extends CamelBlueprintTestSupport {
+ @Test
+ public void testServiceFilter() throws Exception {
+ Exchange result;
+
+ result = template.request("direct:start", e -> {
+ return;
+ });
+
+ assertHeader(result, ServiceCallConstants.SERVICE_HOST, "host1");
+ assertHeader(result, ServiceCallConstants.SERVICE_PORT, 9093);
+
+ result = template.request("direct:start", e -> {
+ return;
+ });
+
+ assertHeader(result, ServiceCallConstants.SERVICE_HOST, "host4");
+ assertHeader(result, ServiceCallConstants.SERVICE_PORT, 9094);
+ }
+
+ // *********************
+ // Helpers
+ // *********************
+
+ private void assertHeader(Exchange exchange, String header, Object expectedValue) {
+ assertNotNull(exchange);
+ assertTrue(exchange.getIn().getHeaders().containsKey(header));
+ assertEquals(expectedValue, exchange.getIn().getHeader(header));
+ }
+
+ // *********************
+ // Blueprint
+ // *********************
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/cloud/ServiceCallFilterTest.xml";
+ }
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/component/rest/DummyRestConsumerFactory.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/component/rest/DummyRestConsumerFactory.java
new file mode 100644
index 00000000..980e5abf
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/component/rest/DummyRestConsumerFactory.java
@@ -0,0 +1,48 @@
+/*
+ * 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.blueprint.component.rest;
+
+import java.util.Map;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.Consumer;
+import org.apache.camel.Processor;
+import org.apache.camel.component.seda.SedaEndpoint;
+import org.apache.camel.spi.RestConfiguration;
+import org.apache.camel.spi.RestConsumerFactory;
+import org.apache.camel.support.ClassicUuidGenerator;
+
+public class DummyRestConsumerFactory implements RestConsumerFactory {
+
+ @Override
+ public Consumer createConsumer(CamelContext camelContext, Processor processor, String verb, String basePath, String uriTemplate,
+ String consumes, String produces, RestConfiguration configuration, Map<String, Object> parameters) throws Exception {
+ // just use a seda endpoint for testing purpose
+ String id;
+ if (uriTemplate != null) {
+ id = ClassicUuidGenerator.generateSanitizedId(basePath + uriTemplate);
+ } else {
+ id = ClassicUuidGenerator.generateSanitizedId(basePath);
+ }
+ // remove leading dash as we add that ourselves
+ if (id.startsWith("-")) {
+ id = id.substring(1);
+ }
+ SedaEndpoint seda = camelContext.getEndpoint("seda:" + verb + "-" + id, SedaEndpoint.class);
+ return seda.createConsumer(processor);
+ }
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/component/rest/FromRestConfigurationTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/component/rest/FromRestConfigurationTest.java
new file mode 100644
index 00000000..1ed2ea29
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/component/rest/FromRestConfigurationTest.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.blueprint.component.rest;
+
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+public class FromRestConfigurationTest extends FromRestGetTest {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/component/rest/FromRestConfigurationTest.xml";
+ }
+
+ @Override
+ @Test
+ public void testFromRestModel() throws Exception {
+ super.testFromRestModel();
+
+ assertEquals("dummy-rest", context.getRestConfiguration().getComponent());
+ assertEquals("localhost", context.getRestConfiguration().getHost());
+ assertEquals(9090, context.getRestConfiguration().getPort());
+ assertEquals("bar", context.getRestConfiguration().getComponentProperties().get("foo"));
+ assertEquals("stuff", context.getRestConfiguration().getComponentProperties().get("other"));
+ assertEquals("200", context.getRestConfiguration().getEndpointProperties().get("size"));
+ assertEquals("1000", context.getRestConfiguration().getConsumerProperties().get("pollTimeout"));
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/component/rest/FromRestGetInterceptTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/component/rest/FromRestGetInterceptTest.java
new file mode 100644
index 00000000..da38afb2
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/component/rest/FromRestGetInterceptTest.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.blueprint.component.rest;
+
+import org.apache.camel.test.blueprint.CamelBlueprintTestSupport;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+public class FromRestGetInterceptTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/component/rest/FromRestGetInterceptTest.xml";
+ }
+
+ @Test
+ public void testFromRestModel() throws Exception {
+ getMockEndpoint("mock:hello").expectedMessageCount(1);
+ getMockEndpoint("mock:bar").expectedMessageCount(1);
+ getMockEndpoint("mock:intercept").expectedMessageCount(4);
+
+ String out = template.requestBody("seda:get-say-hello", "I was here", String.class);
+ assertEquals("Bye World", out);
+
+ assertMockEndpointsSatisfied();
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/component/rest/FromRestGetOnExceptionTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/component/rest/FromRestGetOnExceptionTest.java
new file mode 100644
index 00000000..3a460b28
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/component/rest/FromRestGetOnExceptionTest.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.blueprint.component.rest;
+
+import org.apache.camel.test.blueprint.CamelBlueprintTestSupport;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+public class FromRestGetOnExceptionTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/component/rest/FromRestGetOnExceptionTest.xml";
+ }
+
+ @Test
+ public void testFromRestModel() throws Exception {
+ getMockEndpoint("mock:hello").expectedMessageCount(1);
+
+ String out = template.requestBody("seda:get-say-hello", "I was here", String.class);
+ assertEquals("Handled the error", out);
+
+ assertMockEndpointsSatisfied();
+ }
+
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/component/rest/FromRestGetRouteOnExceptionTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/component/rest/FromRestGetRouteOnExceptionTest.java
new file mode 100644
index 00000000..db13b863
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/component/rest/FromRestGetRouteOnExceptionTest.java
@@ -0,0 +1,26 @@
+/*
+ * 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.blueprint.component.rest;
+
+public class FromRestGetRouteOnExceptionTest extends FromRestGetOnExceptionTest {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/component/rest/FromRestGetRouteOnExceptionTest.xml";
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/component/rest/FromRestGetTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/component/rest/FromRestGetTest.java
new file mode 100644
index 00000000..3510cb75
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/component/rest/FromRestGetTest.java
@@ -0,0 +1,103 @@
+/*
+ * 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.blueprint.component.rest;
+
+import java.util.Arrays;
+
+import org.apache.camel.model.ToDefinition;
+import org.apache.camel.model.rest.CollectionFormat;
+import org.apache.camel.model.rest.RestDefinition;
+import org.apache.camel.model.rest.RestParamType;
+import org.apache.camel.test.blueprint.CamelBlueprintTestSupport;
+import org.junit.jupiter.api.Test;
+
+import static org.apache.camel.test.junit5.TestSupport.assertIsInstanceOf;
+import static org.junit.jupiter.api.Assertions.*;
+
+public class FromRestGetTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/component/rest/FromRestGetTest.xml";
+ }
+
+ protected int getExpectedNumberOfRoutes() {
+ return 2 + 3;
+ }
+
+ @Test
+ public void testFromRestModel() throws Exception {
+ assertEquals(getExpectedNumberOfRoutes(), context.getRoutes().size());
+
+ assertEquals(2, context.getRestDefinitions().size());
+ RestDefinition rest = context.getRestDefinitions().get(0);
+ assertNotNull(rest);
+ assertEquals("/say/hello", rest.getPath());
+ assertEquals(1, rest.getVerbs().size());
+ ToDefinition to = assertIsInstanceOf(ToDefinition.class, rest.getVerbs().get(0).getTo());
+ assertEquals("direct:hello", to.getUri());
+
+ rest = context.getRestDefinitions().get(1);
+ assertNotNull(rest);
+ assertEquals("/say/bye", rest.getPath());
+ assertEquals(2, rest.getVerbs().size());
+ assertEquals("application/json", rest.getVerbs().get(0).getConsumes());
+
+ assertEquals(2, rest.getVerbs().get(0).getParams().size());
+ assertEquals(RestParamType.header, rest.getVerbs().get(0).getParams().get(0).getType());
+ assertEquals(RestParamType.query, rest.getVerbs().get(0).getParams().get(1).getType());
+
+ assertEquals("header param description1", rest.getVerbs().get(0).getParams().get(0).getDescription());
+ assertEquals("header param description2", rest.getVerbs().get(0).getParams().get(1).getDescription());
+
+ assertEquals("integer", rest.getVerbs().get(0).getParams().get(0).getDataType());
+ assertEquals("string", rest.getVerbs().get(0).getParams().get(1).getDataType());
+ assertEquals(Arrays.asList("1", "2", "3", "4"), rest.getVerbs().get(0).getParams().get(0).getAllowableValues());
+ assertEquals(Arrays.asList("a", "b", "c", "d"), rest.getVerbs().get(0).getParams().get(1).getAllowableValues());
+ assertEquals("1", rest.getVerbs().get(0).getParams().get(0).getDefaultValue());
+ assertEquals("b", rest.getVerbs().get(0).getParams().get(1).getDefaultValue());
+
+ assertEquals(null, rest.getVerbs().get(0).getParams().get(0).getCollectionFormat());
+ assertEquals(CollectionFormat.multi, rest.getVerbs().get(0).getParams().get(1).getCollectionFormat());
+
+ assertEquals("header_count", rest.getVerbs().get(0).getParams().get(0).getName());
+ assertEquals("header_letter", rest.getVerbs().get(0).getParams().get(1).getName());
+ assertEquals(Boolean.TRUE, rest.getVerbs().get(0).getParams().get(0).getRequired());
+ assertEquals(Boolean.FALSE, rest.getVerbs().get(0).getParams().get(1).getRequired());
+
+ assertEquals("300", rest.getVerbs().get(0).getResponseMsgs().get(0).getCode());
+ assertEquals("rate", rest.getVerbs().get(0).getResponseMsgs().get(0).getHeaders().get(0).getName());
+ assertEquals("Rate limit", rest.getVerbs().get(0).getResponseMsgs().get(0).getHeaders().get(0).getDescription());
+ assertEquals("integer", rest.getVerbs().get(0).getResponseMsgs().get(0).getHeaders().get(0).getDataType());
+ assertEquals("test msg", rest.getVerbs().get(0).getResponseMsgs().get(0).getMessage());
+ assertEquals(Integer.class.getCanonicalName(), rest.getVerbs().get(0).getResponseMsgs().get(0).getResponseModel());
+
+ to = assertIsInstanceOf(ToDefinition.class, rest.getVerbs().get(0).getTo());
+ assertEquals("direct:bye", to.getUri());
+
+ // the rest becomes routes and the input is a seda endpoint created by the DummyRestConsumerFactory
+ getMockEndpoint("mock:update").expectedMessageCount(1);
+ template.sendBody("seda:post-say-bye", "I was here");
+ assertMockEndpointsSatisfied();
+
+ String out = template.requestBody("seda:get-say-hello", "Me", String.class);
+ assertEquals("Hello World", out);
+ String out2 = template.requestBody("seda:get-say-bye", "Me", String.class);
+ assertEquals("Bye World", out2);
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/component/rest/FromRestIdAndDescriptionTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/component/rest/FromRestIdAndDescriptionTest.java
new file mode 100644
index 00000000..3c9c8c48
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/component/rest/FromRestIdAndDescriptionTest.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.blueprint.component.rest;
+
+import org.apache.camel.model.rest.RestDefinition;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+public class FromRestIdAndDescriptionTest extends FromRestGetTest {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/component/rest/FromRestIdAndDescriptionTest.xml";
+ }
+
+ @Override
+ @Test
+ public void testFromRestModel() throws Exception {
+ super.testFromRestModel();
+
+ RestDefinition rest = context.getRestDefinitions().get(0);
+ assertEquals("hello", rest.getId());
+ assertEquals("Hello Service", rest.getDescriptionText());
+
+ assertEquals("get-say", rest.getVerbs().get(0).getId());
+ assertEquals("Says hello to you", rest.getVerbs().get(0).getDescriptionText());
+
+ RestDefinition rest2 = context.getRestDefinitions().get(1);
+ assertEquals("bye", rest2.getId());
+ assertEquals("Bye Service", rest2.getDescriptionText());
+ assertEquals("en", rest2.getDescription().getLang());
+
+ assertEquals("Says bye to you", rest2.getVerbs().get(0).getDescriptionText());
+ assertEquals("Updates the bye message", rest2.getVerbs().get(1).getDescriptionText());
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/component/rest/FromRestUriPrefixTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/component/rest/FromRestUriPrefixTest.java
new file mode 100644
index 00000000..48d1284f
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/component/rest/FromRestUriPrefixTest.java
@@ -0,0 +1,66 @@
+/*
+ * 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.blueprint.component.rest;
+
+import org.apache.camel.model.ToDefinition;
+import org.apache.camel.model.rest.RestDefinition;
+import org.apache.camel.test.blueprint.CamelBlueprintTestSupport;
+import org.junit.jupiter.api.Test;
+
+import static org.apache.camel.test.junit5.TestSupport.assertIsInstanceOf;
+import static org.junit.jupiter.api.Assertions.*;
+
+public class FromRestUriPrefixTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/component/rest/FromRestUriPrefixTest.xml";
+ }
+
+ protected int getExpectedNumberOfRoutes() {
+ return 2 + 3;
+ }
+
+ @Test
+ public void testFromRestModel() throws Exception {
+ assertEquals(getExpectedNumberOfRoutes(), context.getRoutes().size());
+
+ assertEquals(1, context.getRestDefinitions().size());
+ RestDefinition rest = context.getRestDefinitions().get(0);
+ assertNotNull(rest);
+ assertEquals("/say/", rest.getPath());
+ assertEquals(3, rest.getVerbs().size());
+ assertEquals("/hello", rest.getVerbs().get(0).getPath());
+ assertEquals("/bye", rest.getVerbs().get(1).getPath());
+ assertEquals("/hi", rest.getVerbs().get(2).getPath());
+ ToDefinition to = assertIsInstanceOf(ToDefinition.class, rest.getVerbs().get(0).getTo());
+ assertEquals("direct:hello", to.getUri());
+ to = assertIsInstanceOf(ToDefinition.class, rest.getVerbs().get(1).getTo());
+ assertEquals("direct:bye", to.getUri());
+
+ // the rest becomes routes and the input is a seda endpoint created by the DummyRestConsumerFactory
+ getMockEndpoint("mock:update").expectedMessageCount(1);
+ template.sendBody("seda:post-say-hi", "I was here");
+ assertMockEndpointsSatisfied();
+
+ String out = template.requestBody("seda:get-say-hello", "Me", String.class);
+ assertEquals("Hello World", out);
+ String out2 = template.requestBody("seda:get-say-bye", "Me", String.class);
+ assertEquals("Bye World", out2);
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/component/rest/RestRefTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/component/rest/RestRefTest.java
new file mode 100644
index 00000000..0b0f7e24
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/component/rest/RestRefTest.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.blueprint.component.rest;
+
+import org.apache.camel.model.ToDefinition;
+import org.apache.camel.model.rest.RestDefinition;
+import org.apache.camel.test.blueprint.CamelBlueprintTestSupport;
+import org.junit.jupiter.api.Test;
+
+import static org.apache.camel.test.junit5.TestSupport.assertIsInstanceOf;
+import static org.junit.jupiter.api.Assertions.*;
+
+public class RestRefTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/component/rest/RestRefTest.xml";
+ }
+
+ protected int getExpectedNumberOfRoutes() {
+ return 2 + 3;
+ }
+
+ @Test
+ public void testRestRefTest() throws Exception {
+ assertEquals(getExpectedNumberOfRoutes(), context.getRoutes().size());
+
+ assertEquals(2, context.getRestDefinitions().size());
+ RestDefinition rest = context.getRestDefinitions().get(0);
+ assertNotNull(rest);
+ assertEquals("/say/hello", rest.getPath());
+ assertEquals(1, rest.getVerbs().size());
+ ToDefinition to = assertIsInstanceOf(ToDefinition.class, rest.getVerbs().get(0).getTo());
+ assertEquals("direct:hello", to.getUri());
+
+ rest = context.getRestDefinitions().get(1);
+ assertNotNull(rest);
+ assertEquals("/say/bye", rest.getPath());
+ assertEquals(2, rest.getVerbs().size());
+ assertEquals("application/json", rest.getVerbs().get(0).getConsumes());
+ to = assertIsInstanceOf(ToDefinition.class, rest.getVerbs().get(0).getTo());
+ assertEquals("direct:bye", to.getUri());
+
+ // the rest becomes routes and the input is a seda endpoint created by the DummyRestConsumerFactory
+ getMockEndpoint("mock:update").expectedMessageCount(1);
+ template.sendBody("seda:post-say-bye", "I was here");
+ assertMockEndpointsSatisfied();
+
+ String out = template.requestBody("seda:get-say-hello", "Me", String.class);
+ assertEquals("Hello World", out);
+ String out2 = template.requestBody("seda:get-say-bye", "Me", String.class);
+ assertEquals("Bye World", out2);
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/converter/CustomConverterRegressionTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/converter/CustomConverterRegressionTest.java
new file mode 100644
index 00000000..83887a48
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/converter/CustomConverterRegressionTest.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.blueprint.converter;
+
+import org.apache.camel.test.blueprint.CamelBlueprintTestSupport;
+import org.apache.camel.test.blueprint.Foo;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+public class CustomConverterRegressionTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/converter/CustomConverterRegressionTest.xml";
+ }
+
+ @Test
+ public void testCustomConverter() throws Exception {
+ getMockEndpoint("mock:result").expectedMessageCount(1);
+ getMockEndpoint("mock:result").message(0).body().isInstanceOf(Foo.class);
+
+ template.sendBody("direct:start", "John,Doe");
+
+ assertMockEndpointsSatisfied();
+
+ Foo foo = getMockEndpoint("mock:result").getReceivedExchanges().get(0).getIn().getBody(Foo.class);
+ assertEquals("John", foo.getFirst());
+ assertEquals("Doe", foo.getLast());
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/converter/CustomConverterTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/converter/CustomConverterTest.java
new file mode 100644
index 00000000..697504ec
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/converter/CustomConverterTest.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.blueprint.converter;
+
+import org.apache.camel.test.blueprint.CamelBlueprintTestSupport;
+import org.apache.camel.test.blueprint.Foo;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+public class CustomConverterTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/converter/CustomConverterTest.xml";
+ }
+
+ @Test
+ public void testCustomConverter() throws Exception {
+ getMockEndpoint("mock:result").expectedMessageCount(1);
+ getMockEndpoint("mock:result").message(0).body().isInstanceOf(Foo.class);
+
+ template.sendBody("direct:start", "John,Doe");
+
+ assertMockEndpointsSatisfied();
+
+ Foo foo = getMockEndpoint("mock:result").getReceivedExchanges().get(0).getIn().getBody(Foo.class);
+ assertEquals("John", foo.getFirst());
+ assertEquals("Doe", foo.getLast());
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/converter/FooConverter.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/converter/FooConverter.java
new file mode 100644
index 00000000..91021f80
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/converter/FooConverter.java
@@ -0,0 +1,37 @@
+/*
+ * 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.blueprint.converter;
+
+import org.apache.camel.Converter;
+import org.apache.camel.TypeConverters;
+import org.apache.camel.test.blueprint.Foo;
+
+public class FooConverter implements TypeConverters {
+
+ public FooConverter() {
+ }
+
+ @Converter
+ public Foo convertToFoo(String data) {
+ String[] s = data.split(",");
+ Foo foo = new Foo();
+ foo.setFirst(s[0]);
+ foo.setLast(s[1]);
+ return foo;
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/converter/FooConverterRegression.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/converter/FooConverterRegression.java
new file mode 100644
index 00000000..31cb9e83
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/converter/FooConverterRegression.java
@@ -0,0 +1,37 @@
+/*
+ * 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.blueprint.converter;
+
+import org.apache.camel.Converter;
+import org.apache.camel.test.blueprint.Foo;
+
+@Converter
+public class FooConverterRegression {
+
+ public FooConverterRegression() {
+ }
+
+ @Converter
+ public Foo convertToFoo(String data) {
+ String[] s = data.split(",");
+ Foo foo = new Foo();
+ foo.setFirst(s[0]);
+ foo.setLast(s[1]);
+ return foo;
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/converter2/Country.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/converter2/Country.java
new file mode 100644
index 00000000..4a50535f
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/converter2/Country.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.blueprint.converter2;
+
+public class Country {
+
+ private String iso;
+ private String name;
+
+ public String getIso() {
+ return iso;
+ }
+
+ public void setIso(String iso) {
+ this.iso = iso;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/converter2/MyConverters.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/converter2/MyConverters.java
new file mode 100644
index 00000000..97c4b4f9
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/converter2/MyConverters.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.blueprint.converter2;
+
+import org.apache.camel.Converter;
+import org.apache.camel.TypeConverters;
+
+public class MyConverters implements TypeConverters {
+
+ @Converter
+ public Country toCountry(String iso) {
+ Country answer = new Country();
+ answer.setIso("en");
+ answer.setName("England");
+ return answer;
+ }
+
+ @Converter
+ public String toIso(Country country) {
+ return country.getIso();
+ }
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/converter2/MyConvertersTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/converter2/MyConvertersTest.java
new file mode 100644
index 00000000..74317398
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/converter2/MyConvertersTest.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.blueprint.converter2;
+
+import org.apache.camel.test.blueprint.CamelBlueprintTestSupport;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+public class MyConvertersTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/converter2/MyConvertersTest.xml";
+ }
+
+ @Test
+ public void testConvertersShouldBeAddedAutomaticByBlueprint() throws Exception {
+ Country country = context.getTypeConverter().convertTo(Country.class, "en");
+ assertNotNull(country);
+ assertEquals("England", country.getName());
+
+ String iso = context.getTypeConverter().convertTo(String.class, country);
+ assertNotNull(iso);
+ assertEquals("en", iso);
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/management/ManagedEndpointInjectRefEndpointTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/management/ManagedEndpointInjectRefEndpointTest.java
new file mode 100644
index 00000000..bf24346d
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/management/ManagedEndpointInjectRefEndpointTest.java
@@ -0,0 +1,97 @@
+/*
+ * 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.blueprint.management;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+import org.apache.camel.ServiceStatus;
+import org.apache.camel.test.blueprint.CamelBlueprintTestSupport;
+import org.junit.jupiter.api.Test;
+
+import static org.apache.camel.test.junit5.TestSupport.isPlatform;
+import static org.junit.jupiter.api.Assertions.*;
+
+public class ManagedEndpointInjectRefEndpointTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected boolean useJmx() {
+ return true;
+ }
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/management/managedEndpointInjectRefEndpointTest.xml";
+ }
+
+ protected MBeanServer getMBeanServer() {
+ return context.getManagementStrategy().getManagementAgent().getMBeanServer();
+ }
+
+ @Test
+ public void testRef() throws Exception {
+ // JMX tests dont work well on AIX CI servers (hangs them)
+ if (isPlatform("aix")) {
+ return;
+ }
+ // don't test well on windows
+ if (isPlatform("windows")) {
+ return;
+ }
+
+ // fire a message to get it running
+ getMockEndpoint("mock:result").expectedMessageCount(1);
+ getMockEndpoint("foo").expectedMessageCount(1);
+ template.sendBody("direct:start", "Hello World");
+ assertMockEndpointsSatisfied();
+
+ MBeanServer mbeanServer = getMBeanServer();
+
+ Set<ObjectName> set = mbeanServer.queryNames(new ObjectName("*:type=producers,*"), null);
+ assertEquals(2, set.size());
+
+ Set<String> uris = new HashSet<>(Arrays.asList("mock://foo", "mock://result"));
+ for (ObjectName on : set) {
+ boolean registered = mbeanServer.isRegistered(on);
+ assertTrue(registered, "Should be registered");
+
+ String uri = (String) mbeanServer.getAttribute(on, "EndpointUri");
+ assertTrue(uris.contains(uri), uri);
+
+ // should be started
+ String state = (String) mbeanServer.getAttribute(on, "State");
+ assertEquals(ServiceStatus.Started.name(), state, "Should be started");
+ }
+
+ set = mbeanServer.queryNames(new ObjectName("*:type=endpoints,*"), null);
+ assertEquals(4, set.size());
+
+ uris = new HashSet<>(Arrays.asList("direct://start", "mock://foo", "mock://result", "ref://foo"));
+ for (ObjectName on : set) {
+ boolean registered = mbeanServer.isRegistered(on);
+ assertTrue(registered, "Should be registered");
+
+ String uri = (String) mbeanServer.getAttribute(on, "EndpointUri");
+ assertTrue(uris.contains(uri), uri);
+ }
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/management/ManagedNamePatternFixedIncludeHostNameTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/management/ManagedNamePatternFixedIncludeHostNameTest.java
new file mode 100644
index 00000000..e69ffa7b
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/management/ManagedNamePatternFixedIncludeHostNameTest.java
@@ -0,0 +1,59 @@
+/*
+ * 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.blueprint.management;
+
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+import org.apache.camel.test.blueprint.CamelBlueprintTestSupport;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+public class ManagedNamePatternFixedIncludeHostNameTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected boolean useJmx() {
+ return true;
+ }
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/management/managedNamePatternFixedIncludeHostNameTest.xml";
+ }
+
+ @Override
+ protected String getBundleVersion() {
+ return "1.2.3";
+ }
+
+ @Test
+ public void testManagedNamePattern() throws Exception {
+ getMockEndpoint("mock:result").expectedMessageCount(1);
+ template.sendBody("direct:start", "World");
+ assertMockEndpointsSatisfied();
+
+ MBeanServer mbeanServer = context.getManagementStrategy().getManagementAgent().getMBeanServer();
+
+ assertEquals("cool-1.2.3", context.getManagementName());
+
+ ObjectName on = ObjectName.getInstance("org.apache.camel:context=localhost/" + context.getManagementName()
+ + ",type=context,name=\"" + context.getName() + "\"");
+ assertTrue(mbeanServer.isRegistered(on), "Should be registered");
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/management/ManagedNamePatternFixedTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/management/ManagedNamePatternFixedTest.java
new file mode 100644
index 00000000..e16a9ede
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/management/ManagedNamePatternFixedTest.java
@@ -0,0 +1,59 @@
+/*
+ * 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.blueprint.management;
+
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+import org.apache.camel.test.blueprint.CamelBlueprintTestSupport;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+public class ManagedNamePatternFixedTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected boolean useJmx() {
+ return true;
+ }
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/management/managedNamePatternFixedTest.xml";
+ }
+
+ @Override
+ protected String getBundleVersion() {
+ return "1.2.3";
+ }
+
+ @Test
+ public void testManagedNamePattern() throws Exception {
+ getMockEndpoint("mock:result").expectedMessageCount(1);
+ template.sendBody("direct:start", "World");
+ assertMockEndpointsSatisfied();
+
+ MBeanServer mbeanServer = context.getManagementStrategy().getManagementAgent().getMBeanServer();
+
+ assertEquals("cool-1.2.3", context.getManagementName());
+
+ ObjectName on = ObjectName.getInstance("org.apache.camel:context=" + context.getManagementName()
+ + ",type=context,name=\"" + context.getName() + "\"");
+ assertTrue(mbeanServer.isRegistered(on), "Should be registered");
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/management/ManagedRefEndpointTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/management/ManagedRefEndpointTest.java
new file mode 100644
index 00000000..f2b78049
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/management/ManagedRefEndpointTest.java
@@ -0,0 +1,92 @@
+/*
+ * 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.blueprint.management;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+import org.apache.camel.ServiceStatus;
+import org.apache.camel.test.blueprint.CamelBlueprintTestSupport;
+import org.junit.jupiter.api.Test;
+
+import static org.apache.camel.test.junit5.TestSupport.isPlatform;
+import static org.junit.jupiter.api.Assertions.*;
+
+public class ManagedRefEndpointTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected boolean useJmx() {
+ return true;
+ }
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/management/managedRefEndpointTest.xml";
+ }
+
+ protected MBeanServer getMBeanServer() {
+ return context.getManagementStrategy().getManagementAgent().getMBeanServer();
+ }
+
+ @Test
+ public void testRef() throws Exception {
+ // JMX tests dont work well on AIX CI servers (hangs them)
+ if (isPlatform("aix")) {
+ return;
+ }
+
+ // fire a message to get it running
+ getMockEndpoint("mock:result").expectedMessageCount(1);
+ getMockEndpoint("foo").expectedMessageCount(1);
+ template.sendBody("direct:start", "Hello World");
+ assertMockEndpointsSatisfied();
+
+ MBeanServer mbeanServer = getMBeanServer();
+
+ Set<ObjectName> set = mbeanServer.queryNames(new ObjectName("*:type=producers,*"), null);
+ assertEquals(2, set.size());
+
+ for (ObjectName on : set) {
+ boolean registered = mbeanServer.isRegistered(on);
+ assertTrue(registered, "Should be registered");
+
+ String uri = (String) mbeanServer.getAttribute(on, "EndpointUri");
+ assertTrue(uri.equals("mock://foo") || uri.equals("mock://result"), uri);
+
+ // should be started
+ String state = (String) mbeanServer.getAttribute(on, "State");
+ assertEquals(ServiceStatus.Started.name(), state, "Should be started");
+ }
+
+ set = mbeanServer.queryNames(new ObjectName("*:type=endpoints,*"), null);
+ assertEquals(4, set.size());
+
+ Set<String> uris = new HashSet<>(Arrays.asList("direct://start", "mock://foo", "mock://result", "ref://foo"));
+ for (ObjectName on : set) {
+ boolean registered = mbeanServer.isRegistered(on);
+ assertTrue(registered, "Should be registered");
+
+ String uri = (String) mbeanServer.getAttribute(on, "EndpointUri");
+ assertTrue(uris.contains(uri), uri);
+ }
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/management/MyRouteBuilder.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/management/MyRouteBuilder.java
new file mode 100644
index 00000000..1d4026b7
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/management/MyRouteBuilder.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.blueprint.management;
+
+import org.apache.camel.Endpoint;
+import org.apache.camel.EndpointInject;
+import org.apache.camel.builder.RouteBuilder;
+
+public class MyRouteBuilder extends RouteBuilder {
+
+ @EndpointInject("ref:foo")
+ private Endpoint foo;
+
+ @Override
+ public void configure() throws Exception {
+ from("direct:start").routeId("foo")
+ .to(foo)
+ .to("mock:result");
+
+ }
+}
\ No newline at end of file
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/scan/MyCoolRoute.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/scan/MyCoolRoute.java
new file mode 100644
index 00000000..d65d4e52
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/scan/MyCoolRoute.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.blueprint.scan;
+
+import org.apache.camel.builder.RouteBuilder;
+
+/**
+ *
+ */
+public class MyCoolRoute extends RouteBuilder {
+
+ @Override
+ public void configure() throws Exception {
+ from("direct:start").to("mock:a");
+ }
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/scan2/MyOtherCoolRoute.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/scan2/MyOtherCoolRoute.java
new file mode 100644
index 00000000..bdf73731
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/scan2/MyOtherCoolRoute.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.blueprint.scan2;
+
+import org.apache.camel.Endpoint;
+import org.apache.camel.EndpointInject;
+import org.apache.camel.builder.RouteBuilder;
+
+/**
+ *
+ */
+public class MyOtherCoolRoute extends RouteBuilder {
+
+ @EndpointInject("ref:foo")
+ private Endpoint foo;
+
+ @Override
+ public void configure() throws Exception {
+ from(foo).to("mock:a");
+ }
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/xpath/XPathFilterRouteContextWithNamespaceTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/xpath/XPathFilterRouteContextWithNamespaceTest.java
new file mode 100644
index 00000000..241744a7
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/xpath/XPathFilterRouteContextWithNamespaceTest.java
@@ -0,0 +1,26 @@
+/*
+ * 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.blueprint.xpath;
+
+public class XPathFilterRouteContextWithNamespaceTest extends XPathFilterWithNamespaceTest {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/xpath/xpathFilterRouteContextWithNamespaceTest.xml";
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/xpath/XPathFilterWithNamespaceTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/xpath/XPathFilterWithNamespaceTest.java
new file mode 100644
index 00000000..149e719f
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/xpath/XPathFilterWithNamespaceTest.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.blueprint.xpath;
+
+import org.apache.camel.test.blueprint.CamelBlueprintTestSupport;
+import org.junit.jupiter.api.Test;
+
+public class XPathFilterWithNamespaceTest extends CamelBlueprintTestSupport {
+
+ protected String matchingBody = "<person name='James' city='London' xmlns='http://example.com/person'/>";
+ protected String notMatchingBody = "<person name='Hiram' city='Tampa' xmlns='http://example.com/person'/>";
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/xpath/xpathFilterWithNamespaceTest.xml";
+ }
+
+ @Test
+ public void testSendMatchingMessage() throws Exception {
+ getMockEndpoint("mock:result").expectedBodiesReceived(matchingBody);
+
+ sendBody("direct:start", matchingBody);
+
+ assertMockEndpointsSatisfied();
+ }
+
+ @Test
+ public void testSendNotMatchingMessage() throws Exception {
+ getMockEndpoint("mock:result").expectedMessageCount(0);
+
+ sendBody("direct:start", notMatchingBody);
+
+ assertMockEndpointsSatisfied();
+ }
+
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/xpath/XPathHeaderNameTest.java b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/xpath/XPathHeaderNameTest.java
new file mode 100644
index 00000000..039d894c
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/java/org/apache/camel/test/blueprint/xpath/XPathHeaderNameTest.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.blueprint.xpath;
+
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.test.blueprint.CamelBlueprintTestSupport;
+import org.junit.jupiter.api.Test;
+
+public class XPathHeaderNameTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/xpath/XPathHeaderNameTest.xml";
+ }
+
+ @Test
+ public void testChoiceWithHeaderNamePremium() throws Exception {
+ MockEndpoint mock = getMockEndpoint("mock:premium");
+ mock.expectedBodiesReceived("<response>OK</response>");
+ mock.expectedHeaderReceived("invoiceDetails", "<invoice orderType='premium'><person><name>Alan</name></person></invoice>");
+
+ template.sendBodyAndHeader("direct:in", "<response>OK</response>",
+ "invoiceDetails", "<invoice orderType='premium'><person><name>Alan</name></person></invoice>");
+
+ mock.assertIsSatisfied();
+ }
+
+ @Test
+ public void testChoiceWithHeaderNameStandard() throws Exception {
+ MockEndpoint mock = getMockEndpoint("mock:standard");
+ mock.expectedBodiesReceived("<response>OK</response>");
+ mock.expectedHeaderReceived("invoiceDetails", "<invoice orderType='standard'><person><name>Alan</name></person></invoice>");
+
+ template.sendBodyAndHeader("direct:in", "<response>OK</response>",
+ "invoiceDetails", "<invoice orderType='standard'><person><name>Alan</name></person></invoice>");
+
+ mock.assertIsSatisfied();
+ }
+
+ @Test
+ public void testChoiceWithHeaderNameUnknown() throws Exception {
+ MockEndpoint mock = getMockEndpoint("mock:unknown");
+ mock.expectedBodiesReceived("<response>OK</response>");
+ mock.expectedHeaderReceived("invoiceDetails", "<invoice />");
+
+ template.sendBodyAndHeader("direct:in", "<response>OK</response>",
+ "invoiceDetails", "<invoice />");
+
+ mock.assertIsSatisfied();
+ }
+}
diff --git a/components/camel-test-blueprint-junit5/src/test/resources/META-INF/services/org/apache/camel/TypeConverter b/components/camel-test-blueprint-junit5/src/test/resources/META-INF/services/org/apache/camel/TypeConverter
new file mode 100644
index 00000000..ae8dad18
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/resources/META-INF/services/org/apache/camel/TypeConverter
@@ -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.
+#
+
+org.apache.camel.test.blueprint.converter.FooConverterRegression
\ No newline at end of file
diff --git a/components/camel-test-blueprint-junit5/src/test/resources/etc/augmented.fallback.cfg b/components/camel-test-blueprint-junit5/src/test/resources/etc/augmented.fallback.cfg
new file mode 100644
index 00000000..f6ada0ae
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/resources/etc/augmented.fallback.cfg
@@ -0,0 +1,23 @@
+## ------------------------------------------------------------------------
+## 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.
+## ------------------------------------------------------------------------
+
+source = direct:not-from-here
+TEST.source = direct:start
+
+# augmented TEST.destination should fall back to this
+destination = mock:result
+
diff --git a/components/camel-test-blueprint-junit5/src/test/resources/etc/augmented.no.fallback.cfg b/components/camel-test-blueprint-junit5/src/test/resources/etc/augmented.no.fallback.cfg
new file mode 100644
index 00000000..4dba59a3
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/resources/etc/augmented.no.fallback.cfg
@@ -0,0 +1,23 @@
+## ------------------------------------------------------------------------
+## 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.
+## ------------------------------------------------------------------------
+
+source = direct:from-here
+TESTXXX.source = direct:not-from-here
+
+# augmented TEST.destination should fall back to this
+destination = mock:result
+
diff --git a/components/camel-test-blueprint-junit5/src/test/resources/etc/framework.properties b/components/camel-test-blueprint-junit5/src/test/resources/etc/framework.properties
new file mode 100644
index 00000000..17503c06
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/resources/etc/framework.properties
@@ -0,0 +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.
+## ---------------------------------------------------------------------------
+
+my.greeting=Camel
+my.context.messageHistory=false
diff --git a/components/camel-test-blueprint-junit5/src/test/resources/etc/otherstuff.cfg b/components/camel-test-blueprint-junit5/src/test/resources/etc/otherstuff.cfg
new file mode 100644
index 00000000..cb1d44f7
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/resources/etc/otherstuff.cfg
@@ -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.
+## ------------------------------------------------------------------------
+
+salutation=Adieu
+resonner=tiens!
+arrive=mock:otherResult
diff --git a/components/camel-test-blueprint-junit5/src/test/resources/etc/stuff.cfg b/components/camel-test-blueprint-junit5/src/test/resources/etc/stuff.cfg
new file mode 100644
index 00000000..a8666aa4
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/resources/etc/stuff.cfg
@@ -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.
+## ------------------------------------------------------------------------
+
+greeting=Bye
+echo=Yay
+destination=mock:result
\ No newline at end of file
diff --git a/components/camel-test-blueprint-junit5/src/test/resources/junit-platform.properties b/components/camel-test-blueprint-junit5/src/test/resources/junit-platform.properties
new file mode 100644
index 00000000..e69de29b
diff --git a/components/camel-test-blueprint-junit5/src/test/resources/log4j2.properties b/components/camel-test-blueprint-junit5/src/test/resources/log4j2.properties
new file mode 100644
index 00000000..1f2795f9
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/resources/log4j2.properties
@@ -0,0 +1,28 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+
+appender.file.type = File
+appender.file.name = file
+appender.file.fileName = target/camel-test-blueprint.log
+appender.file.layout.type = PatternLayout
+appender.file.layout.pattern = %d [%-15.15t] %-5p %-30.30c{1} - %m%n
+appender.out.type = Console
+appender.out.name = out
+appender.out.layout.type = PatternLayout
+appender.out.layout.pattern = %d [%-15.15t] %-5p %-30.30c{1} - %m%n
+rootLogger.level = INFO
+rootLogger.appenderRef.file.ref = file
diff --git a/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/AttributeNewLineTest.xml b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/AttributeNewLineTest.xml
new file mode 100644
index 00000000..90e7928a
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/AttributeNewLineTest.xml
@@ -0,0 +1,47 @@
+<?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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
+
+ <camelContext xmlns="http://camel.apache.org/schema/blueprint">
+
+ <route>
+ <from uri="direct:start"/>
+ <to uri="seda:bar?timeout=10000
+ &blockWhenFull=true"/>
+ </route>
+
+ <route>
+ <from uri="seda:bar?
+ timeout=10000&
+ blockWhenFull=true"/>
+ <to uri="mock:bar"/>
+ </route>
+
+ <route>
+ <from uri="stub:GET /v1/phonebook/companies/{companyCode}?oauth=OPTIONAL"/>
+ <to uri="mock:stub"/>
+ </route>
+
+ </camelContext>
+
+</blueprint>
\ No newline at end of file
diff --git a/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/BlueprintAddServiceTest.xml b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/BlueprintAddServiceTest.xml
new file mode 100644
index 00000000..04c07775
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/BlueprintAddServiceTest.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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
+
+ <camelContext xmlns="http://camel.apache.org/schema/blueprint">
+
+ <route>
+ <from uri="direct:start"/>
+ <to uri="bean:myService"/>
+ <to uri="mock:result"/>
+ </route>
+
+ </camelContext>
+
+</blueprint>
diff --git a/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/BlueprintComponentPropertyPlaceholderTest.xml b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/BlueprintComponentPropertyPlaceholderTest.xml
new file mode 100644
index 00000000..fef5849f
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/BlueprintComponentPropertyPlaceholderTest.xml
@@ -0,0 +1,47 @@
+<?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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
+ xsi:schemaLocation="
+ http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0 http://aries.apache.org/schemas/blueprint-cm/blueprint-cm-1.0.0.xsd
+ http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
+
+ <!-- blueprint property placeholders -->
+ <cm:property-placeholder persistent-id="my-placeholders">
+ <cm:default-properties>
+ <cm:property name="mySize" value="2"/>
+ </cm:default-properties>
+ </cm:property-placeholder>
+
+ <bean id="myseda" class="org.apache.camel.component.seda.SedaComponent">
+ <property name="queueSize" value="${mySize}"/>
+ </bean>
+
+ <camelContext xmlns="http://camel.apache.org/schema/blueprint">
+
+ <route>
+ <from uri="direct:start"/>
+ <to uri="myseda:foo"/>
+ </route>
+
+ </camelContext>
+
+</blueprint>
diff --git a/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/BlueprintMultipleServiceTest.xml b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/BlueprintMultipleServiceTest.xml
new file mode 100644
index 00000000..0ceacf9d
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/BlueprintMultipleServiceTest.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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
+
+ <camelContext xmlns="http://camel.apache.org/schema/blueprint">
+
+ <route>
+ <from uri="direct:start"/>
+ <to uri="fakeservice1:mock"/>
+ <to uri="fakeservice2:mock"/>
+ </route>
+
+ </camelContext>
+
+</blueprint>
diff --git a/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/BlueprintOptionalPropertiesDslTest.xml b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/BlueprintOptionalPropertiesDslTest.xml
new file mode 100644
index 00000000..90ca08fb
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/BlueprintOptionalPropertiesDslTest.xml
@@ -0,0 +1,50 @@
+<?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.
+
+-->
+<!-- START SNIPPET: example -->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:prop="http://camel.apache.org/schema/placeholder"
+ xsi:schemaLocation="
+ http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
+
+ <!-- Notice in the declaration above, we have defined the prop prefix as the Camel placeholder namespace -->
+
+ <bean id="damn" class="java.lang.IllegalArgumentException">
+ <argument index="0" value="Damn"/>
+ </bean>
+
+ <camelContext xmlns="http://camel.apache.org/schema/blueprint">
+
+ <propertyPlaceholder id="properties"
+ location="classpath:org/apache/camel/test/blueprint/myproperties.properties"/>
+
+ <route>
+ <from uri="direct:start"/>
+ <multicast stopOnException="{{stop}}">
+ <to uri="mock:a"/>
+ <throwException ref="damn"/>
+ <to uri="mock:b"/>
+ </multicast>
+ </route>
+
+ </camelContext>
+
+</blueprint>
+<!-- END SNIPPET: example -->
diff --git a/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/BlueprintProduceConsumeImplicitPropertyTest.xml b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/BlueprintProduceConsumeImplicitPropertyTest.xml
new file mode 100644
index 00000000..34032971
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/BlueprintProduceConsumeImplicitPropertyTest.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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
+
+ <camelContext id="myCamel" xmlns="http://camel.apache.org/schema/blueprint">
+ <!-- no routes -->
+ </camelContext>
+
+ <!-- bean that has @Consume and @Produce -->
+ <bean id="fooService" class="org.apache.camel.test.blueprint.FooService" depends-on="myCamel">
+ <property name="fooEndpoint" value="seda:input"/>
+ <property name="barEndpoint" value="mock:result"/>
+ </bean>
+
+</blueprint>
diff --git a/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/BlueprintStreamCachingStrategyTest.xml b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/BlueprintStreamCachingStrategyTest.xml
new file mode 100644
index 00000000..f043a6f0
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/BlueprintStreamCachingStrategyTest.xml
@@ -0,0 +1,38 @@
+<?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.
+
+-->
+<!-- START SNIPPET: example -->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
+
+ <camelContext streamCache="true" xmlns="http://camel.apache.org/schema/blueprint">
+
+ <streamCaching id="myCacheConfig" bufferSize="2048" spoolEnabled="true" spoolDirectory="target/cachedir" spoolThreshold="8192"/>
+
+ <route>
+ <from uri="direct:c"/>
+ <to uri="mock:c"/>
+ </route>
+
+ </camelContext>
+
+</blueprint>
+<!-- END SNIPPET: example -->
diff --git a/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/BlueprintSupervisingRouteControllerTest.xml b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/BlueprintSupervisingRouteControllerTest.xml
new file mode 100644
index 00000000..3b3bd297
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/BlueprintSupervisingRouteControllerTest.xml
@@ -0,0 +1,50 @@
+<?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.
+
+-->
+<!-- START SNIPPET: example -->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
+
+ <bean id="jms" class="org.apache.camel.test.blueprint.SupervisingRouteControllerTest.MyJmsComponent"/>
+
+ <camelContext streamCache="true" xmlns="http://camel.apache.org/schema/blueprint">
+ <routeController id="myController"
+ supervising="true" initialDelay="100" threadPoolSize="2" backOffDelay="25" backOffMaxAttempts="3"/>
+ <route id="foo">
+ <from uri="timer:foo"/>
+ <to uri="mock:foo"/>
+ </route>
+ <route id="cheese">
+ <from uri="jms:cheese"/>
+ <to uri="mock:cheese"/>
+ </route>
+ <route id="cake">
+ <from uri="jms:cake"/>
+ <to uri="mock:cake"/>
+ </route>
+ <route id="bar" autoStartup="false">
+ <from uri="seda:bar"/>
+ <to uri="mock:bar"/>
+ </route>
+ </camelContext>
+
+</blueprint>
+<!-- END SNIPPET: example -->
diff --git a/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/ConfigAdminExtFileTest.xml b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/ConfigAdminExtFileTest.xml
new file mode 100644
index 00000000..f546f493
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/ConfigAdminExtFileTest.xml
@@ -0,0 +1,69 @@
+<?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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
+ xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0"
+ xsi:schemaLocation="
+ http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0 http://aries.apache.org/schemas/blueprint-cm/blueprint-cm-1.0.0.xsd
+ http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
+
+ <!-- in this example we have 2 blueprint property placeholders -->
+ <!-- Camel 2.12.1 onwards will favor placeholders from the last defined placeholders,
+ and also favor non-default placeholders values
+ (= meaning that when overriding default values then Camel uses them instead)
+ -->
+
+ <!-- a default placeholder to setup the file locations and some default values -->
+ <cm:property-placeholder persistent-id="stuff" placeholder-prefix="{{" placeholder-suffix="}}">
+ <cm:default-properties>
+ <cm:property name="my.resources.config.folder" value="src/test/resources"/>
+ <cm:property name="my.resources.config.file" value="framework.properties"/>
+ <!-- default value is true -->
+ <!-- but we override this value in framework.properties where we set it to false -->
+ <cm:property name="my.context.messageHistory" value="true"/>
+ </cm:default-properties>
+ </cm:property-placeholder>
+
+ <!-- extended placeholder that loads the file and have additional properties -->
+ <ext:property-placeholder id="my-blueprint-placeholder">
+ <ext:default-properties>
+ <ext:property name="my-version" value="framework_1.0"/>
+ </ext:default-properties>
+ <!-- define location of properties file -->
+ <ext:location>file:{{my.resources.config.folder}}/etc/{{my.resources.config.file}}</ext:location>
+ </ext:property-placeholder>
+
+ <!-- a bean that uses a blueprint property placeholder -->
+ <bean id="myCoolBean" class="org.apache.camel.test.blueprint.MyCoolBean">
+ <property name="say" value="${my.greeting}"/>
+ </bean>
+
+ <camelContext messageHistory="{{my.context.messageHistory}}" xmlns="http://camel.apache.org/schema/blueprint">
+
+ <route>
+ <from uri="direct:start"/>
+ <bean ref="myCoolBean" method="saySomething"/>
+ <to uri="mock:result"/>
+ </route>
+
+ </camelContext>
+
+</blueprint>
diff --git a/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/CustomIdIssuesTest.xml b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/CustomIdIssuesTest.xml
new file mode 100644
index 00000000..5d83c3ef
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/CustomIdIssuesTest.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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
+
+ <camelContext xmlns="http://camel.apache.org/schema/blueprint">
+
+ <route customId="true" id="myRoute">
+ <description>here is a sample which processes the input files
+ (leaving them in place - see the 'noop' flag)
+ then performs content based routing on the message using XPath</description>
+ <from uri="file:src/data?noop=true" customId="true" id="fromFile">
+ <description/>
+ </from>
+ <choice customId="true" id="myChoice">
+ <when customId="true" id="UK">
+ <xpath>/person/city = 'London'</xpath>
+ <log message="UK message" customId="true" id="ukLog"/>
+ <to uri="file:target/messages/uk" customId="true" id="ukOutput"/>
+ </when>
+ <otherwise>
+ <log message="Other message"/>
+ <to uri="file:target/messages/others"/>
+ </otherwise>
+ </choice>
+ </route>
+
+ </camelContext>
+
+</blueprint>
diff --git a/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/DeadLetterChannelLogExhaustedMessageHistoryTest.xml b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/DeadLetterChannelLogExhaustedMessageHistoryTest.xml
new file mode 100644
index 00000000..3a28ba36
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/DeadLetterChannelLogExhaustedMessageHistoryTest.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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
+
+ <bean id="forced" class="java.lang.IllegalArgumentException">
+ <argument index="0" value="Forced"/>
+ </bean>
+
+ <camelContext errorHandlerRef="eh" xmlns="http://camel.apache.org/schema/blueprint">
+
+ <errorHandler id="eh" type="DeadLetterChannel" deadLetterUri="mock:dead">
+ <redeliveryPolicy maximumRedeliveries="3" redeliveryDelay="0" logHandled="true" logExhausted="true" logExhaustedMessageHistory="true"/>
+ </errorHandler>
+
+ <route>
+ <from uri="direct:start"/>
+ <log message="Incoming ${body}"/>
+ <throwException ref="forced"/>
+ </route>
+ </camelContext>
+
+</blueprint>
+
diff --git a/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/DeadLetterChannelOnPrepareTestTest.xml b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/DeadLetterChannelOnPrepareTestTest.xml
new file mode 100644
index 00000000..05c3cf87
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/DeadLetterChannelOnPrepareTestTest.xml
@@ -0,0 +1,44 @@
+<?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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
+
+ <bean id="forced" class="java.lang.IllegalArgumentException">
+ <argument index="0" value="Forced"/>
+ </bean>
+
+ <bean id="myPrepare"
+ class="org.apache.camel.test.blueprint.DeadLetterChannelOnPrepareTestTest.MyPrepareProcessor"/>
+
+ <camelContext xmlns="http://camel.apache.org/schema/blueprint" errorHandlerRef="dlc">
+
+ <errorHandler id="dlc" type="DeadLetterChannel" deadLetterUri="mock:dead" onPrepareFailureRef="myPrepare"/>
+
+ <route>
+ <from uri="direct:start"/>
+ <log message="Incoming ${body}"/>
+ <throwException ref="forced"/>
+ </route>
+ </camelContext>
+
+</blueprint>
+
diff --git a/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/DefaultErrorHandlerLogExhaustedMessageHistoryTest.xml b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/DefaultErrorHandlerLogExhaustedMessageHistoryTest.xml
new file mode 100644
index 00000000..26e4e45b
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/DefaultErrorHandlerLogExhaustedMessageHistoryTest.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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
+
+ <bean id="forced" class="java.lang.IllegalArgumentException">
+ <argument index="0" value="Forced"/>
+ </bean>
+
+ <camelContext errorHandlerRef="eh" xmlns="http://camel.apache.org/schema/blueprint">
+
+ <errorHandler id="eh">
+ <redeliveryPolicy maximumRedeliveries="3" redeliveryDelay="0" logExhausted="true" logExhaustedMessageHistory="true"/>
+ </errorHandler>
+
+ <route>
+ <from uri="direct:start"/>
+ <log message="Incoming ${body}"/>
+ <throwException ref="forced"/>
+ </route>
+ </camelContext>
+
+</blueprint>
+
diff --git a/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/DefaultErrorHandlerOnPrepareTestTest.xml b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/DefaultErrorHandlerOnPrepareTestTest.xml
new file mode 100644
index 00000000..3e3f265f
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/DefaultErrorHandlerOnPrepareTestTest.xml
@@ -0,0 +1,44 @@
+<?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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
+
+ <bean id="forced" class="java.lang.IllegalArgumentException">
+ <argument index="0" value="Forced"/>
+ </bean>
+
+ <bean id="myPrepare"
+ class="org.apache.camel.test.blueprint.DefaultErrorHandlerOnPrepareTestTest.MyPrepareProcessor"/>
+
+ <camelContext xmlns="http://camel.apache.org/schema/blueprint" errorHandlerRef="defaultEH">
+
+ <errorHandler id="defaultEH" type="DefaultErrorHandler" onPrepareFailureRef="myPrepare"/>
+
+ <route>
+ <from uri="direct:start"/>
+ <log message="Incoming ${body}"/>
+ <throwException ref="forced"/>
+ </route>
+ </camelContext>
+
+</blueprint>
+
diff --git a/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/EndpointPropertyTest.xml b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/EndpointPropertyTest.xml
new file mode 100644
index 00000000..a8a07f8c
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/EndpointPropertyTest.xml
@@ -0,0 +1,51 @@
+<?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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
+
+ <!-- outside camelContext -->
+ <endpoint id="bar" uri="seda:bar" camelContextId="myCamel" xmlns="http://camel.apache.org/schema/blueprint">
+ <property key="size" value="200"/>
+ </endpoint>
+
+ <camelContext id="myCamel" xmlns="http://camel.apache.org/schema/blueprint">
+
+ <!-- inside camelContext -->
+ <endpoint id="foo" uri="seda:foo">
+ <property key="size" value="100"/>
+ <property key="pollTimeout" value="5000"/>
+ <property key="blockWhenFull" value="true"/>
+ </endpoint>
+
+ <route>
+ <from uri="ref:foo"/>
+ <to uri="mock:result"/>
+ </route>
+
+ <route>
+ <from uri="ref:bar"/>
+ <to uri="mock:result"/>
+ </route>
+
+ </camelContext>
+
+</blueprint>
\ No newline at end of file
diff --git a/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/IsMockEndpoints.xml b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/IsMockEndpoints.xml
new file mode 100644
index 00000000..6f23f8bf
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/IsMockEndpoints.xml
@@ -0,0 +1,48 @@
+<?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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:camel="http://camel.apache.org/schema/blueprint" xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.osgi.org/xmlns/blueprint/v1.0.0
+ https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
+ http://camel.apache.org/schema/blueprint
+ http://camel.apache.org/schema/blueprint/camel-blueprint.xsd">
+
+ <camelContext id="IsMockEndpoints" trace="false" xmlns="http://camel.apache.org/schema/blueprint">
+
+ <route id="IsMockEndpointsRoute">
+ <from uri="direct:foo" />
+ <setBody>
+ <simple>bar</simple>
+ </setBody>
+ <to uri="seda:result" />
+ <to uri="mock:bar" />
+ </route>
+ <route>
+ <from uri="seda:result" />
+ <setBody>
+ <simple>baz</simple>
+ </setBody>
+ <to uri="mock:baz" />
+ </route>
+
+ </camelContext>
+
+</blueprint>
diff --git a/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/MockEndpointsAndSkipTest.xml b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/MockEndpointsAndSkipTest.xml
new file mode 100644
index 00000000..493fe1ef
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/MockEndpointsAndSkipTest.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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
+
+ <camelContext xmlns="http://camel.apache.org/schema/blueprint">
+
+ <route>
+ <from uri="direct:start"/>
+ <to uri="log:foo"/>
+ <to uri="seda:foo"/>
+ </route>
+
+ </camelContext>
+
+</blueprint>
+
diff --git a/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/OnExceptionOccurredProcessorOnExceptionTest.xml b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/OnExceptionOccurredProcessorOnExceptionTest.xml
new file mode 100644
index 00000000..da5484fd
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/OnExceptionOccurredProcessorOnExceptionTest.xml
@@ -0,0 +1,48 @@
+<?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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
+
+ <bean id="myProcessor" class="org.apache.camel.test.blueprint.OnExceptionOccurredProcessorOnExceptionTest.MyProcessor"/>
+
+ <bean id="forced" class="java.lang.IllegalArgumentException">
+ <argument index="0" value="Forced"/>
+ </bean>
+
+ <camelContext errorHandlerRef="eh" xmlns="http://camel.apache.org/schema/blueprint">
+
+ <errorHandler id="eh" deadLetterUri="mock:dead" type="DeadLetterChannel"/>
+
+ <onException onExceptionOccurredRef="myProcessor">
+ <exception>java.lang.Exception</exception>
+ <redeliveryPolicy maximumRedeliveries="3" redeliveryDelay="0"/>
+ </onException>
+
+ <route>
+ <from uri="direct:start"/>
+ <throwException ref="forced"/>
+ </route>
+
+ </camelContext>
+
+</blueprint>
+
diff --git a/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/OnExceptionOccurredProcessorTest.xml b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/OnExceptionOccurredProcessorTest.xml
new file mode 100644
index 00000000..5ac4a3a2
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/OnExceptionOccurredProcessorTest.xml
@@ -0,0 +1,45 @@
+<?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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
+
+ <bean id="myProcessor" class="org.apache.camel.test.blueprint.OnExceptionOccurredProcessorTest.MyProcessor"/>
+
+ <bean id="forced" class="java.lang.IllegalArgumentException">
+ <argument index="0" value="Forced"/>
+ </bean>
+
+ <camelContext errorHandlerRef="eh" xmlns="http://camel.apache.org/schema/blueprint">
+
+ <errorHandler id="eh" deadLetterUri="mock:dead" type="DeadLetterChannel" onExceptionOccurredRef="myProcessor">
+ <redeliveryPolicy maximumRedeliveries="3" redeliveryDelay="0"/>
+ </errorHandler>
+
+ <route>
+ <from uri="direct:start"/>
+ <throwException ref="forced"/>
+ </route>
+
+ </camelContext>
+
+</blueprint>
+
diff --git a/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/OnExceptionRouteIdTest.xml b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/OnExceptionRouteIdTest.xml
new file mode 100644
index 00000000..34eaa91f
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/OnExceptionRouteIdTest.xml
@@ -0,0 +1,31 @@
+<?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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
+
+ <bean id="myRoute" class="org.apache.camel.test.blueprint.OnExceptionRouteIdRouteBuilder"/>
+
+ <camelContext xmlns="http://camel.apache.org/schema/blueprint">
+ <routeBuilder ref="myRoute"/>
+ </camelContext>
+
+</blueprint>
diff --git a/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/PropertiesComponentFunctionTest.xml b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/PropertiesComponentFunctionTest.xml
new file mode 100644
index 00000000..61a5706c
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/PropertiesComponentFunctionTest.xml
@@ -0,0 +1,44 @@
+<?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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
+
+ <bean id="beerFunction" class="org.apache.camel.test.blueprint.PropertiesComponentFunctionTest.MyFunction"/>
+
+ <bean id="vmProperties" class="org.apache.camel.test.blueprint.MyProperties" />
+
+ <camelContext xmlns="http://camel.apache.org/schema/blueprint">
+
+ <propertyPlaceholder id="properties" location="ref:vmProperties" ignoreMissingLocation="true">
+ <propertiesFunction ref="beerFunction"/>
+ </propertyPlaceholder>
+
+ <route>
+ <from uri="direct:start"/>
+ <to uri="log:{{sys:os.name}}"/>
+ <to uri="{{beer:FOO}}"/>
+ <to uri="{{beer:BAR}}"/>
+ </route>
+ </camelContext>
+
+</blueprint>
+
diff --git a/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/SimpleWeaveAddMockLastTest.xml b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/SimpleWeaveAddMockLastTest.xml
new file mode 100644
index 00000000..ba8188a4
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/SimpleWeaveAddMockLastTest.xml
@@ -0,0 +1,38 @@
+<?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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
+
+ <camelContext xmlns="http://camel.apache.org/schema/blueprint">
+
+ <route>
+ <from uri="seda:start"/>
+ <transform>
+ <simple>Bye ${body}</simple>
+ </transform>
+ <to uri="seda:queue"/>
+ </route>
+
+ </camelContext>
+
+</blueprint>
+
diff --git a/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/beanInjectTest.xml b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/beanInjectTest.xml
new file mode 100644
index 00000000..42ebe2e2
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/beanInjectTest.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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
+ xsi:schemaLocation="
+ http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0 http://aries.apache.org/schemas/blueprint-cm/blueprint-cm-1.0.0.xsd
+ http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
+
+
+ <bean id="foo" class="org.apache.camel.test.blueprint.FooBar" />
+ <bean id="myRoute" class="org.apache.camel.test.blueprint.BlueprintBeanInjectRoute" />
+
+ <camelContext xmlns="http://camel.apache.org/schema/blueprint">
+ <routeBuilder ref="myRoute"/>
+ </camelContext>
+
+</blueprint>
diff --git a/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/beanStaticMethodRoute.xml b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/beanStaticMethodRoute.xml
new file mode 100644
index 00000000..0872297e
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/beanStaticMethodRoute.xml
@@ -0,0 +1,34 @@
+<?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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
+ xsi:schemaLocation="
+ http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0 http://aries.apache.org/schemas/blueprint-cm/blueprint-cm-1.0.0.xsd
+ http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
+
+
+ <bean id="myRoute" class="org.apache.camel.test.blueprint.BlueprintStaticMethodRoute" />
+
+ <camelContext xmlns="http://camel.apache.org/schema/blueprint">
+ <routeBuilder ref="myRoute"/>
+ </camelContext>
+
+</blueprint>
diff --git a/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/blueprintRoutesConfigurationBuilderIdOrPatternTest.xml b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/blueprintRoutesConfigurationBuilderIdOrPatternTest.xml
new file mode 100644
index 00000000..9f053aee
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/blueprintRoutesConfigurationBuilderIdOrPatternTest.xml
@@ -0,0 +1,46 @@
+<?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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
+
+ <camelContext xmlns="http://camel.apache.org/schema/blueprint">
+
+ <routeConfiguration id="handleError">
+ <onException>
+ <exception>java.lang.Exception</exception>
+ <handled>
+ <constant>true</constant>
+ </handled>
+ <to uri="mock:error"/>
+ </onException>
+ </routeConfiguration>
+
+ <route>
+ <from uri="direct:start"/>
+ <throwException exceptionType="java.lang.IllegalArgumentException" message="Foo"/>
+ </route>
+
+ <route routeConfigurationId="handleError">
+ <from uri="direct:start2"/>
+ <throwException exceptionType="java.lang.IllegalArgumentException" message="Foo2"/>
+ </route>
+
+ </camelContext>
+
+</blueprint>
diff --git a/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/camelContext.xml b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/camelContext.xml
new file mode 100644
index 00000000..a7763c97
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/camelContext.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.
+
+-->
+<!-- START SNIPPET: example -->
+<!-- tag::example[] -->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
+
+ <camelContext xmlns="http://camel.apache.org/schema/blueprint">
+
+ <route>
+ <from uri="direct:start"/>
+ <transform>
+ <simple>Hello ${body}</simple>
+ </transform>
+ <to uri="mock:a"/>
+ </route>
+
+ </camelContext>
+
+</blueprint>
+<!-- end::example[] -->
+<!-- END SNIPPET: example -->
diff --git a/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/camelEndpointInject.xml b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/camelEndpointInject.xml
new file mode 100644
index 00000000..e09c2f8b
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/camelEndpointInject.xml
@@ -0,0 +1,28 @@
+<?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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
+
+ <camelContext xmlns="http://camel.apache.org/schema/blueprint">
+ <endpoint id="testEndpoint" uri="mock:result"/>
+ </camelContext>
+
+ <bean id="myProducer" class="org.apache.camel.test.blueprint.MyProducer"/>
+
+</blueprint>
diff --git a/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/cloud/ServiceCallConfigurationTest.xml b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/cloud/ServiceCallConfigurationTest.xml
new file mode 100644
index 00000000..6baa6a16
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/cloud/ServiceCallConfigurationTest.xml
@@ -0,0 +1,51 @@
+<?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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.osgi.org/xmlns/blueprint/v1.0.0
+ https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
+
+ <camelContext xmlns="http://camel.apache.org/schema/blueprint">
+
+ <serviceCallConfiguration id="conf1">
+ <staticServiceDiscovery>
+ <servers>localhost:9091</servers>
+ </staticServiceDiscovery>
+ </serviceCallConfiguration>
+
+ <serviceCallConfiguration id="conf2">
+ <staticServiceDiscovery>
+ <servers>localhost:9092</servers>
+ <servers>localhost:9093,localhost:9094</servers>
+ </staticServiceDiscovery>
+ </serviceCallConfiguration>
+
+ <route id="test1">
+ <from uri="direct:start1"/>
+ <serviceCall name="test" configurationRef="conf1"/>
+ </route>
+ <route id="test2">
+ <from uri="direct:start2"/>
+ <serviceCall name="test" configurationRef="conf2"/>
+ </route>
+ </camelContext>
+
+</blueprint>
\ No newline at end of file
diff --git a/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/cloud/ServiceCallFilterTest.xml b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/cloud/ServiceCallFilterTest.xml
new file mode 100644
index 00000000..d199501f
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/cloud/ServiceCallFilterTest.xml
@@ -0,0 +1,54 @@
+<?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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.osgi.org/xmlns/blueprint/v1.0.0
+ https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
+
+ <camelContext xmlns="http://camel.apache.org/schema/blueprint">
+
+ <interceptSendToEndpoint uri="file:*" skipSendToOriginalEndpoint="true">
+ <to uri="mock:result"/>
+ </interceptSendToEndpoint>
+
+ <route id="test">
+ <from uri="direct:start"/>
+ <serviceCall name="test" component="file">
+
+ <staticServiceDiscovery>
+ <servers>test@host1:9093</servers>
+ <servers>test@host2:9093</servers>
+ <servers>unknown@host1:9094</servers>
+ <servers>test@host3:9093</servers>
+ <servers>test@host4:9094</servers>
+ </staticServiceDiscovery>
+
+ <blacklistServiceFilter>
+ <servers>test@host2:9093</servers>
+ <servers>test@host3:9093</servers>
+ </blacklistServiceFilter>
+ </serviceCall>
+
+ </route>
+
+ </camelContext>
+
+</blueprint>
\ No newline at end of file
diff --git a/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/component/rest/FromRestConfigurationTest.xml b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/component/rest/FromRestConfigurationTest.xml
new file mode 100644
index 00000000..e9117c17
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/component/rest/FromRestConfigurationTest.xml
@@ -0,0 +1,85 @@
+<?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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
+
+ <!-- use a dummy rest consumer factory for the rest engine -->
+ <bean id="dummy-rest" class="org.apache.camel.test.blueprint.component.rest.DummyRestConsumerFactory"/>
+
+ <camelContext xmlns="http://camel.apache.org/schema/blueprint">
+
+ <restConfiguration component="dummy-rest" host="localhost" port="9090">
+ <componentProperty key="foo" value="bar"/>
+ <componentProperty key="other" value="stuff"/>
+ <endpointProperty key="size" value="200"/>
+ <consumerProperty key="pollTimeout" value="1000"/>
+ </restConfiguration>
+
+ <rest path="/say/hello">
+ <get>
+ <to uri="direct:hello"/>
+ </get>
+ </rest>
+ <rest path="/say/bye">
+ <get consumes="application/json">
+ <param name="header_count" type="header" description="header param description1" dataType="integer" defaultValue="1" required="true">
+ <allowableValues>
+ <value>1</value>
+ <value>2</value>
+ <value>3</value>
+ <value>4</value>
+ </allowableValues>
+ </param>
+ <param name="header_letter" type="query" description="header param description2" dataType="string" defaultValue="b" collectionFormat="multi" required="false">
+ <allowableValues>
+ <value>a</value>
+ <value>b</value>
+ <value>c</value>
+ <value>d</value>
+ </allowableValues>
+ </param>
+ <responseMessage code="300" message="test msg" responseModel="java.lang.Integer">
+ <header name="rate" description="Rate limit" dataType="integer"/>
+ </responseMessage>
+ <to uri="direct:bye"/>
+ </get>
+ <post>
+ <to uri="mock:update"/>
+ </post>
+ </rest>
+
+ <route>
+ <from uri="direct:hello"/>
+ <transform>
+ <constant>Hello World</constant>
+ </transform>
+ </route>
+ <route>
+ <from uri="direct:bye"/>
+ <transform>
+ <constant>Bye World</constant>
+ </transform>
+ </route>
+
+ </camelContext>
+
+</blueprint>
\ No newline at end of file
diff --git a/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/component/rest/FromRestGetInterceptTest.xml b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/component/rest/FromRestGetInterceptTest.xml
new file mode 100644
index 00000000..71441f40
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/component/rest/FromRestGetInterceptTest.xml
@@ -0,0 +1,51 @@
+<?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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
+
+ <!-- use a dummy rest consumer factory for the rest engine -->
+ <bean id="dummy-rest" class="org.apache.camel.test.blueprint.component.rest.DummyRestConsumerFactory"/>
+
+ <camelContext xmlns="http://camel.apache.org/schema/blueprint">
+
+ <intercept>
+ <to uri="mock:intercept"/>
+ </intercept>
+
+ <rest path="/say/hello">
+ <get>
+ <to uri="direct:hello"/>
+ </get>
+ </rest>
+
+ <route>
+ <from uri="direct:hello"/>
+ <to uri="mock:hello"/>
+ <to uri="mock:bar"/>
+ <transform>
+ <constant>Bye World</constant>
+ </transform>
+ </route>
+
+ </camelContext>
+
+</blueprint>
\ No newline at end of file
diff --git a/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/component/rest/FromRestGetOnExceptionTest.xml b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/component/rest/FromRestGetOnExceptionTest.xml
new file mode 100644
index 00000000..e12930f8
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/component/rest/FromRestGetOnExceptionTest.xml
@@ -0,0 +1,59 @@
+<?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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
+
+ <bean id="darn" class="java.lang.IllegalArgumentException">
+ <argument index="0" value="Forced"/>
+ </bean>
+
+ <!-- use a dummy rest consumer factory for the rest engine -->
+ <bean id="dummy-rest" class="org.apache.camel.test.blueprint.component.rest.DummyRestConsumerFactory"/>
+
+ <camelContext xmlns="http://camel.apache.org/schema/blueprint">
+
+ <onException>
+ <exception>java.lang.IllegalArgumentException</exception>
+ <handled>
+ <constant>true</constant>
+ </handled>
+ <transform>
+ <constant>Handled the error</constant>
+ </transform>
+ </onException>
+
+ <rest path="/say/hello">
+ <get>
+ <to uri="direct:hello"/>
+ </get>
+ </rest>
+
+ <route>
+ <from uri="direct:hello"/>
+ <to uri="mock:hello"/>
+ <to uri="mock:bar"/>
+ <throwException ref="darn"/>
+ </route>
+
+ </camelContext>
+
+</blueprint>
\ No newline at end of file
diff --git a/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/component/rest/FromRestGetRouteOnExceptionTest.xml b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/component/rest/FromRestGetRouteOnExceptionTest.xml
new file mode 100644
index 00000000..2ec165f0
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/component/rest/FromRestGetRouteOnExceptionTest.xml
@@ -0,0 +1,58 @@
+<?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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
+
+ <bean id="darn" class="java.lang.IllegalArgumentException">
+ <argument index="0" value="Forced"/>
+ </bean>
+
+ <!-- use a dummy rest consumer factory for the rest engine -->
+ <bean id="dummy-rest" class="org.apache.camel.test.blueprint.component.rest.DummyRestConsumerFactory"/>
+
+ <camelContext xmlns="http://camel.apache.org/schema/blueprint">
+
+ <rest path="/say/hello">
+ <get>
+ <to uri="direct:hello"/>
+ </get>
+ </rest>
+
+ <route>
+ <from uri="direct:hello"/>
+ <onException>
+ <exception>java.lang.IllegalArgumentException</exception>
+ <handled>
+ <constant>true</constant>
+ </handled>
+ <transform>
+ <constant>Handled the error</constant>
+ </transform>
+ </onException>
+ <to uri="mock:hello"/>
+ <to uri="mock:bar"/>
+ <throwException ref="darn"/>
+ </route>
+
+ </camelContext>
+
+</blueprint>
\ No newline at end of file
diff --git a/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/component/rest/FromRestGetTest.xml b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/component/rest/FromRestGetTest.xml
new file mode 100644
index 00000000..a9b862f2
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/component/rest/FromRestGetTest.xml
@@ -0,0 +1,78 @@
+<?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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
+
+ <!-- use a dummy rest consumer factory for the rest engine -->
+ <bean id="dummy-rest" class="org.apache.camel.test.blueprint.component.rest.DummyRestConsumerFactory"/>
+
+ <camelContext xmlns="http://camel.apache.org/schema/blueprint">
+
+ <rest path="/say/hello">
+ <get>
+ <to uri="direct:hello"/>
+ </get>
+ </rest>
+ <rest path="/say/bye">
+ <get consumes="application/json">
+ <param name="header_count" type="header" description="header param description1" dataType="integer" defaultValue="1" required="true">
+ <allowableValues>
+ <value>1</value>
+ <value>2</value>
+ <value>3</value>
+ <value>4</value>
+ </allowableValues>
+ </param>
+ <param name="header_letter" type="query" description="header param description2" dataType="string" defaultValue="b" collectionFormat="multi" required="false">
+ <allowableValues>
+ <value>a</value>
+ <value>b</value>
+ <value>c</value>
+ <value>d</value>
+ </allowableValues>
+ </param>
+ <responseMessage code="300" message="test msg" responseModel="java.lang.Integer">
+ <header name="rate" description="Rate limit" dataType="integer"/>
+ </responseMessage>
+ <to uri="direct:bye"/>
+ </get>
+ <post>
+ <to uri="mock:update"/>
+ </post>
+ </rest>
+
+ <route>
+ <from uri="direct:hello"/>
+ <transform>
+ <constant>Hello World</constant>
+ </transform>
+ </route>
+ <route>
+ <from uri="direct:bye"/>
+ <transform>
+ <constant>Bye World</constant>
+ </transform>
+ </route>
+
+ </camelContext>
+
+</blueprint>
\ No newline at end of file
diff --git a/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/component/rest/FromRestIdAndDescriptionTest.xml b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/component/rest/FromRestIdAndDescriptionTest.xml
new file mode 100644
index 00000000..12224719
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/component/rest/FromRestIdAndDescriptionTest.xml
@@ -0,0 +1,83 @@
+<?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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
+
+ <!-- use a dummy rest consumer factory for the rest engine -->
+ <bean id="dummy-rest" class="org.apache.camel.test.blueprint.component.rest.DummyRestConsumerFactory"/>
+
+ <camelContext xmlns="http://camel.apache.org/schema/blueprint">
+
+ <rest id="hello" path="/say/hello">
+ <description>Hello Service</description>
+ <get id="get-say">
+ <description>Says hello to you</description>
+ <to uri="direct:hello"/>
+ </get>
+ </rest>
+ <rest id="bye" path="/say/bye">
+ <description lang="en">Bye Service</description>
+ <get consumes="application/json">
+ <description>Says bye to you</description>
+ <param name="header_count" type="header" description="header param description1" dataType="integer" defaultValue="1" required="true">
+ <allowableValues>
+ <value>1</value>
+ <value>2</value>
+ <value>3</value>
+ <value>4</value>
+ </allowableValues>
+ </param>
+ <param name="header_letter" type="query" description="header param description2" dataType="string" defaultValue="b" collectionFormat="multi" required="false">
+ <allowableValues>
+ <value>a</value>
+ <value>b</value>
+ <value>c</value>
+ <value>d</value>
+ </allowableValues>
+ </param>
+ <responseMessage code="300" message="test msg" responseModel="java.lang.Integer">
+ <header name="rate" description="Rate limit" dataType="integer"/>
+ </responseMessage>
+ <to uri="direct:bye"/>
+ </get>
+ <post>
+ <description>Updates the bye message</description>
+ <to uri="mock:update"/>
+ </post>
+ </rest>
+
+ <route>
+ <from uri="direct:hello"/>
+ <transform>
+ <constant>Hello World</constant>
+ </transform>
+ </route>
+ <route>
+ <from uri="direct:bye"/>
+ <transform>
+ <constant>Bye World</constant>
+ </transform>
+ </route>
+
+ </camelContext>
+
+</blueprint>
\ No newline at end of file
diff --git a/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/component/rest/FromRestUriPrefixTest.xml b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/component/rest/FromRestUriPrefixTest.xml
new file mode 100644
index 00000000..b08b9bca
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/component/rest/FromRestUriPrefixTest.xml
@@ -0,0 +1,57 @@
+<?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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
+
+ <!-- use a dummy rest consumer factory for the rest engine -->
+ <bean id="dummy-rest" class="org.apache.camel.test.blueprint.component.rest.DummyRestConsumerFactory"/>
+
+ <camelContext xmlns="http://camel.apache.org/schema/blueprint">
+
+ <rest path="/say/">
+ <get path="/hello">
+ <to uri="direct:hello"/>
+ </get>
+ <get path="/bye" consumes="application/json">
+ <to uri="direct:bye"/>
+ </get>
+ <post path="/hi">
+ <to uri="mock:update"/>
+ </post>
+ </rest>
+
+ <route>
+ <from uri="direct:hello"/>
+ <transform>
+ <constant>Hello World</constant>
+ </transform>
+ </route>
+ <route>
+ <from uri="direct:bye"/>
+ <transform>
+ <constant>Bye World</constant>
+ </transform>
+ </route>
+
+ </camelContext>
+
+</blueprint>
\ No newline at end of file
diff --git a/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/component/rest/RestRefTest.xml b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/component/rest/RestRefTest.xml
new file mode 100644
index 00000000..74b41914
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/component/rest/RestRefTest.xml
@@ -0,0 +1,64 @@
+<?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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
+
+ <!-- use a dummy rest consumer factory for the rest engine -->
+ <bean id="dummy-rest" class="org.apache.camel.test.blueprint.component.rest.DummyRestConsumerFactory"/>
+
+ <restContext id="myCoolRest" xmlns="http://camel.apache.org/schema/blueprint">
+ <rest path="/say/hello">
+ <get>
+ <to uri="direct:hello"/>
+ </get>
+ </rest>
+ </restContext>
+
+ <camelContext xmlns="http://camel.apache.org/schema/blueprint">
+
+ <restContextRef ref="myCoolRest"/>
+
+ <rest path="/say/bye">
+ <get consumes="application/json">
+ <to uri="direct:bye"/>
+ </get>
+ <post>
+ <to uri="mock:update"/>
+ </post>
+ </rest>
+
+ <route>
+ <from uri="direct:hello"/>
+ <transform>
+ <constant>Hello World</constant>
+ </transform>
+ </route>
+ <route>
+ <from uri="direct:bye"/>
+ <transform>
+ <constant>Bye World</constant>
+ </transform>
+ </route>
+
+ </camelContext>
+
+</blueprint>
\ No newline at end of file
diff --git a/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/configadmin-endpoint-no-defaults.xml b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/configadmin-endpoint-no-defaults.xml
new file mode 100644
index 00000000..d04eed81
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/configadmin-endpoint-no-defaults.xml
@@ -0,0 +1,46 @@
+<?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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
+ xsi:schemaLocation="
+ http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0 http://aries.apache.org/schemas/blueprint-cm/blueprint-cm-1.1.0.xsd
+ http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
+
+ <!-- blueprint property placeholders -->
+ <cm:property-placeholder persistent-id="my-placeholders" update-strategy="reload">
+ </cm:property-placeholder>
+
+ <camelContext id="myCamel" xmlns="http://camel.apache.org/schema/blueprint">
+
+ <!-- need to use {{ }} with blueprint -->
+ <endpoint id="foo" uri="{{destination}}"/>
+
+ <route>
+ <from uri="direct:start"/>
+ <transform>
+ <simple>{{greeting}} ${body}</simple>
+ </transform>
+ <to uri="ref:foo"/>
+ </route>
+
+ </camelContext>
+
+</blueprint>
diff --git a/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/configadmin-endpoint.xml b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/configadmin-endpoint.xml
new file mode 100644
index 00000000..1d9212c5
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/configadmin-endpoint.xml
@@ -0,0 +1,50 @@
+<?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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
+ xsi:schemaLocation="
+ http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0 http://aries.apache.org/schemas/blueprint-cm/blueprint-cm-1.0.0.xsd
+ http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
+
+ <!-- blueprint property placeholders -->
+ <cm:property-placeholder persistent-id="my-placeholders">
+ <cm:default-properties>
+ <cm:property name="greeting" value="Bye"/>
+ <cm:property name="destination" value="mock:result"/>
+ </cm:default-properties>
+ </cm:property-placeholder>
+
+ <camelContext id="myCamel" xmlns="http://camel.apache.org/schema/blueprint">
+
+ <!-- need to use {{ }} with blueprint -->
+ <endpoint id="foo" uri="{{destination}}"/>
+
+ <route>
+ <from uri="direct:start"/>
+ <transform>
+ <simple>{{greeting}} ${body}</simple>
+ </transform>
+ <to uri="ref:foo"/>
+ </route>
+
+ </camelContext>
+
+</blueprint>
diff --git a/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/configadmin-loadfile.xml b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/configadmin-loadfile.xml
new file mode 100644
index 00000000..1540e5e3
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/configadmin-loadfile.xml
@@ -0,0 +1,47 @@
+<?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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
+ xsi:schemaLocation="
+ http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0 http://aries.apache.org/schemas/blueprint-cm/blueprint-cm-1.1.0.xsd
+ http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
+
+ <!-- START SNIPPET: e1 -->
+ <!-- blueprint property placeholders, that will use etc/stuff.cfg as the properties file -->
+ <cm:property-placeholder persistent-id="stuff" update-strategy="reload"/>
+
+ <!-- a bean that uses a blueprint property placeholder -->
+ <bean id="myCoolBean" class="org.apache.camel.test.blueprint.MyCoolBean">
+ <property name="say" value="${greeting}"/>
+ </bean>
+
+ <camelContext xmlns="http://camel.apache.org/schema/blueprint">
+
+ <route>
+ <from uri="direct:start"/>
+ <bean ref="myCoolBean" method="saySomething"/>
+ <to uri="mock:result"/>
+ </route>
+
+ </camelContext>
+ <!-- END SNIPPET: e1 -->
+
+</blueprint>
diff --git a/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/configadmin-loadfileoverride.xml b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/configadmin-loadfileoverride.xml
new file mode 100644
index 00000000..647d9f49
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/configadmin-loadfileoverride.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.
+
+-->
+<!-- START SNIPPET: e1 -->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
+ xsi:schemaLocation="
+ http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0 http://aries.apache.org/schemas/blueprint-cm/blueprint-cm-1.1.0.xsd
+ http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
+
+ <!-- blueprint property placeholders, that will use etc/stuff.cfg as the properties file -->
+ <cm:property-placeholder persistent-id="stuff" update-strategy="reload">
+ <cm:default-properties>
+ <cm:property name="greeting" value="Hello" />
+ <cm:property name="echo" value="Hey" />
+ <cm:property name="destination" value="mock:original" />
+ </cm:default-properties>
+ </cm:property-placeholder>
+
+ <!-- a bean that uses a blueprint property placeholder -->
+ <bean id="myCoolBean" class="org.apache.camel.test.blueprint.MyCoolBean">
+ <property name="say" value="${greeting}"/>
+ <property name="echo" value="${echo}"/>
+ </bean>
+
+ <camelContext xmlns="http://camel.apache.org/schema/blueprint">
+
+ <route>
+ <from uri="direct:start"/>
+ <bean ref="myCoolBean" method="saySomething"/>
+ <to uri="{{destination}}"/>
+ <bean ref="myCoolBean" method="echoSomething"/>
+ <to uri="{{destination}}"/>
+ </route>
+
+ </camelContext>
+
+</blueprint>
+<!-- END SNIPPET: e1 -->
\ No newline at end of file
diff --git a/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/configadmin-loadmultifileoverride.xml b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/configadmin-loadmultifileoverride.xml
new file mode 100644
index 00000000..75db415a
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/configadmin-loadmultifileoverride.xml
@@ -0,0 +1,80 @@
+<?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.
+
+-->
+<!-- START SNIPPET: e1 -->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
+ xsi:schemaLocation="
+ http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0 http://aries.apache.org/schemas/blueprint-cm/blueprint-cm-1.1.0.xsd
+ http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
+
+ <!-- blueprint property placeholders, that will use etc/stuff.cfg as the properties file -->
+ <cm:property-placeholder persistent-id="stuff" update-strategy="reload" >
+ <cm:default-properties>
+ <cm:property name="greeting" value="Hello" />
+ <cm:property name="echo" value="Hey" />
+ <cm:property name="destination" value="mock:original" />
+ </cm:default-properties>
+ </cm:property-placeholder>
+
+ <!-- blueprint property placeholders, that will use etc/otherstuff.cfg as the properties file -->
+ <cm:property-placeholder persistent-id="otherstuff" update-strategy="reload" placeholder-prefix="[" placeholder-suffix="]">
+ <cm:default-properties>
+ <cm:property name="salutation" value="Salut" />
+ <cm:property name="resonner" value="Hep" />
+ <cm:property name="arrive" value="mock:otherOriginal" />
+ </cm:default-properties>
+ </cm:property-placeholder>
+
+ <!-- a bean that uses a blueprint property placeholder -->
+ <bean id="myCoolBean" class="org.apache.camel.test.blueprint.MyCoolBean">
+ <property name="say" value="${greeting}"/>
+ <property name="echo" value="${echo}"/>
+ </bean>
+
+ <!-- a bean that uses a different blueprint property placeholder -->
+ <bean id="myOtherCoolBean" class="org.apache.camel.test.blueprint.MyCoolBean">
+ <property name="say" value="[salutation]"/>
+ <property name="echo" value="[resonner]"/>
+ </bean>
+
+
+ <camelContext xmlns="http://camel.apache.org/schema/blueprint">
+
+ <route>
+ <from uri="direct:start"/>
+ <bean ref="myCoolBean" method="saySomething"/>
+ <to uri="{{destination}}"/>
+ <bean ref="myCoolBean" method="echoSomething"/>
+ <to uri="{{destination}}"/>
+ </route>
+
+ <route>
+ <from uri="direct:otherStart"/>
+ <bean ref="myOtherCoolBean" method="saySomething"/>
+ <to uri="{{arrive}}"/>
+ <bean ref="myOtherCoolBean" method="echoSomething"/>
+ <to uri="{{arrive}}"/>
+ </route>
+
+ </camelContext>
+
+</blueprint>
+<!-- END SNIPPET: e1 -->
\ No newline at end of file
diff --git a/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/configadmin-no-reload-default-properties.xml b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/configadmin-no-reload-default-properties.xml
new file mode 100644
index 00000000..cb9127d5
--- /dev/null
+++ b/components/camel-test-blueprint-junit5/src/test/resources/org/apache/camel/test/blueprint/configadmin-no-reload-default-properties.xml
@@ -0,0 +1,52 @@
+<?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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
+ xsi:schemaLocation="
+ http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0 http://aries.apache.org/schemas/blueprint-cm/blueprint-cm-1.1.0.xsd
+ http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
+
+ <!-- START SNIPPET: e1 -->
+ <!-- blueprint property placeholders, PID="stuff" is empty during placeholder initialization
+ but we have <cm:default-properties> -->
+ <cm:property-placeholder persistent-id="stuff" update-strategy="none">
+ <cm:default-properties>
+ <cm:property name="greeting" value="Good morning" />
+ </cm:default-properties>
+ </cm:property-placeholder>
+
+ <!-- a bean that uses a blueprint property placeholder -->
+ <bean id="myCoolBean" class="org.apache.camel.test.blueprint.MyCoolBean">
+ <property name="say" value="${greeting}"/>
+ </bean>
+
+ <camelContext xmlns="http://camel.apache.org/schema/blueprint">
+
+ <route>
+ <from uri="direct:start"/>
+ <bean ref="myCoolBean" method="saySomething"/>
+ <to uri="mock:result"/>
+ </route>
+
+ </camelContext>
+ <!-- END SNIPPET: e1 -->
+
... 1931 lines suppressed ...