diff --git a/applications/processor/header-enricher-processor/README.adoc b/applications/processor/header-enricher-processor/README.adoc index b2e5f8f3..ee3972d6 100644 --- a/applications/processor/header-enricher-processor/README.adoc +++ b/applications/processor/header-enricher-processor/README.adoc @@ -12,7 +12,7 @@ The **$$header-enricher$$** $$processor$$ has the following options: //tag::configuration-properties[] $$header.enricher.headers$$:: $$\n separated properties representing headers in which values are SpEL expressions, e.g foo='bar' \n baz=payload.baz.$$ *($$Properties$$, default: `$$$$`)* -$$header.enricher.overwrite$$:: $$set to true to overwrite any existing message headers.$$ *($$Boolean$$, default: `$$false$$`)* +$$header.enricher.overwrite$$:: $$set to true to overwrite any existing message headers.$$ *($$Boolean$$, default: `$$$$`)* //end::configuration-properties[] //end::ref-doc[] diff --git a/applications/processor/splitter-processor/README.adoc b/applications/processor/splitter-processor/README.adoc index 08834790..2dc0d4bd 100644 --- a/applications/processor/splitter-processor/README.adoc +++ b/applications/processor/splitter-processor/README.adoc @@ -17,12 +17,12 @@ If the incoming type is `byte[]` and the content type is set to `text/plain` or == Options //tag::configuration-properties[] -$$splitter.apply-sequence$$:: $$Add correlation/sequence information in headers to facilitate later aggregation.$$ *($$Boolean$$, default: `$$true$$`)* +$$splitter.apply-sequence$$:: $$Add correlation/sequence information in headers to facilitate later aggregation.$$ *($$Boolean$$, default: `$$$$`)* $$splitter.charset$$:: $$The charset to use when converting bytes in text-based files to String.$$ *($$String$$, default: `$$$$`)* $$splitter.delimiters$$:: $$When expression is null, delimiters to use when tokenizing {@link String} payloads.$$ *($$String$$, default: `$$$$`)* $$splitter.expression$$:: $$A SpEL expression for splitting payloads.$$ *($$String$$, default: `$$$$`)* $$splitter.file-markers$$:: $$Set to true or false to use a {@code FileSplitter} (to split text-based files by line) that includes (or not) beginning/end of file markers.$$ *($$Boolean$$, default: `$$$$`)* -$$splitter.markers-json$$:: $$When 'fileMarkers == true', specify if they should be produced as FileSplitter.FileMarker objects or JSON.$$ *($$Boolean$$, default: `$$true$$`)* +$$splitter.markers-json$$:: $$When 'fileMarkers == true', specify if they should be produced as FileSplitter.FileMarker objects or JSON.$$ *($$Boolean$$, default: `$$$$`)* //end::configuration-properties[] //end::ref-doc[] diff --git a/applications/sink/mqtt-sink/README.adoc b/applications/sink/mqtt-sink/README.adoc index 2648234a..d44eb6b3 100644 --- a/applications/sink/mqtt-sink/README.adoc +++ b/applications/sink/mqtt-sink/README.adoc @@ -29,12 +29,12 @@ $$username$$:: $$the username to use when connecting to the broker.$$ *($$String === mqtt.consumer -$$async$$:: $$whether or not to use async sends.$$ *($$Boolean$$, default: `$$false$$`)* -$$charset$$:: $$the charset used to convert a String payload to byte[].$$ *($$String$$, default: `$$UTF-8$$`)* -$$client-id$$:: $$identifies the client.$$ *($$String$$, default: `$$stream.client.id.sink$$`)* -$$qos$$:: $$the quality of service to use.$$ *($$Integer$$, default: `$$1$$`)* -$$retained$$:: $$whether to set the 'retained' flag.$$ *($$Boolean$$, default: `$$false$$`)* -$$topic$$:: $$the topic to which the sink will publish.$$ *($$String$$, default: `$$stream.mqtt$$`)* +$$async$$:: $$whether or not to use async sends.$$ *($$Boolean$$, default: `$$$$`)* +$$charset$$:: $$the charset used to convert a String payload to byte[].$$ *($$String$$, default: `$$$$`)* +$$client-id$$:: $$identifies the client.$$ *($$String$$, default: `$$$$`)* +$$qos$$:: $$the quality of service to use.$$ *($$Integer$$, default: `$$$$`)* +$$retained$$:: $$whether to set the 'retained' flag.$$ *($$Boolean$$, default: `$$$$`)* +$$topic$$:: $$the topic to which the sink will publish.$$ *($$String$$, default: `$$$$`)* //end::configuration-properties[] //end::ref-doc[] diff --git a/applications/sink/mqtt-sink/pom.xml b/applications/sink/mqtt-sink/pom.xml index 79f8d974..0cf98074 100644 --- a/applications/sink/mqtt-sink/pom.xml +++ b/applications/sink/mqtt-sink/pom.xml @@ -28,7 +28,7 @@ org.testcontainers testcontainers - 1.9.1 + ${test-containers.version} test diff --git a/applications/sink/mqtt-sink/src/test/java/org/springframework/cloud/stream/app/mqtt/sink/MqttSinkTests.java b/applications/sink/mqtt-sink/src/test/java/org/springframework/cloud/stream/app/mqtt/sink/MqttSinkTests.java index ade953d6..38c843f9 100644 --- a/applications/sink/mqtt-sink/src/test/java/org/springframework/cloud/stream/app/mqtt/sink/MqttSinkTests.java +++ b/applications/sink/mqtt-sink/src/test/java/org/springframework/cloud/stream/app/mqtt/sink/MqttSinkTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2017-2020 the original author or authors. + * Copyright 2017-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,6 @@ package org.springframework.cloud.stream.app.mqtt.sink; import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.testcontainers.containers.GenericContainer; @@ -44,7 +43,7 @@ import static org.assertj.core.api.Assertions.assertThat; public class MqttSinkTests { static { - GenericContainer mosquitto = new GenericContainer("eclipse-mosquitto") + GenericContainer mosquitto = new GenericContainer("cyrilix/rabbitmq-mqtt") .withExposedPorts(1883); mosquitto.start(); final Integer mappedPort = mosquitto.getMappedPort(1883); @@ -57,7 +56,6 @@ public class MqttSinkTests { } @Test - @Disabled public void testMqttSink() { try (ConfigurableApplicationContext context = new SpringApplicationBuilder( TestChannelBinderConfiguration diff --git a/applications/sink/rabbit-sink/README.adoc b/applications/sink/rabbit-sink/README.adoc index b90d5547..6faddbe6 100644 --- a/applications/sink/rabbit-sink/README.adoc +++ b/applications/sink/rabbit-sink/README.adoc @@ -16,11 +16,11 @@ Properties grouped by prefix: === rabbit $$converter-bean-name$$:: $$The bean name for a custom message converter; if omitted, a SimpleMessageConverter is used. If 'jsonConverter', a Jackson2JsonMessageConverter bean will be created for you.$$ *($$String$$, default: `$$$$`)* -$$exchange$$:: $$Exchange name - overridden by exchangeNameExpression, if supplied.$$ *($$String$$, default: `$$$$`)* +$$exchange$$:: $$Exchange name - overridden by exchangeNameExpression, if supplied.$$ *($$String$$, default: `$$$$`)* $$exchange-expression$$:: $$A SpEL expression that evaluates to an exchange name.$$ *($$Expression$$, default: `$$$$`)* -$$mapped-request-headers$$:: $$Headers that will be mapped.$$ *($$String[]$$, default: `$$[*]$$`)* -$$own-connection$$:: $$When true, use a separate connection based on the boot properties.$$ *($$Boolean$$, default: `$$false$$`)* -$$persistent-delivery-mode$$:: $$Default delivery mode when 'amqp_deliveryMode' header is not present, true for PERSISTENT.$$ *($$Boolean$$, default: `$$false$$`)* +$$mapped-request-headers$$:: $$Headers that will be mapped.$$ *($$String[]$$, default: `$$$$`)* +$$own-connection$$:: $$When true, use a separate connection based on the boot properties.$$ *($$Boolean$$, default: `$$$$`)* +$$persistent-delivery-mode$$:: $$Default delivery mode when 'amqp_deliveryMode' header is not present, true for PERSISTENT.$$ *($$Boolean$$, default: `$$$$`)* $$routing-key$$:: $$Routing key - overridden by routingKeyExpression, if supplied.$$ *($$String$$, default: `$$$$`)* $$routing-key-expression$$:: $$A SpEL expression that evaluates to a routing key.$$ *($$Expression$$, default: `$$$$`)* diff --git a/applications/sink/rabbit-sink/pom.xml b/applications/sink/rabbit-sink/pom.xml index a4c0a7c0..7e8afc46 100644 --- a/applications/sink/rabbit-sink/pom.xml +++ b/applications/sink/rabbit-sink/pom.xml @@ -49,13 +49,13 @@ org.testcontainers testcontainers - 1.9.1 + ${test-containers.version} test org.testcontainers rabbitmq - 1.12.5 + ${test-containers.version} test diff --git a/applications/sink/rabbit-sink/src/test/java/org/springframework/cloud/stream/app/sink/rabbit/RabbitSinkIntegrationTests.java b/applications/sink/rabbit-sink/src/test/java/org/springframework/cloud/stream/app/sink/rabbit/RabbitSinkIntegrationTests.java index 084a9973..10938b37 100644 --- a/applications/sink/rabbit-sink/src/test/java/org/springframework/cloud/stream/app/sink/rabbit/RabbitSinkIntegrationTests.java +++ b/applications/sink/rabbit-sink/src/test/java/org/springframework/cloud/stream/app/sink/rabbit/RabbitSinkIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2019 the original author or authors. + * Copyright 2016-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,7 +45,7 @@ import org.springframework.test.annotation.DirtiesContext; abstract class RabbitSinkIntegrationTests { static { - GenericContainer rabbitmq = new GenericContainer("rabbitmq:3.5.3") + GenericContainer rabbitmq = new GenericContainer("rabbitmq") .withExposedPorts(5672); rabbitmq.start(); final Integer mappedPort = rabbitmq.getMappedPort(5672); diff --git a/applications/sink/rabbit-sink/src/test/java/org/springframework/cloud/stream/app/sink/rabbit/SimpleRoutingKeyAndCustomHeaderTests.java b/applications/sink/rabbit-sink/src/test/java/org/springframework/cloud/stream/app/sink/rabbit/SimpleRoutingKeyAndCustomHeaderTests.java index 29df4a3f..4450c9bf 100644 --- a/applications/sink/rabbit-sink/src/test/java/org/springframework/cloud/stream/app/sink/rabbit/SimpleRoutingKeyAndCustomHeaderTests.java +++ b/applications/sink/rabbit-sink/src/test/java/org/springframework/cloud/stream/app/sink/rabbit/SimpleRoutingKeyAndCustomHeaderTests.java @@ -16,7 +16,6 @@ package org.springframework.cloud.stream.app.sink.rabbit; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.springframework.amqp.core.Message; @@ -32,7 +31,6 @@ import static org.assertj.core.api.Assertions.assertThat; public class SimpleRoutingKeyAndCustomHeaderTests extends RabbitSinkIntegrationTests { @Test - @Disabled public void test() { this.channels.send(MessageBuilder.withPayload("foo".getBytes()) .setHeader("bar", "baz") diff --git a/applications/sink/s3-sink/README.adoc b/applications/sink/s3-sink/README.adoc index be85aaec..0469c487 100644 --- a/applications/sink/s3-sink/README.adoc +++ b/applications/sink/s3-sink/README.adoc @@ -21,7 +21,7 @@ Properties grouped by prefix: === s3.common $$endpoint-url$$:: $$Optional endpoint url to connect to s3 compatible storage.$$ *($$String$$, default: `$$$$`)* -$$path-style-access$$:: $$Use path style access.$$ *($$Boolean$$, default: `$$false$$`)* +$$path-style-access$$:: $$Use path style access.$$ *($$Boolean$$, default: `$$$$`)* === s3.consumer diff --git a/applications/source/mqtt-source/README.adoc b/applications/source/mqtt-source/README.adoc index e677727a..dfc583b9 100644 --- a/applications/source/mqtt-source/README.adoc +++ b/applications/source/mqtt-source/README.adoc @@ -29,11 +29,11 @@ $$username$$:: $$the username to use when connecting to the broker.$$ *($$String === mqtt.supplier -$$binary$$:: $$true to leave the payload as bytes.$$ *($$Boolean$$, default: `$$false$$`)* -$$charset$$:: $$the charset used to convert bytes to String (when binary is false).$$ *($$String$$, default: `$$UTF-8$$`)* -$$client-id$$:: $$identifies the client.$$ *($$String$$, default: `$$stream.client.id.source$$`)* -$$qos$$:: $$the qos; a single value for all topics or a comma-delimited list to match the topics.$$ *($$Integer[]$$, default: `$$[0]$$`)* -$$topics$$:: $$the topic(s) (comma-delimited) to which the source will subscribe.$$ *($$String[]$$, default: `$$[stream.mqtt]$$`)* +$$binary$$:: $$true to leave the payload as bytes.$$ *($$Boolean$$, default: `$$$$`)* +$$charset$$:: $$the charset used to convert bytes to String (when binary is false).$$ *($$String$$, default: `$$$$`)* +$$client-id$$:: $$identifies the client.$$ *($$String$$, default: `$$$$`)* +$$qos$$:: $$the qos; a single value for all topics or a comma-delimited list to match the topics.$$ *($$Integer[]$$, default: `$$$$`)* +$$topics$$:: $$the topic(s) (comma-delimited) to which the source will subscribe.$$ *($$String[]$$, default: `$$$$`)* //end::configuration-properties[] //end::ref-doc[] diff --git a/applications/source/mqtt-source/src/test/java/org/springframework/cloud/stream/app/source/mqtt/MqttSourceTests.java b/applications/source/mqtt-source/src/test/java/org/springframework/cloud/stream/app/source/mqtt/MqttSourceTests.java index 9a0b7b94..d946363d 100644 --- a/applications/source/mqtt-source/src/test/java/org/springframework/cloud/stream/app/source/mqtt/MqttSourceTests.java +++ b/applications/source/mqtt-source/src/test/java/org/springframework/cloud/stream/app/source/mqtt/MqttSourceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2020 the original author or authors. + * Copyright 2020-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,6 @@ package org.springframework.cloud.stream.app.source.mqtt; import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.testcontainers.containers.GenericContainer; @@ -44,7 +43,7 @@ import static org.assertj.core.api.Assertions.assertThat; public class MqttSourceTests { static { - GenericContainer mosquitto = new GenericContainer("eclipse-mosquitto") + GenericContainer mosquitto = new GenericContainer("cyrilix/rabbitmq-mqtt") .withExposedPorts(1883); mosquitto.start(); final Integer mappedPort = mosquitto.getMappedPort(1883); @@ -57,7 +56,6 @@ public class MqttSourceTests { } @Test - @Disabled public void testMqttSource() { try (ConfigurableApplicationContext context = new SpringApplicationBuilder( TestChannelBinderConfiguration diff --git a/applications/source/s3-source/README.adoc b/applications/source/s3-source/README.adoc index 76880905..d27690ff 100644 --- a/applications/source/s3-source/README.adoc +++ b/applications/source/s3-source/README.adoc @@ -102,20 +102,20 @@ $$root$$:: $$Root node - store entries are children of this node.$$ *($$String$$ === s3.common $$endpoint-url$$:: $$Optional endpoint url to connect to s3 compatible storage.$$ *($$String$$, default: `$$$$`)* -$$path-style-access$$:: $$Use path style access.$$ *($$Boolean$$, default: `$$false$$`)* +$$path-style-access$$:: $$Use path style access.$$ *($$Boolean$$, default: `$$$$`)* === s3.supplier -$$auto-create-local-dir$$:: $$Create or not the local directory.$$ *($$Boolean$$, default: `$$true$$`)* -$$delete-remote-files$$:: $$Delete or not remote files after processing.$$ *($$Boolean$$, default: `$$false$$`)* +$$auto-create-local-dir$$:: $$Create or not the local directory.$$ *($$Boolean$$, default: `$$$$`)* +$$delete-remote-files$$:: $$Delete or not remote files after processing.$$ *($$Boolean$$, default: `$$$$`)* $$filename-pattern$$:: $$The pattern to filter remote files.$$ *($$String$$, default: `$$$$`)* $$filename-regex$$:: $$The regexp to filter remote files.$$ *($$Pattern$$, default: `$$$$`)* -$$list-only$$:: $$Set to true to return s3 object metadata without copying file to a local directory.$$ *($$Boolean$$, default: `$$false$$`)* +$$list-only$$:: $$Set to true to return s3 object metadata without copying file to a local directory.$$ *($$Boolean$$, default: `$$$$`)* $$local-dir$$:: $$The local directory to store files.$$ *($$File$$, default: `$$$$`)* -$$preserve-timestamp$$:: $$To transfer or not the timestamp of the remote file to the local one.$$ *($$Boolean$$, default: `$$true$$`)* -$$remote-dir$$:: $$AWS S3 bucket resource.$$ *($$String$$, default: `$$bucket$$`)* -$$remote-file-separator$$:: $$Remote File separator.$$ *($$String$$, default: `$$/$$`)* -$$tmp-file-suffix$$:: $$Temporary file suffix.$$ *($$String$$, default: `$$.tmp$$`)* +$$preserve-timestamp$$:: $$To transfer or not the timestamp of the remote file to the local one.$$ *($$Boolean$$, default: `$$$$`)* +$$remote-dir$$:: $$AWS S3 bucket resource.$$ *($$String$$, default: `$$$$`)* +$$remote-file-separator$$:: $$Remote File separator.$$ *($$String$$, default: `$$$$`)* +$$tmp-file-suffix$$:: $$Temporary file suffix.$$ *($$String$$, default: `$$$$`)* //end::configuration-properties[] == Amazon AWS common options diff --git a/applications/source/sftp-source/README.adoc b/applications/source/sftp-source/README.adoc index 9ec82749..7864a60f 100644 --- a/applications/source/sftp-source/README.adoc +++ b/applications/source/sftp-source/README.adoc @@ -130,31 +130,31 @@ $$root$$:: $$Root node - store entries are children of this node.$$ *($$String$$ === sftp.supplier -$$auto-create-local-dir$$:: $$Set to true to create the local directory if it does not exist.$$ *($$Boolean$$, default: `$$true$$`)* -$$delay-when-empty$$:: $$Duration of delay when no new files are detected.$$ *($$Duration$$, default: `$$1s$$`)* -$$delete-remote-files$$:: $$Set to true to delete remote files after successful transfer.$$ *($$Boolean$$, default: `$$false$$`)* +$$auto-create-local-dir$$:: $$Set to true to create the local directory if it does not exist.$$ *($$Boolean$$, default: `$$$$`)* +$$delay-when-empty$$:: $$Duration of delay when no new files are detected.$$ *($$Duration$$, default: `$$$$`)* +$$delete-remote-files$$:: $$Set to true to delete remote files after successful transfer.$$ *($$Boolean$$, default: `$$$$`)* $$directories$$:: $$A list of factory "name.directory" pairs.$$ *($$String[]$$, default: `$$$$`)* $$factories$$:: $$A map of factory names to factories.$$ *($$Map$$, default: `$$$$`)* -$$fair$$:: $$True for fair rotation of multiple servers/directories. This is false by default so if a source has more than one entry, these will be received before the other sources are visited.$$ *($$Boolean$$, default: `$$false$$`)* +$$fair$$:: $$True for fair rotation of multiple servers/directories. This is false by default so if a source has more than one entry, these will be received before the other sources are visited.$$ *($$Boolean$$, default: `$$$$`)* $$filename-pattern$$:: $$A filter pattern to match the names of files to transfer.$$ *($$String$$, default: `$$$$`)* $$filename-regex$$:: $$A filter regex pattern to match the names of files to transfer.$$ *($$Pattern$$, default: `$$$$`)* -$$list-only$$:: $$Set to true to return file metadata without the entire payload.$$ *($$Boolean$$, default: `$$false$$`)* +$$list-only$$:: $$Set to true to return file metadata without the entire payload.$$ *($$Boolean$$, default: `$$$$`)* $$local-dir$$:: $$The local directory to use for file transfers.$$ *($$File$$, default: `$$$$`)* $$max-fetch$$:: $$The maximum number of remote files to fetch per poll; default unlimited. Does not apply when listing files or building task launch requests.$$ *($$Integer$$, default: `$$$$`)* -$$preserve-timestamp$$:: $$Set to true to preserve the original timestamp.$$ *($$Boolean$$, default: `$$true$$`)* -$$remote-dir$$:: $$The remote FTP directory.$$ *($$String$$, default: `$$/$$`)* -$$remote-file-separator$$:: $$The remote file separator.$$ *($$String$$, default: `$$/$$`)* -$$stream$$:: $$Set to true to stream the file rather than copy to a local directory.$$ *($$Boolean$$, default: `$$false$$`)* -$$tmp-file-suffix$$:: $$The suffix to use while the transfer is in progress.$$ *($$String$$, default: `$$.tmp$$`)* +$$preserve-timestamp$$:: $$Set to true to preserve the original timestamp.$$ *($$Boolean$$, default: `$$$$`)* +$$remote-dir$$:: $$The remote FTP directory.$$ *($$String$$, default: `$$$$`)* +$$remote-file-separator$$:: $$The remote file separator.$$ *($$String$$, default: `$$$$`)* +$$stream$$:: $$Set to true to stream the file rather than copy to a local directory.$$ *($$Boolean$$, default: `$$$$`)* +$$tmp-file-suffix$$:: $$The suffix to use while the transfer is in progress.$$ *($$String$$, default: `$$$$`)* === sftp.supplier.factory -$$allow-unknown-keys$$:: $$True to allow an unknown or changed key.$$ *($$Boolean$$, default: `$$false$$`)* -$$host$$:: $$The host name of the server.$$ *($$String$$, default: `$$localhost$$`)* +$$allow-unknown-keys$$:: $$True to allow an unknown or changed key.$$ *($$Boolean$$, default: `$$$$`)* +$$host$$:: $$The host name of the server.$$ *($$String$$, default: `$$$$`)* $$known-hosts-expression$$:: $$A SpEL expression resolving to the location of the known hosts file.$$ *($$Expression$$, default: `$$$$`)* -$$pass-phrase$$:: $$Passphrase for user's private key.$$ *($$String$$, default: `$$$$`)* +$$pass-phrase$$:: $$Passphrase for user's private key.$$ *($$String$$, default: `$$$$`)* $$password$$:: $$The password to use to connect to the server.$$ *($$String$$, default: `$$$$`)* -$$port$$:: $$The port of the server.$$ *($$Integer$$, default: `$$22$$`)* +$$port$$:: $$The port of the server.$$ *($$Integer$$, default: `$$$$`)* $$private-key$$:: $$Resource location of user's private key.$$ *($$Resource$$, default: `$$$$`)* $$username$$:: $$The username to use to connect to the server.$$ *($$String$$, default: `$$$$`)* diff --git a/applications/stream-applications-core/stream-applications-test-support/src/main/java/org/springframework/cloud/stream/app/test/integration/kafka/KafkaConfig.java b/applications/stream-applications-core/stream-applications-test-support/src/main/java/org/springframework/cloud/stream/app/test/integration/kafka/KafkaConfig.java index d29963d3..27669f5c 100644 --- a/applications/stream-applications-core/stream-applications-test-support/src/main/java/org/springframework/cloud/stream/app/test/integration/kafka/KafkaConfig.java +++ b/applications/stream-applications-core/stream-applications-test-support/src/main/java/org/springframework/cloud/stream/app/test/integration/kafka/KafkaConfig.java @@ -22,7 +22,9 @@ import org.testcontainers.utility.DockerImageName; /** * Initializes and starts a {@link KafkaContainer}. + * * @author David Turanski + * @author Artem Bilan */ public abstract class KafkaConfig { @@ -32,7 +34,7 @@ public abstract class KafkaConfig { * The KafkaContainer. */ public final static KafkaContainer kafka = new KafkaContainer( - DockerImageName.parse("confluentinc/cp-kafka:5.5.1")) + DockerImageName.parse("confluentinc/cp-kafka")) .withExposedPorts(9092, 9093) .withNetwork(network); diff --git a/functions/common/cdc-debezium-boot-starter/src/test/java/org/springframework/cloud/fn/common/cdc/CdcBootStarterIntegrationTest.java b/functions/common/cdc-debezium-boot-starter/src/test/java/org/springframework/cloud/fn/common/cdc/CdcBootStarterIntegrationTest.java index 3e7fec8e..9e5287c8 100644 --- a/functions/common/cdc-debezium-boot-starter/src/test/java/org/springframework/cloud/fn/common/cdc/CdcBootStarterIntegrationTest.java +++ b/functions/common/cdc-debezium-boot-starter/src/test/java/org/springframework/cloud/fn/common/cdc/CdcBootStarterIntegrationTest.java @@ -18,6 +18,7 @@ package org.springframework.cloud.fn.common.cdc; import java.time.Duration; +import com.zaxxer.hikari.HikariDataSource; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.testcontainers.containers.GenericContainer; @@ -29,8 +30,6 @@ import org.springframework.boot.test.context.runner.ApplicationContextRunner; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.test.jdbc.JdbcTestUtils; -import com.zaxxer.hikari.HikariDataSource; - import static org.assertj.core.api.Assertions.assertThat; import static org.awaitility.Awaitility.await; @@ -48,7 +47,7 @@ public class CdcBootStarterIntegrationTest { @Container static GenericContainer debeziumMySQL = - new GenericContainer<>(DockerImageName.parse("debezium/example-mysql:latest")) + new GenericContainer<>(DockerImageName.parse("debezium/example-mysql")) .withEnv("MYSQL_ROOT_PASSWORD", "debezium") .withEnv("MYSQL_USER", "mysqluser") .withEnv("MYSQL_PASSWORD", "mysqlpw") diff --git a/functions/consumer/mqtt-consumer/src/test/java/org/springframework/cloud/fn/consumer/mqtt/MqttConsumerTests.java b/functions/consumer/mqtt-consumer/src/test/java/org/springframework/cloud/fn/consumer/mqtt/MqttConsumerTests.java index 40f89347..694460ce 100644 --- a/functions/consumer/mqtt-consumer/src/test/java/org/springframework/cloud/fn/consumer/mqtt/MqttConsumerTests.java +++ b/functions/consumer/mqtt-consumer/src/test/java/org/springframework/cloud/fn/consumer/mqtt/MqttConsumerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2017-2020 the original author or authors. + * Copyright 2017-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,6 @@ package org.springframework.cloud.fn.consumer.mqtt; import java.util.function.Consumer; import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.testcontainers.containers.GenericContainer; @@ -43,7 +42,7 @@ import static org.assertj.core.api.Assertions.assertThat; public class MqttConsumerTests { static { - GenericContainer mosquitto = new GenericContainer("eclipse-mosquitto") + GenericContainer mosquitto = new GenericContainer("cyrilix/rabbitmq-mqtt") .withExposedPorts(1883); mosquitto.start(); final Integer mappedPort = mosquitto.getMappedPort(1883); @@ -62,7 +61,6 @@ public class MqttConsumerTests { } @Test - @Disabled public void testMqttConsumer() { this.mqttConsumer.accept(MessageBuilder.withPayload("hello").build()); Message in = this.queue.receive(10000); @@ -97,5 +95,7 @@ public class MqttConsumerTests { public QueueChannel queue() { return new QueueChannel(); } + } + } diff --git a/functions/supplier/mqtt-supplier/src/test/java/org/springframework/cloud/fn/supplier/mqtt/MqttSupplierTests.java b/functions/supplier/mqtt-supplier/src/test/java/org/springframework/cloud/fn/supplier/mqtt/MqttSupplierTests.java index 256750d6..2cd995c1 100644 --- a/functions/supplier/mqtt-supplier/src/test/java/org/springframework/cloud/fn/supplier/mqtt/MqttSupplierTests.java +++ b/functions/supplier/mqtt-supplier/src/test/java/org/springframework/cloud/fn/supplier/mqtt/MqttSupplierTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2017-2020 the original author or authors. + * Copyright 2017-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,6 @@ package org.springframework.cloud.fn.supplier.mqtt; import java.util.function.Supplier; import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.testcontainers.containers.GenericContainer; import reactor.core.publisher.Flux; @@ -45,6 +44,7 @@ import static org.assertj.core.api.Assertions.assertThat; * @author Janne Valkealahti * @author Gary Russell * @author Soby Chacko + * @author Artem Bilan * */ @SpringBootTest(properties = {"mqtt.supplier.topics=test,fake", "mqtt.supplier.qos=0,0"}) @@ -52,7 +52,7 @@ import static org.assertj.core.api.Assertions.assertThat; public class MqttSupplierTests { static { - GenericContainer mosquitto = new GenericContainer("eclipse-mosquitto") + GenericContainer mosquitto = new GenericContainer("cyrilix/rabbitmq-mqtt") .withExposedPorts(1883); mosquitto.start(); final Integer mappedPort = mosquitto.getMappedPort(1883); @@ -71,7 +71,6 @@ public class MqttSupplierTests { private MessageHandler mqttOutbound; @Test - @Disabled public void testBasicFlow() { mqttOutbound.handleMessage(MessageBuilder.withPayload("hello").build()); diff --git a/functions/supplier/s3-supplier/src/test/java/org/springframework/cloud/fn/supplier/s3/AbstractAwsS3SupplierMockTests.java b/functions/supplier/s3-supplier/src/test/java/org/springframework/cloud/fn/supplier/s3/AbstractAwsS3SupplierMockTests.java index 6a8e03bd..c6fece80 100644 --- a/functions/supplier/s3-supplier/src/test/java/org/springframework/cloud/fn/supplier/s3/AbstractAwsS3SupplierMockTests.java +++ b/functions/supplier/s3-supplier/src/test/java/org/springframework/cloud/fn/supplier/s3/AbstractAwsS3SupplierMockTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2020 the original author or authors. + * Copyright 2016-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -117,6 +117,16 @@ public abstract class AbstractAwsS3SupplierMockTests { @AfterAll public static void tearDown() { System.clearProperty("s3.supplier.localDir"); + S3_OBJECTS.stream() + .map(S3Object::getObjectContent) + .forEach(stream -> { + try { + stream.close(); + } + catch (IOException e) { + // Ignore + } + }); } @SpringBootApplication @@ -141,9 +151,7 @@ public abstract class AbstractAwsS3SupplierMockTests { objectSummaries.add(s3ObjectSummary); } - willAnswer(invocation -> { - return objectListing; - }).given(amazonS3).listObjects(any(ListObjectsRequest.class)); + willAnswer(invocation -> objectListing).given(amazonS3).listObjects(any(ListObjectsRequest.class)); for (final S3Object s3Object : S3_OBJECTS) { willAnswer(invocation -> s3Object).given(amazonS3).getObject(S3_BUCKET, s3Object.getKey());