You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by al...@apache.org on 2019/10/04 14:30:35 UTC
[camel] branch CAMEL-13965 updated (b30a554 -> 0bd44e6)
This is an automated email from the ASF dual-hosted git repository.
aldettinger pushed a change to branch CAMEL-13965
in repository https://gitbox.apache.org/repos/asf/camel.git.
from b30a554 CAMEL-13965: Fixed the build
add 093c504 Regen
add 0a8a767 CAMEL-13998 - Kerberos authentication for HDFS connections
add 51df429 CAMEL-13998 - update all to LF
add bc16593 CAMEL-13998 - Unit tests
add 00ae596 CAMEL-13998 - Unit tests
add f884323 CAMEL-13998 - Documentation
add 28298f6 CAMEL-13998 - fix sonar issue
add 973edb0 CAMEL-13998 - formatting + unit tests
add 415c299 CAMEL-13998 - code review (add license header)
add 9370dee CAMEL-13998 - code review (mistake in documentation)
add 0d277e7 CAMEL-13998 - code review (refactor + codestyle)
add b494c59 CAMEL-13998 - code review (mistake in documentation)
add 62a557b CAMEL-13998 - code review (use isNotEmpty)
add c73ea21 Fix minor slip in the documentation.
add 98bdbc2 removed exception from method signature (no longer thrown after code review)
add 402b379 Fix failing tests.
add 27fb5ed CAMEL-13998 - Fixed compilation and tests
add d8e7f0a Upgrade Mockwebserver to version 0.1.6
add 93b51fb Upgrade Drools to version 7.27.0.Final
add 45b735e Upgrade Kie to version 7.27.0.Final
add d08b6b1 Upgrade Optaplanner to version 7.27.0.Final
add 89ab715 Upgrade Jbpm to version 7.27.0.Final
add 702341f Regen
add f52403b [CAMEL-13121] Route irc->irc cycles the message because of irc.target header
add ae78c18 Regen docs
add 2ddb0a2 Upgrade Ignite to version 2.7.6
add a4c6ed0 Camel-Zipkin: Fixed CS
add a9a9dcb Upgrade Artemis to version 2.10.1
add 399d0a9 fix azure blob client code sample
add 94cf62e Merge pull request #3207 from smccarthy-ie/azure-blob-client-code-sample
add 1738ee2 Regen docs
add 943d7e2 Upgrade Async Http Client to version 2.10.3
add 034180d Fix not honoring the amazonAWSHost (CAMEL-14002)
add 3971b22 Do use the client configuration instance if it's given
add ffc66fa CAMEL-14002 - Regen docs
add 7bc754b Regen docs - this closes pull requests #3201 #3202
add 73b1d20 CAMEL-14011 - Refactor camel-hdfs component to reduce issues reported by sonar (#3210)
add fbed4bd CAMEL-14017 - Update to support the full streaming on both inbound and outbound (#3209)
add 96fc480 CAMEL-13988: Add Map data input support to Protobuf dataformat (#3206)
add 3930f3b Update README.adoc
add 184ec93 Regen
add 77323cf Updated user manual TOC
add d7b7e04 Update Karaf
add 6715b9c Upgrade pax logging
add 9fb6249 CAMEL-14018: karaf feature for camel-elasticsearch-rest issue
add bde1180 Upgrade Jetty
add 1caf43b Fixed docs module
add 726863b CAMEL-13930 - Improve the camel-http docs to clarify the authenticationPreemptive option when Basic auth with streaming message body
add 93cf19a Merge pull request #3211 from zhfeng/CAMEL-13930
add 6173d5a Regen docs
add 20786f1 Upgrade Paho to version 1.2.2
add ebe394b CAMEL-13820: ResolveEndpointFailedException should mask sensitive information in uri
add e15b5ae Upgrade felix gogo in camel-test-karaf
add db2bd91 Upgrade maven-bundle-plugin
add deccd10 Add @BindToRegistry to docs
add b8bbbac Upgrade Qpid JMS to version 0.46.0
add eb58b51 CAMEL-13901: camel-main-plugin - Dont run it automatic on compile
add cae5b47 CAMEL-13958: XPathBuilder threadSafe mode should also be enabled when the NodeList contains only 1 item
add 8a572b0 Upgrade TestContainers to version 1.12.2
add efe1826 Upgrade Mockwebserver to version 0.1.7
add d0d537b Fixed indentation in parent/pom
add d5fdf36 [CAMEL-14000] Fix Service leak when pool size is small
add 9808b43 CAMEL-14021: Fix HDFS polling conumer message processing (#3213)
add 884396f trivial formatting fix (#3212)
add 0f89cd3 Upgrade netty
add 0dd6c6c CAMEL-14107: Add netty leak detection into the maven-surefire-plugin
add be35d58 Removed stuff not in use
add 758bdf0 Spring upgrades
add 78ef07a Polished
add de47c46 CAMEL-13957
add ed0796c Update endpoint-annotations.adoc
add 87955de Update endpoint-annotations.adoc
add f9cca6e Upgrade Micrometer to version 1.2.2
add a1b7b7d Upgrade Rome to version 1.12.2
add 7f779a1 Upgrade Commons Pool to version 2.7.0
add a00e82d CAMEL-13878: Message is forwarded to the wrong Kafka Topic.
add 34259dc CAMEL-13878: Message is forwarded to the wrong Kafka Topic.
add dafff18 CAMEL-13878: Regen and add a log when the consumer thread is terminating.
add 7e395e7 Camel-AWS-Ec2: Added list of supported operations
add 6fb5922 Camel AWS EC2: Added example of create and run instance through producer
add f0374fc Regen docs
add b098d75 camel-kafka avoid using deprecated api
add 8eef255 Camel AWS DDB: Add supported producer operations list on docs
add 1037c5b Regen docs
add c0d809a Camel AWS ECS: Added sample code on docs
add 8f58182 Regen docs
add f6d632b Camel AWS EKS: Added sample code for producer in docs
add ec694db Regen docs
add c04f8e1 Camel AWS EKS: Fixed docs
add d38c4a1 Regen docs
add f32ec39 Camel-AWS-IAM: Added sample code for producer on docs
add e1b2bda Regen docs
add 041c837 Camel-AWS-KMS: added sample code for producer on docs
add 0c9fffb Regen docs
add ad08508 Camel-AWS MQ: Added operations list for producer on docs
add 84f6e17 Regen docs
add 6f09360 Camel AWS MQ: Added sample code for AWS MQ Producer on docs
add 66bbc1d Regen docs
add bc94ac9 Add Apache license header
add cc43af4 Exclude *.avsc from license check
add 7f31a54 fix typo
add 52e4f05 Update pollEnrich-eip.adoc
add be999fe Update enrich-eip.adoc
add 5c3fa7b Regen
add e65b304 Upgrade swagger
add 6222803 Add root file that points to the camel 3 migration guide as otherwise people may not find it
add 2ff9320 Add migration of camel-kafka
add 717b24c Update Camel3-Migration-Guide.md
add 30e82ab Update migration guide
add 6ff9997 Missing `columnName` description (#3215)
add 3f96c23 Camel AWS MSK: Added sample code for MSK on docs
add dbcd302 Regen docs
add b65e62f chore(main): filter properties by prefix
add 46282ab chore(main): make utility methods protected so they can be used by classes extending MainSupport
add f06f2c5 Upgrade Jackson to version 2.10.0
add 5444fd0 Fixed Jackson related to LambdaClient Mock for camel-aws-lambda and regen
add 26cb8cf Camel-Wordpress: Fixed Karaf feature after upgrading to Jackson 2.10.0
add 5177cf9 Fixed Camel-JacksonXml Karaf feature after upgrading to Jackson 2.10.0
add 8f97640 Fixed Camel-Olingo4 Karaf feature after upgrading to Jackson 2.10.0
add 25096f6 Update NOTICE copyright year to 2019
add 2b2227e Upgrade Braintree to version 2.105.0
add bbbf2cc Camel-AWS SDB: Added list of producer operations on docs
add 8fafcbe Regen docs
add 879805c Camel-AWS SES: Fixed paragraph for maven deps in docs
add 5320684 Regen docs
add b99efd2 Camel-AWS SES: Added a producer example to docs
add 02f1dbb Regen docs
add 1acf3c5 CAMEL-14030: camel-ftp - streamDownload=true and move options dont work. Thanks to Peter Nowak for reporting and the suggested fix.
add b6b1432 Upgrade AWS SDK and related bundle to version 1.11.636
add 41048e1 Upgrade Pulsar and related bundle to version 2.4.1
add 417c96e Upgrade Fastjson and related bundle to version 1.2.61
add 8a33801 Upgrade Libphonenumber and related bundle to version 8.10.19
add a51232e Upgrade Java Util and related bundle to version 1.36.0
add 81701d9 Upgrade Avro and related bundle to version 1.9.1
add 3264e4079 Fixed Camel-Avro Spring Boot Integration test
add e5f2683 Use the 2.3.0_2 kafka-clients bundle in the camel-kafka karaf feature
add bbfcdd0 Upgrade Saxon and related bundle to version 9.9.1-5
add b8a7b7a Upgrade ElasticsearchRest and related bundle to version 7.3.2
add a730521 Use only one property placeholder for kafka bundle
add c593784 Upgrade Spring Boot to version 2.1.9.RELEASE
add 280669e Regen
add 86b61ba Adding support for meta and verifier extension
add 5926e27 Additional fixes according feedback provided in PR #3217
add 8d047a6 Upgrade Johnzon to version 1.2.1
add 47c6734 fixes anchor, looks like @ is not allowed
add e26ac84 Merge pull request #3220 from danhaywood/patch-2
add 7cac1be similar fix, remove @ from anchor
add d433d3c Merge pull request #3221 from danhaywood/patch-3
add ff78fe7 Upgrade Zipkin to version 2.17.1
add ad6a1a6 Upgrade Brave Zipkin to version 5.8.0
add af1e37e Fixed Camel-Salesforce Karaf feature
add 000938a CAMEL-14033: Fixed NPE in camel-sjms when doing request/reply and recieving a message that cannot be correlated. Using similar logging as camel-jms does.
add 8a2f44d Polished
add 4f85af1 CAMEL-14033: Update doc to say queues should be used for request/response.
add 54e103a Upgrade Hazelcast to version 3.12.3
add 30affd0 CAMEL-14031: Move command line stuff from MainSupport to special class.
add 582a576 Regen
add c57ec10 CAMEL-14034: RouteBuilder should be Ordered so we can sort the routes loaded.
add f56206a CAMEL-14031: Move stuff into BaseMainSupport for easier reuse in camel-quarkus and others
add 64b8c1d CAMEL-13965: Restored JUnit 4 based tests in camel-spring-boot
add c1ef085 CAMEL-13270: camel-rabbitmq allow headers that RabbitMQ accepts. Also allow all x- header types.
new 0bd44e6 CAMEL-14307: Created camel-testcontainers-junit5 from camel-testcontainers
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
Camel3-Migration-Guide.md | 1 +
apache-camel/src/main/descriptors/common-bin.xml | 1 +
apache-camel/src/main/release/NOTICE.txt | 2 +-
.../src/main/resources/META-INF/NOTICE.txt | 2 +-
bom/camel-bom/pom.xml | 5 +
.../src/main/docs/aws-ddb-component.adoc | 13 +
.../src/main/docs/aws-ec2-component.adoc | 28 +
.../src/main/docs/aws-ecs-component.adoc | 10 +
.../src/main/docs/aws-eks-component.adoc | 10 +
.../src/main/docs/aws-iam-component.adoc | 11 +
.../src/main/docs/aws-kms-component.adoc | 10 +
.../aws/lambda/AmazonLambdaClientMock.java | 2 +-
.../src/main/docs/aws-mq-component.adoc | 21 +
.../src/main/docs/aws-msk-component.adoc | 10 +
.../src/main/docs/aws-sdb-component.adoc | 14 +
.../src/main/docs/aws-ses-component.adoc | 19 +-
.../src/main/docs/aws-sqs-component.adoc | 6 +-
.../camel/component/aws/sqs/SqsConfiguration.java | 15 +
.../camel/component/aws/sqs/SqsEndpoint.java | 50 +-
.../src/main/docs/azure-blob-component.adoc | 31 +-
.../src/main/docs/bindy-dataformat.adoc | 24 +
components/camel-consul/pom.xml | 10 +
.../camel/component/consul/ConsulCatalogTest.java | 16 +-
.../component/consul/ConsulClientKeyValueTest.java | 5 +-
.../component/consul/ConsulCoordinatesTest.java | 20 +-
.../camel/component/consul/ConsulEventTest.java | 6 +-
.../component/consul/ConsulEventWatchTest.java | 2 +-
.../camel/component/consul/ConsulHealthTest.java | 12 +-
.../camel/component/consul/ConsulKeyValueTest.java | 5 +-
.../component/consul/ConsulKeyValueWatchTest.java | 2 +-
.../camel/component/consul/ConsulRegistryTest.java | 21 +-
.../component/consul/ConsulRegistryUtilsTest.java | 6 +-
.../camel/component/consul/ConsulSessionTest.java | 18 +-
.../camel/component/consul/ConsulTestSupport.java | 11 +-
.../cloud/ConsulDefaultServiceCallRouteTest.java | 2 +-
.../cloud/ConsulRibbonServiceCallRouteTest.java | 2 +-
.../ConsulServiceCallWithRegistrationTest.java | 10 +-
.../consul/cloud/ConsulServiceDiscoveryTest.java | 5 +-
.../cloud/ConsulServiceRegistrationTestBase.java | 5 +-
.../consul/cloud/ConsulServiceRegistryTest.java | 4 +-
.../strategy/GenericFileRenameProcessStrategy.java | 9 +-
.../file/remote/FtpStreamingMoveTest.java | 77 ++
.../camel-hdfs/src/main/docs/hdfs-component.adoc | 25 +-
.../camel/component/hdfs/DefaultHdfsFileType.java | 114 ++
.../camel/component/hdfs/HdfsArrayFileType.java | 87 ++
.../camel/component/hdfs/HdfsBloommapFileType.java | 98 ++
.../apache/camel/component/hdfs/HdfsComponent.java | 13 +
.../camel/component/hdfs/HdfsConfiguration.java | 120 ++-
.../apache/camel/component/hdfs/HdfsConsumer.java | 141 +--
.../hdfs/{HdfsInfoFactory.java => HdfsFile.java} | 23 +-
.../camel/component/hdfs/HdfsFileSystemType.java | 4 +-
.../apache/camel/component/hdfs/HdfsFileType.java | 519 +--------
.../org/apache/camel/component/hdfs/HdfsInfo.java | 41 +-
.../camel/component/hdfs/HdfsInfoFactory.java | 4 +-
.../camel/component/hdfs/HdfsInputStream.java | 39 +-
.../camel/component/hdfs/HdfsMapFileType.java | 96 ++
.../camel/component/hdfs/HdfsNormalFileType.java | 145 +++
.../camel/component/hdfs/HdfsOutputStream.java | 4 +-
.../apache/camel/component/hdfs/HdfsProducer.java | 54 +-
.../camel/component/hdfs/HdfsSequenceFileType.java | 97 ++
.../component/hdfs/HdfsWritableFactories.java | 7 +-
.../hdfs/kerberos/KerberosConfiguration.java | 138 +++
.../camel/component/hdfs/osgi/HdfsActivator.java | 7 +-
.../hdfs/kerberos/KerberosConfigurationTest.java | 94 ++
.../src/test/resources/kerberos/test-kerb5.conf | 12 +
.../src/test/resources/kerberos/test-keytab.bin | 1 +
.../camel-http/src/main/docs/http-component.adoc | 6 +
.../camel-irc/src/main/docs/irc-component.adoc | 11 +
.../apache/camel/component/irc/IrcConstants.java | 1 +
.../apache/camel/component/irc/IrcProducer.java | 8 +-
.../camel/component/irc/IrcProducerTest.java | 4 +-
.../component/irc/it/IrcMultiChannelRouteTest.java | 4 +-
.../component/jms/reply/QueueReplyManager.java | 2 +-
.../component/johnzon/JohnzonDataFormatTest.java | 2 +-
.../camel-kafka/src/main/docs/kafka-component.adoc | 15 +-
.../camel/component/kafka/KafkaConfiguration.java | 36 -
.../camel/component/kafka/KafkaConstants.java | 1 +
.../camel/component/kafka/KafkaConsumer.java | 7 +-
.../camel/component/kafka/KafkaProducer.java | 26 +-
.../camel/component/kafka/KafkaProducerTest.java | 64 +-
.../camel/component/mongodb/MongoDbComponent.java | 4 +
.../conf/ConnectionParamsConfiguration.java | 80 ++
.../mongodb/meta/MongoDBMetaExtension.java | 106 ++
.../verifier/MongoComponentVerifierExtension.java | 101 ++
.../component/mongodb/AbstractMongoDbTest.java | 33 +
.../component/mongodb/EmbedMongoConfiguration.java | 2 +-
.../mongodb/meta/MongoDbMetaExtensionTest.java | 153 +++
.../verifier/MongoDbVerifierExtensionTest.java | 140 +++
components/camel-netty-http/pom.xml | 4 +
.../netty/http/DefaultNettyHttpBinding.java | 48 +-
.../netty/http/HttpClientInitializerFactory.java | 7 +-
.../netty/http/HttpServerInitializerFactory.java | 7 +-
.../http/HttpServerSharedInitializerFactory.java | 5 +-
.../netty/http/InboundStreamHttpRequest.java} | 28 +-
.../netty/http/InboundStreamHttpResponse.java} | 28 +-
.../component/netty/http/NettyHttpBinding.java | 30 +-
.../component/netty/http/NettyHttpEndpoint.java | 10 +-
...Request.java => OutboundStreamHttpRequest.java} | 5 +-
...sponse.java => OutboundStreamHttpResponse.java} | 4 +-
.../component/netty/http/RestNettyHttpBinding.java | 4 +-
.../http/handlers/HttpClientChannelHandler.java | 21 +-
.../http/handlers/HttpInboundStreamHandler.java | 97 ++
.../HttpOutboundStreamHandler.java} | 25 +-
.../http/handlers/HttpServerChannelHandler.java | 16 +-
.../HttpServerMultiplexChannelHandler.java | 10 +-
.../component/netty/http/NettyHttpStreamTest.java | 156 +++
components/camel-netty/pom.xml | 18 +
.../src/main/docs/protobuf-dataformat.adoc | 8 +-
.../dataformat/protobuf/ProtobufConverter.java | 120 +++
.../dataformat/protobuf/ProtobufDataFormat.java | 21 +-
.../dataformat/protobuf/ProtobufConverterTest.java | 101 ++
.../ProtobufMarshalAndUnmarshalMapTest.java | 84 ++
.../src/test/proto/addressbook.proto | 9 +
.../src/main/docs/rabbitmq-component.adoc | 15 +-
.../rabbitmq/RabbitMQMessageConverter.java | 16 +-
.../camel-salesforce-component/pom.xml | 6 +
.../src/main/docs/sjms-batch-component.adoc | 2 +-
.../camel-sjms/src/main/docs/sjms-component.adoc | 4 +-
.../component/sjms/producer/InOutProducer.java | 13 +-
components/camel-spring-boot/pom.xml | 5 +
.../apache/camel/spring/boot/RoutesCollector.java | 21 +-
.../main/java/org/apache/camel/spring/Main.java | 2 +-
.../java/org/apache/camel/test/blueprint/Main.java | 4 +-
.../apache/camel/test/junit5/CamelTestSupport.java | 7 +
components/camel-test-karaf/pom.xml | 2 +-
.../pom.xml | 126 +--
.../src/main/docs/testcontainers-junit5.adoc | 136 +++
.../junit5/ContainerAwareTestSupport.java | 108 ++
.../junit5/ContainerPropertiesFunction.java | 74 ++
.../test/testcontainers/junit5/Containers.java | 84 ++
.../camel/test/testcontainers/junit5/Wait.java | 69 ++
.../junit5/ContainerAwareTestSupportIT.java | 55 +
.../src/test/resources/log4j2.properties | 0
.../apache/camel/language/xpath/XPathBuilder.java | 10 +-
.../apache/camel/zipkin/ServiceHostFunction.java | 5 +-
.../apache/camel/zipkin/ServicePortFunction.java | 5 +-
components/pom.xml | 1 +
.../camel/ResolveEndpointFailedException.java | 8 +-
.../AbstractLocationPropertiesSource.java | 2 +-
.../org/apache/camel/impl/engine/ServicePool.java | 7 +
.../src/main/docs/eips/enrich-eip.adoc | 9 +-
.../src/main/docs/eips/pollEnrich-eip.adoc | 9 +-
.../src/main/docs/eips/resequence-eip.adoc | 2 +-
.../org/apache/camel/builder/RouteBuilder.java | 16 +-
.../camel/model/OptionalIdentifiedDefinition.java | 5 +-
.../endpoint/dsl/HdfsEndpointBuilderFactory.java | 157 +++
.../endpoint/dsl/KafkaEndpointBuilderFactory.java | 88 +-
.../endpoint/dsl/SqsEndpointBuilderFactory.java | 33 +
.../{MainSupport.java => BaseMainSupport.java} | 645 ++---------
.../src/main/java/org/apache/camel/main/Main.java | 2 +-
.../apache/camel/main/MainCommandLineSupport.java | 190 ++++
.../java/org/apache/camel/main/MainSupport.java | 1119 +-------------------
.../apache/camel/main/MainRouteOrderedTest.java | 68 ++
.../camel/main/MainSupportCommandLineTest.java | 2 +-
.../modules/ROOT/pages/aws-ddb-component.adoc | 13 +
.../modules/ROOT/pages/aws-ec2-component.adoc | 28 +
.../modules/ROOT/pages/aws-ecs-component.adoc | 10 +
.../modules/ROOT/pages/aws-eks-component.adoc | 10 +
.../modules/ROOT/pages/aws-iam-component.adoc | 11 +
.../modules/ROOT/pages/aws-kms-component.adoc | 10 +
.../modules/ROOT/pages/aws-mq-component.adoc | 21 +
.../modules/ROOT/pages/aws-msk-component.adoc | 10 +
.../modules/ROOT/pages/aws-sdb-component.adoc | 14 +
.../modules/ROOT/pages/aws-ses-component.adoc | 19 +-
.../modules/ROOT/pages/aws-sqs-component.adoc | 6 +-
.../modules/ROOT/pages/azure-blob-component.adoc | 31 +-
.../modules/ROOT/pages/bindy-dataformat.adoc | 24 +
.../modules/ROOT/pages/hdfs-component.adoc | 25 +-
.../modules/ROOT/pages/http-component.adoc | 6 +
.../modules/ROOT/pages/irc-component.adoc | 11 +
.../modules/ROOT/pages/kafka-component.adoc | 15 +-
.../modules/ROOT/pages/protobuf-dataformat.adoc | 8 +-
.../modules/ROOT/pages/sjms-batch-component.adoc | 2 +-
.../modules/ROOT/pages/sjms-component.adoc | 4 +-
docs/components/modules/ROOT/pages/zipkin.adoc | 16 +
.../modules/ROOT/pages/bean-integration.adoc | 6 +-
.../ROOT/pages/camel-3-migration-guide.adoc | 7 +-
.../modules/ROOT/pages/endpoint-annotations.adoc | 28 +-
.../user-manual/modules/ROOT/pages/enrich-eip.adoc | 9 +-
docs/user-manual/modules/ROOT/pages/index.adoc | 29 +-
.../modules/ROOT/pages/oncompletion.adoc | 2 +-
.../modules/ROOT/pages/pojo-producing.adoc | 6 +-
.../modules/ROOT/pages/pollEnrich-eip.adoc | 9 +-
.../modules/ROOT/pages/resequence-eip.adoc | 2 +-
.../modules/ROOT/pages/writing-components.adoc | 67 +-
examples/camel-example-kafka-avro/pom.xml | 18 +
.../src/main/resources/register_schema.py | 17 +
examples/camel-example-main-artemis/pom.xml | 10 +-
examples/camel-example-main-artemis/readme.adoc | 16 +-
.../src/main/resources/application.properties | 7 +-
examples/camel-example-main-tiny/pom.xml | 10 +-
examples/camel-example-main-tiny/readme.adoc | 9 +
examples/camel-example-main/pom.xml | 10 +-
examples/camel-example-main/readme.adoc | 11 +-
parent/pom.xml | 115 +-
.../features/src/main/resources/bundles.properties | 1 -
.../karaf/features/src/main/resources/features.xml | 123 +--
.../spring-boot/components-starter/README.adoc | 15 +-
.../sqs/springboot/SqsComponentConfiguration.java | 12 +
.../springboot/HdfsComponentConfiguration.java | 15 +
.../springboot/KafkaComponentConfiguration.java | 32 -
.../camel-spring-boot-dependencies/pom.xml | 134 +--
platforms/spring-boot/spring-boot-dm/pom.xml | 2 +-
pom.xml | 1 +
.../camel/itest/springboot/CamelAvroTest.java | 8 +-
205 files changed, 5012 insertions(+), 3233 deletions(-)
create mode 100644 Camel3-Migration-Guide.md
create mode 100644 components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpStreamingMoveTest.java
create mode 100644 components/camel-hdfs/src/main/java/org/apache/camel/component/hdfs/DefaultHdfsFileType.java
create mode 100644 components/camel-hdfs/src/main/java/org/apache/camel/component/hdfs/HdfsArrayFileType.java
create mode 100644 components/camel-hdfs/src/main/java/org/apache/camel/component/hdfs/HdfsBloommapFileType.java
copy components/camel-hdfs/src/main/java/org/apache/camel/component/hdfs/{HdfsInfoFactory.java => HdfsFile.java} (60%)
create mode 100644 components/camel-hdfs/src/main/java/org/apache/camel/component/hdfs/HdfsMapFileType.java
create mode 100644 components/camel-hdfs/src/main/java/org/apache/camel/component/hdfs/HdfsNormalFileType.java
create mode 100644 components/camel-hdfs/src/main/java/org/apache/camel/component/hdfs/HdfsSequenceFileType.java
create mode 100644 components/camel-hdfs/src/main/java/org/apache/camel/component/hdfs/kerberos/KerberosConfiguration.java
create mode 100644 components/camel-hdfs/src/test/java/org/apache/camel/component/hdfs/kerberos/KerberosConfigurationTest.java
create mode 100644 components/camel-hdfs/src/test/resources/kerberos/test-kerb5.conf
create mode 100644 components/camel-hdfs/src/test/resources/kerberos/test-keytab.bin
create mode 100644 components/camel-mongodb/src/main/java/org/apache/camel/component/mongodb/conf/ConnectionParamsConfiguration.java
create mode 100644 components/camel-mongodb/src/main/java/org/apache/camel/component/mongodb/meta/MongoDBMetaExtension.java
create mode 100644 components/camel-mongodb/src/main/java/org/apache/camel/component/mongodb/verifier/MongoComponentVerifierExtension.java
create mode 100644 components/camel-mongodb/src/test/java/org/apache/camel/component/mongodb/meta/MongoDbMetaExtensionTest.java
create mode 100644 components/camel-mongodb/src/test/java/org/apache/camel/component/mongodb/verifier/MongoDbVerifierExtensionTest.java
copy components/{camel-hdfs/src/main/java/org/apache/camel/component/hdfs/HdfsInfoFactory.java => camel-netty-http/src/main/java/org/apache/camel/component/netty/http/InboundStreamHttpRequest.java} (58%)
copy components/{camel-hdfs/src/main/java/org/apache/camel/component/hdfs/HdfsInfoFactory.java => camel-netty-http/src/main/java/org/apache/camel/component/netty/http/InboundStreamHttpResponse.java} (58%)
rename components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/{ChunkedHttpRequest.java => OutboundStreamHttpRequest.java} (92%)
rename components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/{ChunkedHttpResponse.java => OutboundStreamHttpResponse.java} (92%)
create mode 100644 components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpInboundStreamHandler.java
rename components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/{CustomChunkedWriteHandler.java => handlers/HttpOutboundStreamHandler.java} (57%)
create mode 100644 components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpStreamTest.java
create mode 100644 components/camel-protobuf/src/main/java/org/apache/camel/dataformat/protobuf/ProtobufConverter.java
create mode 100644 components/camel-protobuf/src/test/java/org/apache/camel/dataformat/protobuf/ProtobufConverterTest.java
create mode 100644 components/camel-protobuf/src/test/java/org/apache/camel/dataformat/protobuf/ProtobufMarshalAndUnmarshalMapTest.java
copy components/{camel-consul => camel-testcontainers-junit5}/pom.xml (57%)
create mode 100644 components/camel-testcontainers-junit5/src/main/docs/testcontainers-junit5.adoc
create mode 100644 components/camel-testcontainers-junit5/src/main/java/org/apache/camel/test/testcontainers/junit5/ContainerAwareTestSupport.java
create mode 100644 components/camel-testcontainers-junit5/src/main/java/org/apache/camel/test/testcontainers/junit5/ContainerPropertiesFunction.java
create mode 100644 components/camel-testcontainers-junit5/src/main/java/org/apache/camel/test/testcontainers/junit5/Containers.java
create mode 100644 components/camel-testcontainers-junit5/src/main/java/org/apache/camel/test/testcontainers/junit5/Wait.java
create mode 100644 components/camel-testcontainers-junit5/src/test/java/org/apache/camel/test/testcontainers/junit5/ContainerAwareTestSupportIT.java
copy components/{camel-testcontainers => camel-testcontainers-junit5}/src/test/resources/log4j2.properties (100%)
copy core/camel-main/src/main/java/org/apache/camel/main/{MainSupport.java => BaseMainSupport.java} (72%)
create mode 100644 core/camel-main/src/main/java/org/apache/camel/main/MainCommandLineSupport.java
create mode 100644 core/camel-main/src/test/java/org/apache/camel/main/MainRouteOrderedTest.java
[camel] 01/01: CAMEL-14307: Created camel-testcontainers-junit5
from camel-testcontainers
Posted by al...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
aldettinger pushed a commit to branch CAMEL-13965
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 0bd44e660ce5a9098151d50e5f5247f86fd095a6
Author: aldettinger <al...@gmail.com>
AuthorDate: Fri Oct 4 11:05:05 2019 +0200
CAMEL-14307: Created camel-testcontainers-junit5 from camel-testcontainers
---
apache-camel/src/main/descriptors/common-bin.xml | 1 +
bom/camel-bom/pom.xml | 5 +
components/camel-consul/pom.xml | 10 ++
.../camel/component/consul/ConsulCatalogTest.java | 16 +--
.../component/consul/ConsulClientKeyValueTest.java | 5 +-
.../component/consul/ConsulCoordinatesTest.java | 20 +--
.../camel/component/consul/ConsulEventTest.java | 6 +-
.../component/consul/ConsulEventWatchTest.java | 2 +-
.../camel/component/consul/ConsulHealthTest.java | 12 +-
.../camel/component/consul/ConsulKeyValueTest.java | 5 +-
.../component/consul/ConsulKeyValueWatchTest.java | 2 +-
.../camel/component/consul/ConsulRegistryTest.java | 21 ++--
.../component/consul/ConsulRegistryUtilsTest.java | 6 +-
.../camel/component/consul/ConsulSessionTest.java | 18 +--
.../camel/component/consul/ConsulTestSupport.java | 11 +-
.../cloud/ConsulDefaultServiceCallRouteTest.java | 2 +-
.../cloud/ConsulRibbonServiceCallRouteTest.java | 2 +-
.../ConsulServiceCallWithRegistrationTest.java | 10 +-
.../consul/cloud/ConsulServiceDiscoveryTest.java | 5 +-
.../cloud/ConsulServiceRegistrationTestBase.java | 5 +-
.../consul/cloud/ConsulServiceRegistryTest.java | 4 +-
.../apache/camel/test/junit5/CamelTestSupport.java | 7 ++
.../pom.xml | 126 ++++++-------------
.../src/main/docs/testcontainers-junit5.adoc | 136 +++++++++++++++++++++
.../junit5/ContainerAwareTestSupport.java | 108 ++++++++++++++++
.../junit5/ContainerPropertiesFunction.java | 74 +++++++++++
.../test/testcontainers/junit5/Containers.java | 84 +++++++++++++
.../camel/test/testcontainers/junit5/Wait.java | 69 +++++++++++
.../junit5/ContainerAwareTestSupportIT.java | 55 +++++++++
.../src/test/resources/log4j2.properties | 30 +++++
components/pom.xml | 1 +
parent/pom.xml | 5 +
32 files changed, 710 insertions(+), 153 deletions(-)
diff --git a/apache-camel/src/main/descriptors/common-bin.xml b/apache-camel/src/main/descriptors/common-bin.xml
index 6438386..404e758 100644
--- a/apache-camel/src/main/descriptors/common-bin.xml
+++ b/apache-camel/src/main/descriptors/common-bin.xml
@@ -325,6 +325,7 @@
<include>org.apache.camel:camel-test-spring</include>
<include>org.apache.camel:camel-test-spring-junit5</include>
<include>org.apache.camel:camel-testcontainers</include>
+ <include>org.apache.camel:camel-testcontainers-junit5</include>
<include>org.apache.camel:camel-testcontainers-spring</include>
<include>org.apache.camel:camel-thrift</include>
<include>org.apache.camel:camel-tika</include>
diff --git a/bom/camel-bom/pom.xml b/bom/camel-bom/pom.xml
index 041167d..a15a7cb 100644
--- a/bom/camel-bom/pom.xml
+++ b/bom/camel-bom/pom.xml
@@ -2935,6 +2935,11 @@
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
+ <artifactId>camel-testcontainers-junit5</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
<artifactId>camel-testcontainers-spring</artifactId>
<version>${project.version}</version>
</dependency>
diff --git a/components/camel-consul/pom.xml b/components/camel-consul/pom.xml
index c17d1a4..65eef4f 100644
--- a/components/camel-consul/pom.xml
+++ b/components/camel-consul/pom.xml
@@ -55,6 +55,16 @@
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
+ <artifactId>camel-testcontainers-junit5</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.junit.vintage</groupId>
+ <artifactId>junit-vintage-engine</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
<artifactId>camel-mock</artifactId>
<scope>test</scope>
</dependency>
diff --git a/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulCatalogTest.java b/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulCatalogTest.java
index d96305b..097daec 100644
--- a/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulCatalogTest.java
+++ b/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulCatalogTest.java
@@ -21,8 +21,8 @@ import java.util.List;
import com.orbitz.consul.model.health.Node;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.consul.endpoint.ConsulCatalogActions;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
public class ConsulCatalogTest extends ConsulTestSupport {
@@ -34,9 +34,9 @@ public class ConsulCatalogTest extends ConsulTestSupport {
.to("direct:consul")
.request(List.class);
- Assert.assertFalse(ref.isEmpty());
- Assert.assertFalse(res.isEmpty());
- Assert.assertEquals(ref, res);
+ Assertions.assertFalse(ref.isEmpty());
+ Assertions.assertFalse(res.isEmpty());
+ Assertions.assertEquals(ref, res);
}
@Test
@@ -47,9 +47,9 @@ public class ConsulCatalogTest extends ConsulTestSupport {
.to("direct:consul")
.request(List.class);
- Assert.assertFalse(ref.isEmpty());
- Assert.assertFalse(res.isEmpty());
- Assert.assertEquals(ref, res);
+ Assertions.assertFalse(ref.isEmpty());
+ Assertions.assertFalse(res.isEmpty());
+ Assertions.assertEquals(ref, res);
}
@Override
diff --git a/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulClientKeyValueTest.java b/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulClientKeyValueTest.java
index ef6cc27..749c22f 100644
--- a/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulClientKeyValueTest.java
+++ b/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulClientKeyValueTest.java
@@ -24,7 +24,10 @@ import org.apache.camel.BindToRegistry;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.consul.endpoint.ConsulKeyValueActions;
import org.apache.camel.component.mock.MockEndpoint;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
public class ConsulClientKeyValueTest extends ConsulTestSupport {
diff --git a/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulCoordinatesTest.java b/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulCoordinatesTest.java
index 1b9d280..fc8a855 100644
--- a/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulCoordinatesTest.java
+++ b/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulCoordinatesTest.java
@@ -22,9 +22,9 @@ import com.orbitz.consul.model.coordinate.Coordinate;
import com.orbitz.consul.model.coordinate.Datacenter;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.consul.endpoint.ConsulCoordinatesActions;
-import org.junit.Assert;
-import org.junit.Ignore;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
public class ConsulCoordinatesTest extends ConsulTestSupport {
@@ -36,12 +36,12 @@ public class ConsulCoordinatesTest extends ConsulTestSupport {
.to("direct:consul")
.request(List.class);
- Assert.assertFalse(ref.isEmpty());
- Assert.assertFalse(res.isEmpty());
- Assert.assertEquals(ref, res);
+ Assertions.assertFalse(ref.isEmpty());
+ Assertions.assertFalse(res.isEmpty());
+ Assertions.assertEquals(ref, res);
}
- @Ignore("Disabled as it seems that nodes is always 0")
+ @Disabled("Disabled as it seems that nodes is always 0")
@Test
public void testNodes() throws Exception {
List<Coordinate> ref = getConsul().coordinateClient().getNodes();
@@ -50,9 +50,9 @@ public class ConsulCoordinatesTest extends ConsulTestSupport {
.to("direct:consul")
.request(List.class);
- Assert.assertFalse(ref.isEmpty());
- Assert.assertFalse(res.isEmpty());
- Assert.assertEquals(ref, res);
+ Assertions.assertFalse(ref.isEmpty());
+ Assertions.assertFalse(res.isEmpty());
+ Assertions.assertEquals(ref, res);
}
@Override
diff --git a/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulEventTest.java b/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulEventTest.java
index 6daed84..c2f4d51 100644
--- a/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulEventTest.java
+++ b/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulEventTest.java
@@ -23,7 +23,11 @@ import com.orbitz.consul.model.event.Event;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.consul.endpoint.ConsulEventActions;
import org.apache.camel.component.mock.MockEndpoint;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
public class ConsulEventTest extends ConsulTestSupport {
diff --git a/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulEventWatchTest.java b/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulEventWatchTest.java
index 8550295..b546e1c 100644
--- a/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulEventWatchTest.java
+++ b/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulEventWatchTest.java
@@ -21,7 +21,7 @@ import java.util.List;
import com.orbitz.consul.EventClient;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
public class ConsulEventWatchTest extends ConsulTestSupport {
private String key;
diff --git a/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulHealthTest.java b/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulHealthTest.java
index 79e2cfe..2f6c9ef 100644
--- a/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulHealthTest.java
+++ b/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulHealthTest.java
@@ -27,8 +27,10 @@ import com.orbitz.consul.model.agent.Registration;
import com.orbitz.consul.model.health.ServiceHealth;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.consul.endpoint.ConsulHealthActions;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertTrue;
public class ConsulHealthTest extends ConsulTestSupport {
private AgentClient client;
@@ -85,9 +87,9 @@ public class ConsulHealthTest extends ConsulTestSupport {
.to("direct:consul")
.request(List.class);
- Assert.assertEquals(2, ref.size());
- Assert.assertEquals(2, res.size());
- Assert.assertEquals(ref, res);
+ Assertions.assertEquals(2, ref.size());
+ Assertions.assertEquals(2, res.size());
+ Assertions.assertEquals(ref, res);
assertTrue(registrations.stream().anyMatch(
r -> r.getPort().isPresent() && r.getPort().get() == res.get(0).getService().getPort() && r.getId().equalsIgnoreCase(res.get(0).getService().getId())
diff --git a/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulKeyValueTest.java b/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulKeyValueTest.java
index dc03889..6c96fc4 100644
--- a/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulKeyValueTest.java
+++ b/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulKeyValueTest.java
@@ -21,7 +21,10 @@ import java.util.Optional;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.consul.endpoint.ConsulKeyValueActions;
import org.apache.camel.component.mock.MockEndpoint;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
public class ConsulKeyValueTest extends ConsulTestSupport {
diff --git a/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulKeyValueWatchTest.java b/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulKeyValueWatchTest.java
index 716e25e..7dcfab9 100644
--- a/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulKeyValueWatchTest.java
+++ b/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulKeyValueWatchTest.java
@@ -22,7 +22,7 @@ import java.util.Random;
import com.orbitz.consul.KeyValueClient;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
public class ConsulKeyValueWatchTest extends ConsulTestSupport {
private String key;
diff --git a/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulRegistryTest.java b/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulRegistryTest.java
index 67cc2fd..a6fa6a7 100644
--- a/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulRegistryTest.java
+++ b/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulRegistryTest.java
@@ -23,14 +23,15 @@ import java.util.Set;
import com.orbitz.consul.Consul;
import org.apache.camel.NoSuchBeanException;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
import org.testcontainers.containers.GenericContainer;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertThrows;
/**
* Unit test for Camel Registry implementation for Consul
@@ -49,7 +50,7 @@ public class ConsulRegistryTest implements Serializable {
}
}
- @BeforeClass
+ @BeforeAll
public static void setUp() {
container = ConsulTestSupport.consulContainer();
container.start();
@@ -57,7 +58,7 @@ public class ConsulRegistryTest implements Serializable {
registry = new ConsulRegistry(container.getContainerIpAddress(), container.getMappedPort(Consul.DEFAULT_HTTP_PORT));
}
- @AfterClass
+ @AfterAll
public static void tearDown() {
container.stop();
}
@@ -165,8 +166,8 @@ public class ConsulRegistryTest implements Serializable {
}
- @Test(expected = NoSuchBeanException.class)
+ @Test
public void deleteNonExisting() {
- registry.remove("nonExisting");
+ assertThrows(NoSuchBeanException.class, () -> registry.remove("nonExisting"));
}
}
diff --git a/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulRegistryUtilsTest.java b/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulRegistryUtilsTest.java
index f56045d..221e569 100644
--- a/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulRegistryUtilsTest.java
+++ b/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulRegistryUtilsTest.java
@@ -21,10 +21,10 @@ import java.util.Arrays;
import java.util.List;
import org.apache.camel.component.consul.ConsulRegistry.ConsulRegistryUtils;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertArrayEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
/**
* @author <a href="https://github.com/ppalaga">Peter Palaga</a>
diff --git a/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulSessionTest.java b/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulSessionTest.java
index 63fa765..300feaa 100644
--- a/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulSessionTest.java
+++ b/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulSessionTest.java
@@ -24,8 +24,8 @@ import com.orbitz.consul.model.session.SessionCreatedResponse;
import com.orbitz.consul.model.session.SessionInfo;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.consul.endpoint.ConsulSessionActions;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
public class ConsulSessionTest extends ConsulTestSupport {
@@ -40,8 +40,8 @@ public class ConsulSessionTest extends ConsulTestSupport {
.to("direct:consul")
.request(List.class);
- Assert.assertEquals(sessions, list.size());
- Assert.assertFalse(list.stream().anyMatch(s -> s.getName().isPresent() && s.getName().get().equals(name)));
+ Assertions.assertEquals(sessions, list.size());
+ Assertions.assertFalse(list.stream().anyMatch(s -> s.getName().isPresent() && s.getName().get().equals(name)));
}
SessionCreatedResponse res = fluentTemplate()
@@ -50,7 +50,7 @@ public class ConsulSessionTest extends ConsulTestSupport {
.to("direct:consul")
.request(SessionCreatedResponse.class);
- Assert.assertNotNull(res.getId());
+ Assertions.assertNotNull(res.getId());
{
List<SessionInfo> list = fluentTemplate()
@@ -58,8 +58,8 @@ public class ConsulSessionTest extends ConsulTestSupport {
.to("direct:consul")
.request(List.class);
- Assert.assertEquals(sessions + 1, list.size());
- Assert.assertTrue(list.stream().anyMatch(s -> s.getName().isPresent() && s.getName().get().equals(name)));
+ Assertions.assertEquals(sessions + 1, list.size());
+ Assertions.assertTrue(list.stream().anyMatch(s -> s.getName().isPresent() && s.getName().get().equals(name)));
}
{
@@ -74,8 +74,8 @@ public class ConsulSessionTest extends ConsulTestSupport {
.to("direct:consul")
.request(List.class);
- Assert.assertEquals(sessions, list.size());
- Assert.assertFalse(list.stream().anyMatch(s -> s.getName().isPresent() && s.getName().get().equals(name)));
+ Assertions.assertEquals(sessions, list.size());
+ Assertions.assertFalse(list.stream().anyMatch(s -> s.getName().isPresent() && s.getName().get().equals(name)));
}
}
diff --git a/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulTestSupport.java b/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulTestSupport.java
index 5dff0b3..2fecc6d 100644
--- a/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulTestSupport.java
+++ b/components/camel-consul/src/test/java/org/apache/camel/component/consul/ConsulTestSupport.java
@@ -24,10 +24,8 @@ import com.orbitz.consul.Consul;
import com.orbitz.consul.KeyValueClient;
import org.apache.camel.BindToRegistry;
-import org.apache.camel.test.testcontainers.ContainerAwareTestSupport;
-import org.apache.camel.test.testcontainers.Wait;
-import org.junit.Rule;
-import org.junit.rules.TestName;
+import org.apache.camel.test.testcontainers.junit5.ContainerAwareTestSupport;
+import org.apache.camel.test.testcontainers.junit5.Wait;
import org.testcontainers.containers.GenericContainer;
public class ConsulTestSupport extends ContainerAwareTestSupport {
@@ -35,9 +33,6 @@ public class ConsulTestSupport extends ContainerAwareTestSupport {
public static final String CONTAINER_NAME = "consul";
public static final String KV_PREFIX = "/camel";
- @Rule
- public final TestName testName = new TestName();
-
@BindToRegistry("consul")
public ConsulComponent getConsulComponent() {
ConsulComponent component = new ConsulComponent();
@@ -69,7 +64,7 @@ public class ConsulTestSupport extends ContainerAwareTestSupport {
}
protected String generateKey() {
- return KV_PREFIX + "/" + testName.getMethodName() + "/" + generateRandomString();
+ return KV_PREFIX + "/" + getCurrentTestName() + "/" + generateRandomString();
}
protected String consulUrl() {
diff --git a/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/ConsulDefaultServiceCallRouteTest.java b/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/ConsulDefaultServiceCallRouteTest.java
index c21ed04..1f054d0 100644
--- a/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/ConsulDefaultServiceCallRouteTest.java
+++ b/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/ConsulDefaultServiceCallRouteTest.java
@@ -26,7 +26,7 @@ import org.apache.camel.RoutesBuilder;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.consul.ConsulTestSupport;
import org.apache.camel.test.AvailablePortFinder;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
public class ConsulDefaultServiceCallRouteTest extends ConsulTestSupport {
private static final String SERVICE_NAME = "http-service";
diff --git a/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/ConsulRibbonServiceCallRouteTest.java b/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/ConsulRibbonServiceCallRouteTest.java
index eb7c769..ec26483 100644
--- a/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/ConsulRibbonServiceCallRouteTest.java
+++ b/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/ConsulRibbonServiceCallRouteTest.java
@@ -26,7 +26,7 @@ import org.apache.camel.RoutesBuilder;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.consul.ConsulTestSupport;
import org.apache.camel.test.AvailablePortFinder;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
public class ConsulRibbonServiceCallRouteTest extends ConsulTestSupport {
private static final String SERVICE_NAME = "http-service";
diff --git a/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/ConsulServiceCallWithRegistrationTest.java b/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/ConsulServiceCallWithRegistrationTest.java
index e7f6a80..0fbf120 100644
--- a/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/ConsulServiceCallWithRegistrationTest.java
+++ b/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/ConsulServiceCallWithRegistrationTest.java
@@ -23,9 +23,12 @@ import org.apache.camel.CamelExecutionException;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.consul.ConsulTestSupport;
import org.apache.camel.impl.cloud.ServiceRegistrationRoutePolicy;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.springframework.util.SocketUtils;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+
public class ConsulServiceCallWithRegistrationTest extends ConsulTestSupport {
private static final String SERVICE_HOST = "localhost";
@@ -93,7 +96,7 @@ public class ConsulServiceCallWithRegistrationTest extends ConsulTestSupport {
assertEquals("ping on " + port, template.requestBody("direct:start", "ping", String.class));
}
- @Test(expected = CamelExecutionException.class)
+ @Test// @TODO (expected = CamelExecutionException.class)
public void testServiceCallFailure() throws Exception {
final int port = SocketUtils.findAvailableTcpPort();
final String serviceId = UUID.randomUUID().toString();
@@ -126,7 +129,6 @@ public class ConsulServiceCallWithRegistrationTest extends ConsulTestSupport {
context.start();
- template.requestBody("direct:start", "ping", String.class);
- fail("Should have failed");
+ assertThrows(CamelExecutionException.class, () -> template.requestBody("direct:start", "ping", String.class));
}
}
diff --git a/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/ConsulServiceDiscoveryTest.java b/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/ConsulServiceDiscoveryTest.java
index 8023c29..d0277e8 100644
--- a/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/ConsulServiceDiscoveryTest.java
+++ b/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/ConsulServiceDiscoveryTest.java
@@ -29,9 +29,12 @@ import org.apache.camel.cloud.ServiceDiscovery;
import org.apache.camel.component.consul.ConsulConfiguration;
import org.apache.camel.component.consul.ConsulTestSupport;
import org.assertj.core.api.Assertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.springframework.util.SocketUtils;
+import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+
public class ConsulServiceDiscoveryTest extends ConsulTestSupport {
private AgentClient client;
private List<Registration> registrations;
diff --git a/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/ConsulServiceRegistrationTestBase.java b/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/ConsulServiceRegistrationTestBase.java
index b9a3bed..231cf88 100644
--- a/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/ConsulServiceRegistrationTestBase.java
+++ b/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/ConsulServiceRegistrationTestBase.java
@@ -28,9 +28,12 @@ import com.orbitz.consul.model.health.ServiceHealth;
import org.apache.camel.CamelContext;
import org.apache.camel.cloud.ServiceDefinition;
import org.apache.camel.component.consul.ConsulTestSupport;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.springframework.util.SocketUtils;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
public abstract class ConsulServiceRegistrationTestBase extends ConsulTestSupport {
protected static final String SERVICE_ID = UUID.randomUUID().toString();
protected static final String SERVICE_NAME = "my-service";
diff --git a/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/ConsulServiceRegistryTest.java b/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/ConsulServiceRegistryTest.java
index 2c7f574..b4e0df0 100644
--- a/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/ConsulServiceRegistryTest.java
+++ b/components/camel-consul/src/test/java/org/apache/camel/component/consul/cloud/ConsulServiceRegistryTest.java
@@ -24,7 +24,9 @@ import com.orbitz.consul.model.catalog.CatalogService;
import com.orbitz.consul.model.health.ServiceHealth;
import org.apache.camel.component.consul.ConsulTestSupport;
import org.apache.camel.impl.cloud.DefaultServiceDefinition;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
public class ConsulServiceRegistryTest extends ConsulTestSupport {
@Override
diff --git a/components/camel-test-junit5/src/main/java/org/apache/camel/test/junit5/CamelTestSupport.java b/components/camel-test-junit5/src/main/java/org/apache/camel/test/junit5/CamelTestSupport.java
index 31b45c5..3b74fbb 100644
--- a/components/camel-test-junit5/src/main/java/org/apache/camel/test/junit5/CamelTestSupport.java
+++ b/components/camel-test-junit5/src/main/java/org/apache/camel/test/junit5/CamelTestSupport.java
@@ -295,6 +295,13 @@ public abstract class CamelTestSupport implements BeforeEachCallback, AfterAllCa
}
/**
+ * Gets the name of the current test being executed.
+ */
+ public final String getCurrentTestName() {
+ return currentTestName;
+ }
+
+ /**
* Override to enable debugger
* <p/>
* Is default <tt>false</tt>
diff --git a/components/camel-consul/pom.xml b/components/camel-testcontainers-junit5/pom.xml
similarity index 57%
copy from components/camel-consul/pom.xml
copy to components/camel-testcontainers-junit5/pom.xml
index c17d1a4..b80f32d 100644
--- a/components/camel-consul/pom.xml
+++ b/components/camel-testcontainers-junit5/pom.xml
@@ -18,8 +18,7 @@
-->
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
+ 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>
@@ -28,86 +27,30 @@
<version>3.0.0-SNAPSHOT</version>
</parent>
- <artifactId>camel-consul</artifactId>
+ <artifactId>camel-testcontainers-junit5</artifactId>
<packaging>jar</packaging>
- <name>Camel :: Consul</name>
- <description>Camel Consul support</description>
+
+ <name>Camel :: Testcontainers :: JUnit 5</name>
+ <description>Camel support for testcontainers with JUnit 5</description>
<properties>
+ <firstVersion>3.0.0</firstVersion>
+ <label>testing,java,docker</label>
+
</properties>
<dependencies>
<dependency>
<groupId>org.apache.camel</groupId>
- <artifactId>camel-cloud</artifactId>
+ <artifactId>camel-test-junit5</artifactId>
</dependency>
<dependency>
- <groupId>com.orbitz.consul</groupId>
- <artifactId>consul-client</artifactId>
- <version>${consul-client-version}</version>
+ <groupId>org.testcontainers</groupId>
+ <artifactId>testcontainers</artifactId>
+ <version>${testcontainers-version}</version>
</dependency>
- <!-- testing -->
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-testcontainers-spring</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-mock</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-log</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-bean</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-file</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-timer</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-direct</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-http</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-jetty</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-undertow</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-master</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-service</artifactId>
- <scope>test</scope>
- </dependency>
+ <!-- optional dependencies for running tests -->
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
@@ -115,11 +58,6 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-ribbon</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<scope>test</scope>
@@ -134,12 +72,12 @@
<artifactId>log4j-slf4j-impl</artifactId>
<scope>test</scope>
</dependency>
- </dependencies>
+ </dependencies>
<profiles>
- <profile>
- <id>consul-skip-tests</id>
+ <profile>
+ <id>testcontainers-skip-tests</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
@@ -154,10 +92,9 @@
</plugins>
</build>
</profile>
-
- <!-- activate test if the docker socket file is accessible -->
+ <!-- activate integration test if the docker socket file is accessible -->
<profile>
- <id>consul-tests-docker-file</id>
+ <id>testcontainers-integration-tests-docker-file</id>
<activation>
<file>
<exists>/var/run/docker.sock</exists>
@@ -166,21 +103,30 @@
<build>
<plugins>
<plugin>
- <artifactId>maven-surefire-plugin</artifactId>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<skipTests>${skipTests}</skipTests>
<systemPropertyVariables>
<visibleassertions.silence>true</visibleassertions.silence>
</systemPropertyVariables>
</configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>integration-test</goal>
+ <goal>verify</goal>
+ </goals>
+ </execution>
+ </executions>
</plugin>
</plugins>
</build>
</profile>
- <!-- activate test if the DOCKER_HOST env var is set -->
+ <!-- activate integration test if the DOCKER_HOST env var is set -->
<profile>
- <id>consul-tests-docker-env</id>
+ <id>testcontainers-integration-tests-docker-env</id>
<activation>
<property>
<name>env.DOCKER_HOST</name>
@@ -189,17 +135,25 @@
<build>
<plugins>
<plugin>
- <artifactId>maven-surefire-plugin</artifactId>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<skipTests>${skipTests}</skipTests>
<systemPropertyVariables>
<visibleassertions.silence>true</visibleassertions.silence>
</systemPropertyVariables>
</configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>integration-test</goal>
+ <goal>verify</goal>
+ </goals>
+ </execution>
+ </executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
-
</project>
diff --git a/components/camel-testcontainers-junit5/src/main/docs/testcontainers-junit5.adoc b/components/camel-testcontainers-junit5/src/main/docs/testcontainers-junit5.adoc
new file mode 100644
index 0000000..be9a6ab
--- /dev/null
+++ b/components/camel-testcontainers-junit5/src/main/docs/testcontainers-junit5.adoc
@@ -0,0 +1,136 @@
+= Testcontainers
+
+*Available since 3.0.0*
+
+Testing camel components is sometime complex because the 3rd party system a component interacts with does not provide testing facilities and/or is only available as a native application. To reduce this complexity, *Camel Testcontainers JUnit 5* extends standard camel test support providing a way to create and interact with containerized applications.
+
+In order to define leverage testcontainers, add the following dependency to your pom:
+
+[source,xml]
+----
+<dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-testcontainers-junit5</artifactId>
+ <version>x.x.x</version>
+ <!-- use the same version as your Camel core version -->
+ <scope>test</scope>
+</dependency>
+----
+
+[TIP]
+====
+To learn more about testcontainers, please have a look at the official documentation https://www.testcontainers.org
+====
+
+To leverage testcontainers in your tests, you can use `ContainerAwareTestSupport` which is an extension of `CamelTestSupport` which:
+
+- create/destroy containers according to camel context lifecycle
+- inject a custom `PropertiesFunction` to access container specific options from properties
+
+
+To create a container you need to override:
+[source, java]
+----
+protected GenericContainer<?> createContainer()
+----
+
+If you need to create more than one container, you can override the following method:
+[source, java]
+----
+protected List<GenericContainer<?>> createContainers()
+----
+
+The methods above are invoked before the camel context starts and blocks until the containers are reported to be alive. Containers are destroyed once the camel context stops.
+
+[source,java]
+.Example
+----
+@Override
+protected GenericContainer<?> createContainer() {
+ return new GenericContainer<>("consul:1.0.7")
+ .withNetworkAliases("myconsul") // <1>
+ .withExposedPorts(8500)
+ .waitingFor(Wait.forLogMessageContaining("Synced node info", 1)) // <2>
+ .withCommand(
+ "agent",
+ "-dev",
+ "-server",
+ "-bootstrap",
+ "-client",
+ "0.0.0.0",
+ "-log-level",
+ "trace"
+ );
+}
+----
+<1> container name/alias
+<2> container startup condition
+
+[IMPORTANT]
+====
+It is important to give a name/alias to the container so you can then use properties functions to retrieve information such as container's host and port mapping.
+====
+[TIP]
+====
+You may need to wait for some condition to be satisfied before starting your test, to do so you need to configure the test suite to wait for such event using `GenericContainer.waitingFor`. Testcontainers provide a number of ready to use waiting strategy, for more info see the official testcontainers documentation.
+====
+
+Camel Testcontainer provides a PropertiesFunction implementation that can be used to:
+
+- retrieve the container host with the following syntax `container:host:$\{container-name\}`
+- retrieve the port mapping with the following syntax `container:port:$\{exposed-port\}@$\{container-name\}`
+
+[source,java]
+.Example
+----
+public class MyTest extends ContainerAwareTestSupport {
+ @Test
+ public void testPropertyPlaceholders() throws Exception {
+ GenericContainer<?> container = getContainer("myconsul");
+
+ String host = context.resolvePropertyPlaceholders("{{container:host:myconsul}}");
+ assertThat(host).isEqualTo(container.getContainerIpAddress());
+
+ String port = context.resolvePropertyPlaceholders("{{container:port:8500@myconsul}}");
+ assertThat(port).isEqualTo("" + container.getMappedPort(8500));
+ }
+
+ @Override
+ protected GenericContainer<?> createContainer() {
+ return new GenericContainer<>("consul:1.0.7")
+ .withNetworkAliases("myconsul")
+ .withExposedPorts(8500)
+ .waitingFor(Wait.forLogMessageContaining("Synced node info", 1))
+ .withCommand(
+ "agent",
+ "-dev",
+ "-server",
+ "-bootstrap",
+ "-client",
+ "0.0.0.0",
+ "-log-level",
+ "trace"
+ );
+ }
+}
+----
+
+== Migrating Camel Testcontainers Tests from JUnit 4 to JUnit 5
+Find below some hints to help in migrating camel testcontainers tests from JUnit 4 to JUnit 5.
+
+=== Referencing the Camel Testcontainers JUnit5 library in your project
+Projects using `camel-testcontainers` would need to use `camel-testcontainers-junit5`. For instance, maven users would update their pom.xml file as below:
+----
+<dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-testcontainers-junit5</artifactId>
+ <scope>test</scope>
+</dependency>
+----
+
+Tips: It's possible to run JUnit4 & JUnit5 based camel tests side by side including the following dependencies `camel-testcontainers`,
+`camel-testcontainers-junit5` and `junit-vintage-engine`. This configuration allows to migrate a camel test at once.
+
+=== Typical migration steps linked to JUnit 5 support in Camel Testcontainers
+* Migration steps linked to xref:components::test-junit5.adoc[JUnit 5 support in Camel Test itself] should have been applied first
+* Imports of `org.apache.camel.test.testcontainers.\*` should be replaced with `org.apache.camel.test.testcontainers.junit5.*`
diff --git a/components/camel-testcontainers-junit5/src/main/java/org/apache/camel/test/testcontainers/junit5/ContainerAwareTestSupport.java b/components/camel-testcontainers-junit5/src/main/java/org/apache/camel/test/testcontainers/junit5/ContainerAwareTestSupport.java
new file mode 100644
index 0000000..3c4a13a
--- /dev/null
+++ b/components/camel-testcontainers-junit5/src/main/java/org/apache/camel/test/testcontainers/junit5/ContainerAwareTestSupport.java
@@ -0,0 +1,108 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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.testcontainers.junit5;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.concurrent.TimeUnit;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.component.properties.PropertiesComponent;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.testcontainers.containers.GenericContainer;
+import org.testcontainers.containers.Network;
+
+public class ContainerAwareTestSupport extends CamelTestSupport {
+ private List<GenericContainer<?>> containers = new CopyOnWriteArrayList<>();
+
+ // ******************
+ // Setup
+ // ******************
+
+ @Override
+ protected void setupResources() throws Exception {
+ super.setupResources();
+
+ containers.clear();
+ containers.addAll(createContainers());
+
+ final Network network = containerNetwork();
+ final long timeout = containersStartupTimeout();
+
+ Containers.start(containers, network, timeout);
+ }
+
+ @Override
+ protected void cleanupResources() throws Exception {
+ super.cleanupResources();
+
+ Containers.stop(containers, containerShutdownTimeout());
+ }
+
+ @Override
+ protected CamelContext createCamelContext() throws Exception {
+ final CamelContext context = super.createCamelContext();
+ final PropertiesComponent pc = (PropertiesComponent)context.getPropertiesComponent();
+
+ pc.addFunction(new ContainerPropertiesFunction(containers));
+
+ return context;
+ }
+
+ // ******************
+ // Containers set-up
+ // ******************
+
+ protected GenericContainer<?> createContainer() {
+ return null;
+ }
+
+ protected List<GenericContainer<?>> createContainers() {
+ GenericContainer<?> container = createContainer();
+
+ return container == null ? Collections.emptyList() : Collections.singletonList(container);
+ }
+
+ protected long containersStartupTimeout() {
+ return TimeUnit.MINUTES.toSeconds(1);
+ }
+
+ protected long containerShutdownTimeout() {
+ return TimeUnit.MINUTES.toSeconds(1);
+ }
+
+ protected Network containerNetwork() {
+ return null;
+ }
+
+ // ******************
+ // Helpers
+ // ******************
+
+ protected GenericContainer<?> getContainer(String containerName) {
+ return Containers.lookup(containers, containerName);
+ }
+
+ protected String getContainerHost(String containerName) {
+ return getContainer(containerName).getContainerIpAddress();
+ }
+
+ protected int getContainerPort(String containerName, int originalPort) {
+ return getContainer(containerName).getMappedPort(originalPort);
+ }
+}
diff --git a/components/camel-testcontainers-junit5/src/main/java/org/apache/camel/test/testcontainers/junit5/ContainerPropertiesFunction.java b/components/camel-testcontainers-junit5/src/main/java/org/apache/camel/test/testcontainers/junit5/ContainerPropertiesFunction.java
new file mode 100644
index 0000000..cb2862c
--- /dev/null
+++ b/components/camel-testcontainers-junit5/src/main/java/org/apache/camel/test/testcontainers/junit5/ContainerPropertiesFunction.java
@@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.testcontainers.junit5;
+
+import java.util.List;
+
+import org.apache.camel.component.properties.PropertiesFunction;
+import org.apache.camel.util.ObjectHelper;
+import org.apache.camel.util.StringHelper;
+import org.testcontainers.containers.GenericContainer;
+
+public class ContainerPropertiesFunction implements PropertiesFunction {
+ private final List<GenericContainer<?>> containers;
+
+ public ContainerPropertiesFunction(List<GenericContainer<?>> containers) {
+ this.containers = ObjectHelper.notNull(containers, "Containers");
+ }
+
+ @Override
+ public String getName() {
+ return "container";
+ }
+
+ @Override
+ public String apply(String remainder) {
+ final String type = StringHelper.before(remainder, ":");
+ final String query = StringHelper.after(remainder, ":");
+
+ if (ObjectHelper.isEmpty(type)) {
+ throw new IllegalArgumentException("container function syntax is container:type:query");
+ }
+
+ if ("host".equalsIgnoreCase(type)) {
+ String name = StringHelper.after(remainder, ":");
+
+ if (ObjectHelper.isEmpty(name)) {
+ throw new IllegalArgumentException("unable to determine container name");
+ }
+
+ return Containers.lookup(containers, StringHelper.after(remainder, ":")).getContainerIpAddress();
+ }
+
+ if ("port".equalsIgnoreCase(type)) {
+ String port = StringHelper.before(query, "@");
+ String name = StringHelper.after(query, "@");
+
+ if (ObjectHelper.isEmpty(port)) {
+ throw new IllegalArgumentException("unable to determine original port");
+ }
+
+ if (ObjectHelper.isEmpty(name)) {
+ throw new IllegalArgumentException("unable to determine container name");
+ }
+
+ return Integer.toString(Containers.lookup(containers, name).getMappedPort(Integer.parseInt(port)));
+ }
+
+ throw new IllegalArgumentException("Unsupported type: " + type);
+ }
+}
diff --git a/components/camel-testcontainers-junit5/src/main/java/org/apache/camel/test/testcontainers/junit5/Containers.java b/components/camel-testcontainers-junit5/src/main/java/org/apache/camel/test/testcontainers/junit5/Containers.java
new file mode 100644
index 0000000..7e26024
--- /dev/null
+++ b/components/camel-testcontainers-junit5/src/main/java/org/apache/camel/test/testcontainers/junit5/Containers.java
@@ -0,0 +1,84 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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.testcontainers.junit5;
+
+import java.util.List;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
+import static java.util.stream.Collectors.joining;
+
+import org.apache.camel.util.ObjectHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testcontainers.containers.GenericContainer;
+import org.testcontainers.containers.Network;
+import org.testcontainers.containers.output.Slf4jLogConsumer;
+
+public final class Containers {
+ private static final Logger LOGGER = LoggerFactory.getLogger(Containers.class);
+
+ private Containers() {
+ }
+
+ public static void start(List<GenericContainer<?>> containers, Network network, long timeout) throws Exception {
+ final CountDownLatch latch = new CountDownLatch(containers.size());
+
+ for (GenericContainer<?> container : containers) {
+ if (ObjectHelper.isEmpty(container.getNetworkAliases())) {
+ throw new IllegalStateException("Container should have at least a network alias");
+ }
+
+ if (network != null) {
+ container.withNetwork(network);
+ }
+
+ // Add custom logger
+ container.withLogConsumer(new Slf4jLogConsumer(LOGGER).withPrefix(container.getNetworkAliases().stream().collect(joining(","))));
+
+ new Thread(() -> {
+ container.start();
+ latch.countDown();
+ }).start();
+ }
+
+ latch.await(timeout, TimeUnit.SECONDS);
+ }
+
+ public static void stop(List<GenericContainer<?>> containers, long timeout) throws Exception {
+ final CountDownLatch latch = new CountDownLatch(containers.size());
+
+ for (GenericContainer<?> container : containers) {
+ new Thread(() -> {
+ container.stop();
+ latch.countDown();
+ }).start();
+ }
+
+ latch.await(timeout, TimeUnit.SECONDS);
+ }
+
+ public static GenericContainer<?> lookup(List<GenericContainer<?>> containers, String containerName) {
+ for (GenericContainer<?> container : containers) {
+ if (container.getNetworkAliases().contains(containerName)) {
+ return container;
+ }
+ }
+
+ throw new IllegalArgumentException("No container with name " + containerName + " found");
+ }
+}
diff --git a/components/camel-testcontainers-junit5/src/main/java/org/apache/camel/test/testcontainers/junit5/Wait.java b/components/camel-testcontainers-junit5/src/main/java/org/apache/camel/test/testcontainers/junit5/Wait.java
new file mode 100644
index 0000000..258b8b2
--- /dev/null
+++ b/components/camel-testcontainers-junit5/src/main/java/org/apache/camel/test/testcontainers/junit5/Wait.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.testcontainers.junit5;
+
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
+import java.util.function.Predicate;
+
+import com.github.dockerjava.api.DockerClient;
+import org.testcontainers.DockerClientFactory;
+import org.testcontainers.containers.ContainerLaunchException;
+import org.testcontainers.containers.output.OutputFrame;
+import org.testcontainers.containers.output.WaitingConsumer;
+import org.testcontainers.containers.wait.strategy.AbstractWaitStrategy;
+import org.testcontainers.containers.wait.strategy.WaitStrategy;
+import org.testcontainers.utility.LogUtils;
+
+public class Wait extends org.testcontainers.containers.wait.strategy.Wait {
+ /**
+ * Convenience method to return a WaitStrategy for log messages using a
+ * predicate.
+ *
+ * @param predicate the predicate to apply to log messages
+ * @param times the number of times the pattern is expected
+ * @return WaitStrategy
+ */
+ public static WaitStrategy forLogPredicate(Predicate<OutputFrame> predicate, int times) {
+ return new AbstractWaitStrategy() {
+ @Override
+ protected void waitUntilReady() {
+ final DockerClient client = DockerClientFactory.instance().client();
+ final WaitingConsumer waitingConsumer = new WaitingConsumer();
+
+ LogUtils.followOutput(client, waitStrategyTarget.getContainerId(), waitingConsumer);
+
+ try {
+ waitingConsumer.waitUntil(predicate, startupTimeout.getSeconds(), TimeUnit.SECONDS, times);
+ } catch (TimeoutException e) {
+ throw new ContainerLaunchException("Timed out");
+ }
+ }
+ };
+ }
+
+ /**
+ * Convenience method to return a WaitStrategy for log messages.
+ *
+ * @param text the text to find
+ * @param times the number of times the pattern is expected
+ * @return WaitStrategy
+ */
+ public static WaitStrategy forLogMessageContaining(String text, int times) {
+ return forLogPredicate(u -> u.getUtf8String().contains(text), times);
+ }
+}
diff --git a/components/camel-testcontainers-junit5/src/test/java/org/apache/camel/test/testcontainers/junit5/ContainerAwareTestSupportIT.java b/components/camel-testcontainers-junit5/src/test/java/org/apache/camel/test/testcontainers/junit5/ContainerAwareTestSupportIT.java
new file mode 100644
index 0000000..560b8e2
--- /dev/null
+++ b/components/camel-testcontainers-junit5/src/test/java/org/apache/camel/test/testcontainers/junit5/ContainerAwareTestSupportIT.java
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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.testcontainers.junit5;
+
+import org.apache.camel.test.testcontainers.junit5.ContainerAwareTestSupport;
+import org.apache.camel.test.testcontainers.junit5.Wait;
+import org.assertj.core.api.Assertions;
+import org.junit.jupiter.api.Test;
+import org.testcontainers.containers.GenericContainer;
+
+public class ContainerAwareTestSupportIT extends ContainerAwareTestSupport {
+ @Test
+ public void testPropertyPlaceholders() throws Exception {
+ final GenericContainer<?> container = getContainer("myconsul");
+
+ final String host = context.resolvePropertyPlaceholders("{{container:host:myconsul}}");
+ Assertions.assertThat(host).isEqualTo(container.getContainerIpAddress());
+
+ final String port = context.resolvePropertyPlaceholders("{{container:port:8500@myconsul}}");
+ Assertions.assertThat(port).isEqualTo("" + container.getMappedPort(8500));
+ }
+
+ @Override
+ protected GenericContainer<?> createContainer() {
+ return new GenericContainer<>("consul:1.5.3")
+ .withNetworkAliases("myconsul")
+ .withExposedPorts(8500)
+ .waitingFor(Wait.forLogMessageContaining("Synced node info", 1))
+ .withCommand(
+ "agent",
+ "-dev",
+ "-server",
+ "-bootstrap",
+ "-client",
+ "0.0.0.0",
+ "-log-level",
+ "trace"
+ );
+ }
+
+}
diff --git a/components/camel-testcontainers-junit5/src/test/resources/log4j2.properties b/components/camel-testcontainers-junit5/src/test/resources/log4j2.properties
new file mode 100644
index 0000000..7db2ad4
--- /dev/null
+++ b/components/camel-testcontainers-junit5/src/test/resources/log4j2.properties
@@ -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.
+## ---------------------------------------------------------------------------
+
+appender.file.type = File
+appender.file.name = file
+appender.file.fileName = target/camel-testcontainers.log
+appender.file.layout.type = PatternLayout
+appender.file.layout.pattern = %d %-5p %c{1} - %m %n
+appender.out.type = Console
+appender.out.name = out
+appender.out.layout.type = PatternLayout
+appender.out.layout.pattern = [%30.30t] %-30.30c{1} %-5p %m%n
+logger.spring.name = org.apache.camel.test.testcontainers
+logger.spring.level = DEBUG
+rootLogger.level = INFO
+rootLogger.appenderRef.file.ref = file
diff --git a/components/pom.xml b/components/pom.xml
index a4133d1..a650994 100644
--- a/components/pom.xml
+++ b/components/pom.xml
@@ -67,6 +67,7 @@
<module>camel-testcontainers-spring</module>
<module>camel-test-junit5</module>
<module>camel-test-spring-junit5</module>
+ <module>camel-testcontainers-junit5</module>
<module>camel-blueprint</module>
<module>camel-spring</module>
<module>camel-groovy</module>
diff --git a/parent/pom.xml b/parent/pom.xml
index e320547..2ff8452 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -2272,6 +2272,11 @@
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
+ <artifactId>camel-testcontainers-junit5</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
<artifactId>camel-testcontainers-spring</artifactId>
<version>${project.version}</version>
</dependency>