diff --git a/advanced/advanced-testing-examples/pom.xml b/advanced/advanced-testing-examples/pom.xml
index b147d547..af4ab842 100644
--- a/advanced/advanced-testing-examples/pom.xml
+++ b/advanced/advanced-testing-examples/pom.xml
@@ -137,14 +137,14 @@
org.springframework
spring-framework-bom
- 6.0.0-M2
+ 6.0.0-M3
import
pom
org.springframework.integration
spring-integration-bom
- 6.0.0-M1
+ 6.0.0-M2
import
pom
diff --git a/advanced/dynamic-ftp/pom.xml b/advanced/dynamic-ftp/pom.xml
index e2c72394..e91bfd12 100644
--- a/advanced/dynamic-ftp/pom.xml
+++ b/advanced/dynamic-ftp/pom.xml
@@ -126,14 +126,14 @@
org.springframework
spring-framework-bom
- 6.0.0-M2
+ 6.0.0-M3
import
pom
org.springframework.integration
spring-integration-bom
- 6.0.0-M1
+ 6.0.0-M2
import
pom
diff --git a/advanced/dynamic-tcp-client/pom.xml b/advanced/dynamic-tcp-client/pom.xml
index 683c7d0c..920d1935 100644
--- a/advanced/dynamic-tcp-client/pom.xml
+++ b/advanced/dynamic-tcp-client/pom.xml
@@ -138,14 +138,14 @@
org.springframework
spring-framework-bom
- 6.0.0-M2
+ 6.0.0-M3
import
pom
org.springframework.integration
spring-integration-bom
- 6.0.0-M1
+ 6.0.0-M2
import
pom
diff --git a/applications/cafe-scripted/pom.xml b/applications/cafe-scripted/pom.xml
index e33277bf..fb4bc5cd 100644
--- a/applications/cafe-scripted/pom.xml
+++ b/applications/cafe-scripted/pom.xml
@@ -159,14 +159,14 @@
org.springframework
spring-framework-bom
- 6.0.0-M2
+ 6.0.0-M3
import
pom
org.springframework.integration
spring-integration-bom
- 6.0.0-M1
+ 6.0.0-M2
import
pom
diff --git a/applications/cafe/cafe-amqp/pom.xml b/applications/cafe/cafe-amqp/pom.xml
index 7bf360ea..bea8a960 100644
--- a/applications/cafe/cafe-amqp/pom.xml
+++ b/applications/cafe/cafe-amqp/pom.xml
@@ -132,14 +132,14 @@
org.springframework
spring-framework-bom
- 6.0.0-M2
+ 6.0.0-M3
import
pom
org.springframework.integration
spring-integration-bom
- 6.0.0-M1
+ 6.0.0-M2
import
pom
diff --git a/applications/cafe/cafe-jms/pom.xml b/applications/cafe/cafe-jms/pom.xml
index a205e81f..612691f9 100644
--- a/applications/cafe/cafe-jms/pom.xml
+++ b/applications/cafe/cafe-jms/pom.xml
@@ -156,14 +156,14 @@
org.springframework
spring-framework-bom
- 6.0.0-M2
+ 6.0.0-M3
import
pom
org.springframework.integration
spring-integration-bom
- 6.0.0-M1
+ 6.0.0-M2
import
pom
diff --git a/applications/cafe/cafe-si/pom.xml b/applications/cafe/cafe-si/pom.xml
index 59789955..01888811 100644
--- a/applications/cafe/cafe-si/pom.xml
+++ b/applications/cafe/cafe-si/pom.xml
@@ -131,14 +131,14 @@
org.springframework
spring-framework-bom
- 6.0.0-M2
+ 6.0.0-M3
import
pom
org.springframework.integration
spring-integration-bom
- 6.0.0-M1
+ 6.0.0-M2
import
pom
diff --git a/applications/file-split-ftp/pom.xml b/applications/file-split-ftp/pom.xml
index ff2dbf77..0c5a6813 100644
--- a/applications/file-split-ftp/pom.xml
+++ b/applications/file-split-ftp/pom.xml
@@ -117,6 +117,12 @@
spring-boot-starter-test
test
+
+ com.icegreen
+ greenmail
+ 2.0.0-alpha-2
+ test
+
org.junit.jupiter
junit-jupiter-engine
@@ -159,14 +165,14 @@
org.springframework
spring-framework-bom
- 6.0.0-M2
+ 6.0.0-M3
import
pom
org.springframework.integration
spring-integration-bom
- 6.0.0-M1
+ 6.0.0-M2
import
pom
diff --git a/applications/file-split-ftp/src/main/java/org/springframework/integration/samples/filesplit/Application.java b/applications/file-split-ftp/src/main/java/org/springframework/integration/samples/filesplit/Application.java
index cb812119..7555f4cb 100644
--- a/applications/file-split-ftp/src/main/java/org/springframework/integration/samples/filesplit/Application.java
+++ b/applications/file-split-ftp/src/main/java/org/springframework/integration/samples/filesplit/Application.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2018 the original author or authors.
+ * Copyright 2002-2022 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.
@@ -26,7 +26,6 @@ import org.apache.commons.net.ftp.FTPFile;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.mail.MailProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.integration.dsl.IntegrationFlow;
@@ -34,6 +33,7 @@ import org.springframework.integration.dsl.IntegrationFlows;
import org.springframework.integration.dsl.Pollers;
import org.springframework.integration.file.FileHeaders;
import org.springframework.integration.file.FileWritingMessageHandler;
+import org.springframework.integration.file.dsl.FileWritingMessageHandlerSpec;
import org.springframework.integration.file.dsl.Files;
import org.springframework.integration.file.remote.session.SessionFactory;
import org.springframework.integration.file.splitter.FileSplitter;
@@ -67,11 +67,11 @@ public class Application {
@Bean
public IntegrationFlow fromFile() {
return IntegrationFlows.from(
- Files.inboundAdapter(new File("/tmp/in"))
- .preventDuplicates(false)
- .patternFilter("*.txt"), e -> e.poller(Pollers.fixedDelay(5000)
- .errorChannel("tfrErrors.input"))
- .id("fileInboundChannelAdapter"))
+ Files.inboundAdapter(new File("/tmp/in"))
+ .preventDuplicates(false)
+ .patternFilter("*.txt"), e -> e.poller(Pollers.fixedDelay(5000)
+ .errorChannel("tfrErrors.input"))
+ .id("fileInboundChannelAdapter"))
.handle(Files.splitter(true, true))
.
org.springframework.integration
spring-integration-bom
- 6.0.0-M1
+ 6.0.0-M2
import
pom
diff --git a/basic/testing-examples/pom.xml b/basic/testing-examples/pom.xml
index 4d602ad3..46a69c39 100644
--- a/basic/testing-examples/pom.xml
+++ b/basic/testing-examples/pom.xml
@@ -141,14 +141,14 @@
org.springframework
spring-framework-bom
- 6.0.0-M2
+ 6.0.0-M3
import
pom
org.springframework.integration
spring-integration-bom
- 6.0.0-M1
+ 6.0.0-M2
import
pom
diff --git a/basic/twitter/pom.xml b/basic/twitter/pom.xml
index 55db0db7..232ea079 100644
--- a/basic/twitter/pom.xml
+++ b/basic/twitter/pom.xml
@@ -127,14 +127,14 @@
org.springframework
spring-framework-bom
- 6.0.0-M2
+ 6.0.0-M3
import
pom
org.springframework.integration
spring-integration-bom
- 6.0.0-M1
+ 6.0.0-M2
import
pom
diff --git a/basic/web-sockets/pom.xml b/basic/web-sockets/pom.xml
index fa514d1d..86b2dfa1 100644
--- a/basic/web-sockets/pom.xml
+++ b/basic/web-sockets/pom.xml
@@ -138,14 +138,14 @@
org.springframework
spring-framework-bom
- 6.0.0-M2
+ 6.0.0-M3
import
pom
org.springframework.integration
spring-integration-bom
- 6.0.0-M1
+ 6.0.0-M2
import
pom
diff --git a/basic/ws-inbound-gateway/pom.xml b/basic/ws-inbound-gateway/pom.xml
index d1ccfc58..2eae2d5b 100644
--- a/basic/ws-inbound-gateway/pom.xml
+++ b/basic/ws-inbound-gateway/pom.xml
@@ -168,14 +168,14 @@
org.springframework
spring-framework-bom
- 6.0.0-M2
+ 6.0.0-M3
import
pom
org.springframework.integration
spring-integration-bom
- 6.0.0-M1
+ 6.0.0-M2
import
pom
diff --git a/basic/ws-outbound-gateway/pom.xml b/basic/ws-outbound-gateway/pom.xml
index d64f27e1..2995f49d 100644
--- a/basic/ws-outbound-gateway/pom.xml
+++ b/basic/ws-outbound-gateway/pom.xml
@@ -131,14 +131,14 @@
org.springframework
spring-framework-bom
- 6.0.0-M2
+ 6.0.0-M3
import
pom
org.springframework.integration
spring-integration-bom
- 6.0.0-M1
+ 6.0.0-M2
import
pom
diff --git a/basic/xml/pom.xml b/basic/xml/pom.xml
index d95c16e9..b92e57a6 100644
--- a/basic/xml/pom.xml
+++ b/basic/xml/pom.xml
@@ -126,14 +126,14 @@
org.springframework
spring-framework-bom
- 6.0.0-M2
+ 6.0.0-M3
import
pom
org.springframework.integration
spring-integration-bom
- 6.0.0-M1
+ 6.0.0-M2
import
pom
diff --git a/basic/xmpp/pom.xml b/basic/xmpp/pom.xml
index fa0aa152..99c6c3a1 100644
--- a/basic/xmpp/pom.xml
+++ b/basic/xmpp/pom.xml
@@ -126,14 +126,14 @@
org.springframework
spring-framework-bom
- 6.0.0-M2
+ 6.0.0-M3
import
pom
org.springframework.integration
spring-integration-bom
- 6.0.0-M1
+ 6.0.0-M2
import
pom
diff --git a/build.gradle b/build.gradle
index 75de3ee5..7623b65a 100644
--- a/build.gradle
+++ b/build.gradle
@@ -38,7 +38,7 @@ allprojects {
maven { url 'https://repo.spring.io/release' }
maven { url 'https://repo.spring.io/milestone' }
maven { url 'https://repo.spring.io/snapshot' }
-// maven { url 'https://repo.spring.io/libs-staging-local' }
+ maven { url 'https://repo.spring.io/libs-staging-local' }
}
}
@@ -260,11 +260,11 @@ subprojects { subproject ->
postgresVersion = '42.2.14'
slf4jVersion = '1.7.30'
springCloudVersion = '2022.0.0-SNAPSHOT'
- springIntegrationVersion = '6.0.0-M1'
+ springIntegrationVersion = '6.0.0-M2'
springIntegrationSocialTwiterVersion = '1.0.1.BUILD-SNAPSHOT'
springIntegrationSplunkVersion = '1.2.0.BUILD-SNAPSHOT'
- springVersion = '6.0.0-M2'
- springSecurityVersion = '6.0.0-M1'
+ springVersion = '6.0.0-M3'
+ springSecurityVersion = '6.0.0-M2'
springWebFlowVersion = '2.3.3.RELEASE'
testcontainersVersion = '1.16.2'
tilesJspVersion = '2.2.1'
@@ -1494,6 +1494,7 @@ project('file-split-ftp') {
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.integration:spring-integration-test'
+ testImplementation "com.icegreen:greenmail:2.0.0-alpha-2"
}
springBoot {
diff --git a/dsl/cafe-dsl/pom.xml b/dsl/cafe-dsl/pom.xml
index 971ee97c..01e88e71 100644
--- a/dsl/cafe-dsl/pom.xml
+++ b/dsl/cafe-dsl/pom.xml
@@ -149,14 +149,14 @@
org.springframework
spring-framework-bom
- 6.0.0-M2
+ 6.0.0-M3
import
pom
org.springframework.integration
spring-integration-bom
- 6.0.0-M1
+ 6.0.0-M2
import
pom
diff --git a/dsl/kafka-dsl/pom.xml b/dsl/kafka-dsl/pom.xml
index 070b96c9..37b9824a 100644
--- a/dsl/kafka-dsl/pom.xml
+++ b/dsl/kafka-dsl/pom.xml
@@ -149,14 +149,14 @@
org.springframework
spring-framework-bom
- 6.0.0-M2
+ 6.0.0-M3
import
pom
org.springframework.integration
spring-integration-bom
- 6.0.0-M1
+ 6.0.0-M2
import
pom
diff --git a/dsl/si4demo/pom.xml b/dsl/si4demo/pom.xml
index fd414ac3..3307393e 100644
--- a/dsl/si4demo/pom.xml
+++ b/dsl/si4demo/pom.xml
@@ -171,14 +171,14 @@
org.springframework
spring-framework-bom
- 6.0.0-M2
+ 6.0.0-M3
import
pom
org.springframework.integration
spring-integration-bom
- 6.0.0-M1
+ 6.0.0-M2
import
pom
diff --git a/intermediate/async-gateway/pom.xml b/intermediate/async-gateway/pom.xml
index d8efd2de..61811aa5 100644
--- a/intermediate/async-gateway/pom.xml
+++ b/intermediate/async-gateway/pom.xml
@@ -126,14 +126,14 @@
org.springframework
spring-framework-bom
- 6.0.0-M2
+ 6.0.0-M3
import
pom
org.springframework.integration
spring-integration-bom
- 6.0.0-M1
+ 6.0.0-M2
import
pom
diff --git a/intermediate/dynamic-poller/pom.xml b/intermediate/dynamic-poller/pom.xml
index 4dbdf899..fbc9dd26 100644
--- a/intermediate/dynamic-poller/pom.xml
+++ b/intermediate/dynamic-poller/pom.xml
@@ -126,14 +126,14 @@
org.springframework
spring-framework-bom
- 6.0.0-M2
+ 6.0.0-M3
import
pom
org.springframework.integration
spring-integration-bom
- 6.0.0-M1
+ 6.0.0-M2
import
pom
diff --git a/intermediate/errorhandling/pom.xml b/intermediate/errorhandling/pom.xml
index 04ab8258..9f8bd4f3 100644
--- a/intermediate/errorhandling/pom.xml
+++ b/intermediate/errorhandling/pom.xml
@@ -126,14 +126,14 @@
org.springframework
spring-framework-bom
- 6.0.0-M2
+ 6.0.0-M3
import
pom
org.springframework.integration
spring-integration-bom
- 6.0.0-M1
+ 6.0.0-M2
import
pom
diff --git a/intermediate/file-processing/pom.xml b/intermediate/file-processing/pom.xml
index 07ac1735..00c9bdf2 100644
--- a/intermediate/file-processing/pom.xml
+++ b/intermediate/file-processing/pom.xml
@@ -126,14 +126,14 @@
org.springframework
spring-framework-bom
- 6.0.0-M2
+ 6.0.0-M3
import
pom
org.springframework.integration
spring-integration-bom
- 6.0.0-M1
+ 6.0.0-M2
import
pom
diff --git a/intermediate/mail-attachments/pom.xml b/intermediate/mail-attachments/pom.xml
index 48b934b4..35b6b247 100644
--- a/intermediate/mail-attachments/pom.xml
+++ b/intermediate/mail-attachments/pom.xml
@@ -143,14 +143,14 @@
org.springframework
spring-framework-bom
- 6.0.0-M2
+ 6.0.0-M3
import
pom
org.springframework.integration
spring-integration-bom
- 6.0.0-M1
+ 6.0.0-M2
import
pom
diff --git a/intermediate/mail-attachments/src/test/java/org/springframework/integration/samples/mailattachments/MimeMessageParsingTest.java b/intermediate/mail-attachments/src/test/java/org/springframework/integration/samples/mailattachments/MimeMessageParsingTest.java
deleted file mode 100644
index c4af31bd..00000000
--- a/intermediate/mail-attachments/src/test/java/org/springframework/integration/samples/mailattachments/MimeMessageParsingTest.java
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
- * Copyright 2002-2017 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.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT 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.springframework.integration.samples.mailattachments;
-
-import org.springframework.integration.samples.mailattachments.support.EmailFragment;
-
-/**
- * Test to verify the correct parsing of Email Messages.
- *
- * @author Gunnar Hillert
- * @author Gary Russell
- * @author Artem Bilan
- *
- * @since 2.2
- */
-public class MimeMessageParsingTest {
-
-/*
- private static final Log LOGGER = LogFactory.getLog(MimeMessageParsingTest.class);
-
- private Wiser wiser;
-
- private int wiserPort;
-
- @Before
- public void startWiser() {
-
- this.wiserPort = SocketUtils.findAvailableTcpPort(2500);
-
- wiser = new Wiser();
- wiser.setPort(this.wiserPort);
- wiser.start();
- LOGGER.info("Wiser was started.");
-
- }
-
- */
- /**
- * This test will create a Mime Message that contains an Attachment, send it
- * to an SMTP Server (Using Wiser) and retrieve and process the Mime Message.
- *
- * This test verifies that the parsing of the retrieved Mime Message is
- * successful and that the correct number of {@link EmailFragment}s is created.
- *//*
-
- @Test
- public void testProcessingOfEmailAttachments() {
-
- final JavaMailSenderImpl mailSender = new JavaMailSenderImpl();
- mailSender.setPort(this.wiserPort);
-
- final MimeMessage message = mailSender.createMimeMessage();
- final String pictureName = "picture.png";
-
- final ByteArrayResource byteArrayResource = getFileData(pictureName);
-
- try {
-
- final MimeMessageHelper helper = new MimeMessageHelper(message, true);
-
- helper.setFrom("testfrom@springintegration.org");
- helper.setTo("testto@springintegration.org");
- helper.setSubject("Parsing of Attachments");
- helper.setText("Spring Integration Rocks!");
-
- helper.addAttachment(pictureName, byteArrayResource, "image/png");
-
- }
- catch (MessagingException e) {
- throw new MailParseException(e);
- }
-
- mailSender.send(message);
-
- final List wiserMessages = wiser.getMessages();
-
- Assert.assertTrue(wiserMessages.size() == 1);
-
- boolean foundTextMessage = false;
- boolean foundPicture = false;
-
- for (WiserMessage wiserMessage : wiserMessages) {
-
- final List emailFragments = new ArrayList<>();
-
- try {
- final MimeMessage mailMessage = wiserMessage.getMimeMessage();
- EmailParserUtils.handleMessage(null, mailMessage, emailFragments);
- }
- catch (MessagingException e) {
- throw new IllegalStateException("Error while retrieving Mime Message.");
- }
-
- Assert.assertTrue(emailFragments.size() == 2);
-
- for (EmailFragment emailFragment : emailFragments) {
- if ("picture.png".equals(emailFragment.getFilename())) {
- foundPicture = true;
- }
-
- if ("message.txt".equals(emailFragment.getFilename())) {
- foundTextMessage = true;
- }
- }
-
- Assert.assertTrue(foundPicture);
- Assert.assertTrue(foundTextMessage);
-
- }
- }
-
- */
- /**
- * This test will create a Mime Message that in return contains another
- * mime message. The nested mime message contains an attachment.
- *
- * The root message consist of both HTML and Text message.
- *
- *//*
-
- @Test
- public void testProcessingOfNestedEmailAttachments() {
-
- final JavaMailSenderImpl mailSender = new JavaMailSenderImpl();
- mailSender.setPort(this.wiserPort);
-
- final MimeMessage rootMessage = mailSender.createMimeMessage();
-
- try {
-
- final MimeMessageHelper messageHelper = new MimeMessageHelper(rootMessage, true);
-
- messageHelper.setFrom("testfrom@springintegration.org");
- messageHelper.setTo("testto@springintegration.org");
- messageHelper.setSubject("Parsing of Attachments");
- messageHelper.setText("Spring Integration Rocks!", "Spring Integration Rocks!");
-
- final String pictureName = "picture.png";
-
- final ByteArrayResource byteArrayResource = getFileData(pictureName);
-
- messageHelper.addInline("picture12345", byteArrayResource, "image/png");
-
- }
- catch (MessagingException e) {
- throw new MailParseException(e);
- }
-
- mailSender.send(rootMessage);
-
- final List wiserMessages = wiser.getMessages();
-
- Assert.assertTrue(wiserMessages.size() == 1);
-
- boolean foundTextMessage = false;
- boolean foundPicture = false;
- boolean foundHtmlMessage = false;
-
- for (WiserMessage wiserMessage : wiserMessages) {
-
- List emailFragments = new ArrayList<>();
-
- try {
-
- final MimeMessage mailMessage = wiserMessage.getMimeMessage();
- EmailParserUtils.handleMessage(null, mailMessage, emailFragments);
-
- } catch (MessagingException e) {
- throw new IllegalStateException("Error while retrieving Mime Message.");
- }
-
- Assert.assertTrue(emailFragments.size() == 3);
-
- for (EmailFragment emailFragment : emailFragments) {
- if ("".equals(emailFragment.getFilename())) {
- foundPicture = true;
- }
-
- if ("message.txt".equals(emailFragment.getFilename())) {
- foundTextMessage = true;
- }
-
- if ("message.html".equals(emailFragment.getFilename())) {
- foundHtmlMessage = true;
- }
- }
-
- Assert.assertTrue(foundPicture);
- Assert.assertTrue(foundTextMessage);
- Assert.assertTrue(foundHtmlMessage);
-
- }
- }
-
- private ByteArrayResource getFileData(String filename) {
-
- final InputStream attachmentInputStream = MimeMessageParsingTest.class.getResourceAsStream(filename);
-
- Assert.assertNotNull("Resource not found: " + filename, attachmentInputStream);
-
- ByteArrayResource byteArrayResource = null;
-
- try {
- byteArrayResource = new ByteArrayResource(IOUtils.toByteArray(attachmentInputStream));
- attachmentInputStream.close();
- }
- catch (IOException e1) {
- Assert.fail();
- }
-
- return byteArrayResource;
-
- }
-
- @After
- public void stopWiser() {
- wiser.stop();
- LOGGER.info("Wiser stopped.");
- }
-*/
-
-}
diff --git a/intermediate/monitoring/pom.xml b/intermediate/monitoring/pom.xml
index 78e24ab7..a66d0a2d 100644
--- a/intermediate/monitoring/pom.xml
+++ b/intermediate/monitoring/pom.xml
@@ -180,14 +180,14 @@
org.springframework
spring-framework-bom
- 6.0.0-M2
+ 6.0.0-M3
import
pom
org.springframework.integration
spring-integration-bom
- 6.0.0-M1
+ 6.0.0-M2
import
pom
diff --git a/intermediate/multipart-http/pom.xml b/intermediate/multipart-http/pom.xml
index af38e3ff..ee19baad 100644
--- a/intermediate/multipart-http/pom.xml
+++ b/intermediate/multipart-http/pom.xml
@@ -180,14 +180,14 @@
org.springframework
spring-framework-bom
- 6.0.0-M2
+ 6.0.0-M3
import
pom
org.springframework.integration
spring-integration-bom
- 6.0.0-M1
+ 6.0.0-M2
import
pom
diff --git a/intermediate/rest-http/pom.xml b/intermediate/rest-http/pom.xml
index ad3c73ce..5914fa71 100644
--- a/intermediate/rest-http/pom.xml
+++ b/intermediate/rest-http/pom.xml
@@ -95,13 +95,13 @@
org.springframework.security
spring-security-web
- 6.0.0-M1
+ 6.0.0-M2
compile
org.springframework.security
spring-security-config
- 6.0.0-M1
+ 6.0.0-M2
compile
@@ -211,14 +211,14 @@
org.springframework
spring-framework-bom
- 6.0.0-M2
+ 6.0.0-M3
import
pom
org.springframework.integration
spring-integration-bom
- 6.0.0-M1
+ 6.0.0-M2
import
pom
diff --git a/intermediate/retry-and-more/pom.xml b/intermediate/retry-and-more/pom.xml
index cb8c5de5..bd7832ad 100644
--- a/intermediate/retry-and-more/pom.xml
+++ b/intermediate/retry-and-more/pom.xml
@@ -159,14 +159,14 @@
org.springframework
spring-framework-bom
- 6.0.0-M2
+ 6.0.0-M3
import
pom
org.springframework.integration
spring-integration-bom
- 6.0.0-M1
+ 6.0.0-M2
import
pom
diff --git a/intermediate/splitter-aggregator-reaper/pom.xml b/intermediate/splitter-aggregator-reaper/pom.xml
index fc5a7696..60eb6a39 100644
--- a/intermediate/splitter-aggregator-reaper/pom.xml
+++ b/intermediate/splitter-aggregator-reaper/pom.xml
@@ -126,14 +126,14 @@
org.springframework
spring-framework-bom
- 6.0.0-M2
+ 6.0.0-M3
import
pom
org.springframework.integration
spring-integration-bom
- 6.0.0-M1
+ 6.0.0-M2
import
pom
diff --git a/intermediate/stored-procedures-derby/pom.xml b/intermediate/stored-procedures-derby/pom.xml
index b902e2d3..32f6f76b 100644
--- a/intermediate/stored-procedures-derby/pom.xml
+++ b/intermediate/stored-procedures-derby/pom.xml
@@ -132,14 +132,14 @@
org.springframework
spring-framework-bom
- 6.0.0-M2
+ 6.0.0-M3
import
pom
org.springframework.integration
spring-integration-bom
- 6.0.0-M1
+ 6.0.0-M2
import
pom
diff --git a/intermediate/stored-procedures-ms/pom.xml b/intermediate/stored-procedures-ms/pom.xml
index 555c100e..8e199c59 100644
--- a/intermediate/stored-procedures-ms/pom.xml
+++ b/intermediate/stored-procedures-ms/pom.xml
@@ -138,14 +138,14 @@
org.springframework
spring-framework-bom
- 6.0.0-M2
+ 6.0.0-M3
import
pom
org.springframework.integration
spring-integration-bom
- 6.0.0-M1
+ 6.0.0-M2
import
pom
diff --git a/intermediate/stored-procedures-oracle/pom.xml b/intermediate/stored-procedures-oracle/pom.xml
index 5c828dcd..7cc66717 100644
--- a/intermediate/stored-procedures-oracle/pom.xml
+++ b/intermediate/stored-procedures-oracle/pom.xml
@@ -132,14 +132,14 @@
org.springframework
spring-framework-bom
- 6.0.0-M2
+ 6.0.0-M3
import
pom
org.springframework.integration
spring-integration-bom
- 6.0.0-M1
+ 6.0.0-M2
import
pom
diff --git a/intermediate/stored-procedures-postgresql/pom.xml b/intermediate/stored-procedures-postgresql/pom.xml
index 9fe8c1bb..c683150f 100644
--- a/intermediate/stored-procedures-postgresql/pom.xml
+++ b/intermediate/stored-procedures-postgresql/pom.xml
@@ -144,14 +144,14 @@
org.springframework
spring-framework-bom
- 6.0.0-M2
+ 6.0.0-M3
import
pom
org.springframework.integration
spring-integration-bom
- 6.0.0-M1
+ 6.0.0-M2
import
pom
diff --git a/intermediate/tcp-async-bi-directional/pom.xml b/intermediate/tcp-async-bi-directional/pom.xml
index 0fa7add7..53007fc9 100644
--- a/intermediate/tcp-async-bi-directional/pom.xml
+++ b/intermediate/tcp-async-bi-directional/pom.xml
@@ -138,14 +138,14 @@
org.springframework
spring-framework-bom
- 6.0.0-M2
+ 6.0.0-M3
import
pom
org.springframework.integration
spring-integration-bom
- 6.0.0-M1
+ 6.0.0-M2
import
pom
diff --git a/intermediate/tcp-async-bi-directional/src/test/java/org/springframework/integration/samples/tcpasyncbi/TcpAsyncBiDirectionalApplicationTests.java b/intermediate/tcp-async-bi-directional/src/test/java/org/springframework/integration/samples/tcpasyncbi/TcpAsyncBiDirectionalApplicationTests.java
index 7dea9340..d6a50af1 100644
--- a/intermediate/tcp-async-bi-directional/src/test/java/org/springframework/integration/samples/tcpasyncbi/TcpAsyncBiDirectionalApplicationTests.java
+++ b/intermediate/tcp-async-bi-directional/src/test/java/org/springframework/integration/samples/tcpasyncbi/TcpAsyncBiDirectionalApplicationTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2020 the original author or authors.
+ * Copyright 2020-2022 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.
@@ -33,9 +33,11 @@ import org.springframework.lang.Nullable;
import org.springframework.messaging.Message;
import org.springframework.messaging.MessageChannel;
import org.springframework.messaging.support.ChannelInterceptor;
+import org.springframework.test.annotation.DirtiesContext;
@SpringBootTest
@SpringIntegrationTest(noAutoStartup = { "client1Adapter", "client2Adapter" })
+@DirtiesContext
class TcpAsyncBiDirectionalApplicationTests {
@Autowired
diff --git a/intermediate/tcp-client-server-multiplex/pom.xml b/intermediate/tcp-client-server-multiplex/pom.xml
index 083bb552..057807b0 100644
--- a/intermediate/tcp-client-server-multiplex/pom.xml
+++ b/intermediate/tcp-client-server-multiplex/pom.xml
@@ -126,14 +126,14 @@
org.springframework
spring-framework-bom
- 6.0.0-M2
+ 6.0.0-M3
import
pom
org.springframework.integration
spring-integration-bom
- 6.0.0-M1
+ 6.0.0-M2
import
pom
diff --git a/intermediate/tcp-client-server-multiplex/src/main/resources/META-INF/spring/integration/tcpClientServerDemo-conversion-context.xml b/intermediate/tcp-client-server-multiplex/src/main/resources/META-INF/spring/integration/tcpClientServerDemo-conversion-context.xml
index 13af8dc7..251c5920 100644
--- a/intermediate/tcp-client-server-multiplex/src/main/resources/META-INF/spring/integration/tcpClientServerDemo-conversion-context.xml
+++ b/intermediate/tcp-client-server-multiplex/src/main/resources/META-INF/spring/integration/tcpClientServerDemo-conversion-context.xml
@@ -36,7 +36,7 @@
+
@@ -84,7 +86,7 @@
diff --git a/intermediate/tcp-client-server-multiplex/src/test/java/org/springframework/integration/samples/tcpclientserver/TcpClientServerDemoTest.java b/intermediate/tcp-client-server-multiplex/src/test/java/org/springframework/integration/samples/tcpclientserver/TcpClientServerDemoTest.java
index 503fab31..8559d0d1 100644
--- a/intermediate/tcp-client-server-multiplex/src/test/java/org/springframework/integration/samples/tcpclientserver/TcpClientServerDemoTest.java
+++ b/intermediate/tcp-client-server-multiplex/src/test/java/org/springframework/integration/samples/tcpclientserver/TcpClientServerDemoTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2018 the original author or authors.
+ * Copyright 2002-2022 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.
@@ -16,31 +16,28 @@
package org.springframework.integration.samples.tcpclientserver;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.containsString;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.core.task.SimpleAsyncTaskExecutor;
import org.springframework.core.task.TaskExecutor;
+import org.springframework.integration.endpoint.AbstractEndpoint;
+import org.springframework.integration.ip.tcp.connection.AbstractClientConnectionFactory;
import org.springframework.integration.ip.tcp.connection.AbstractServerConnectionFactory;
import org.springframework.integration.ip.util.TestingUtilities;
-import org.springframework.integration.samples.tcpclientserver.support.CustomTestContextLoader;
import org.springframework.messaging.MessagingException;
import org.springframework.test.annotation.DirtiesContext;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
/**
@@ -56,9 +53,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
* @since 2.1
*
*/
-@ContextConfiguration(loader = CustomTestContextLoader.class,
- locations = { "/META-INF/spring/integration/tcpClientServerDemo-conversion-context.xml" })
-@RunWith(SpringJUnit4ClassRunner.class)
+@SpringJUnitConfig(locations = "/META-INF/spring/integration/tcpClientServerDemo-conversion-context.xml")
@DirtiesContext
public class TcpClientServerDemoTest {
@@ -68,15 +63,31 @@ public class TcpClientServerDemoTest {
@Autowired
AbstractServerConnectionFactory crLfServer;
- @Before
+ @Autowired
+ AbstractClientConnectionFactory client;
+
+ @Autowired
+ @Qualifier("outAdapter.client")
+ AbstractEndpoint outAdapterClient;
+
+ @Autowired
+ @Qualifier("inAdapter.client")
+ AbstractEndpoint inAdapterClient;
+
+ @BeforeEach
public void setup() {
- TestingUtilities.waitListening(this.crLfServer, 10000L);
+ if (!this.outAdapterClient.isRunning()) {
+ TestingUtilities.waitListening(this.crLfServer, 10000L);
+ this.client.setPort(this.crLfServer.getPort());
+ this.outAdapterClient.start();
+ this.inAdapterClient.start();
+ }
}
@Test
public void testHappyDay() {
String result = gw.send("999Hello world!"); // first 3 bytes is correlationid
- assertEquals("999Hello world!:echo", result);
+ assertThat(result).isEqualTo("999Hello world!:echo");
}
@Test
@@ -88,36 +99,28 @@ public class TcpClientServerDemoTest {
results.add(i);
final int j = i;
executor.execute(() -> {
- String result = gw.send(j + "Hello world!"); // first 3 bytes is correlationid
- assertEquals(j + "Hello world!:echo", result);
+ String result = gw.send(j + "Hello world!"); // first 3 bytes is correlationId
+ assertThat(result).isEqualTo(j + "Hello world!:echo");
results.remove(j);
latch.countDown();
});
}
- assertTrue(latch.await(60, TimeUnit.SECONDS));
- assertEquals(0, results.size());
+ assertThat(latch.await(60, TimeUnit.SECONDS)).isTrue();
+ assertThat(results).hasSize(0);
}
@Test
public void testTimeoutThrow() {
- try {
- gw.send("TIMEOUT_TEST_THROW");
- fail("expected exception");
- }
- catch (MessagingException e) {
- assertThat(e.getMessage(), containsString("No response received for TIMEOUT_TEST"));
- }
+ assertThatExceptionOfType(MessagingException.class)
+ .isThrownBy(() -> gw.send("TIMEOUT_TEST_THROW"))
+ .withMessageContaining("No response received for TIMEOUT_TEST");
}
@Test
public void testTimeoutReturn() {
- try {
- gw.send("TIMEOUT_TEST_RETURN");
- fail("expected exception");
- }
- catch (MessagingException e) {
- assertThat(e.getMessage(), containsString("No response received for TIMEOUT_TEST"));
- }
+ assertThatExceptionOfType(MessagingException.class)
+ .isThrownBy(() -> gw.send("TIMEOUT_TEST_RETURN"))
+ .withMessageContaining("No response received for TIMEOUT_TEST");
}
}
diff --git a/intermediate/tcp-client-server-multiplex/src/test/java/org/springframework/integration/samples/tcpclientserver/support/CustomTestContextLoader.java b/intermediate/tcp-client-server-multiplex/src/test/java/org/springframework/integration/samples/tcpclientserver/support/CustomTestContextLoader.java
deleted file mode 100644
index f952646b..00000000
--- a/intermediate/tcp-client-server-multiplex/src/test/java/org/springframework/integration/samples/tcpclientserver/support/CustomTestContextLoader.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright 2002-2017 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.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT 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.springframework.integration.samples.tcpclientserver.support;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import org.springframework.context.support.GenericApplicationContext;
-import org.springframework.core.env.MapPropertySource;
-import org.springframework.util.SocketUtils;
-import org.springframework.test.context.MergedContextConfiguration;
-import org.springframework.test.context.support.GenericXmlContextLoader;
-
-/**
- *
- * @author Gunnar Hillert
- * @author Gary Russell
- * @author Artem Bilan
- *
- */
-public class CustomTestContextLoader extends GenericXmlContextLoader {
-
- private static final Log LOGGER = LogFactory.getLog(CustomTestContextLoader.class);
-
- @Override
- protected void loadBeanDefinitions(GenericApplicationContext context,
- MergedContextConfiguration mergedConfig) {
-
- int availableServerSocket = SocketUtils.findAvailableTcpPort(5678);
-
- final Map sockets = new HashMap();
- sockets.put("availableServerSocket", availableServerSocket);
-
- if (LOGGER.isInfoEnabled()) {
- LOGGER.info("Available Server Socket: " + availableServerSocket);
- }
-
- final MapPropertySource propertySource = new MapPropertySource("sockets", sockets);
-
- context.getEnvironment().getPropertySources().addLast(propertySource);
- super.loadBeanDefinitions(context, mergedConfig);
- }
-
-}
diff --git a/intermediate/testcontainers-rabbitmq/pom.xml b/intermediate/testcontainers-rabbitmq/pom.xml
index 6710c65a..c9e3a51b 100644
--- a/intermediate/testcontainers-rabbitmq/pom.xml
+++ b/intermediate/testcontainers-rabbitmq/pom.xml
@@ -172,14 +172,14 @@
org.springframework
spring-framework-bom
- 6.0.0-M2
+ 6.0.0-M3
import
pom
org.springframework.integration
spring-integration-bom
- 6.0.0-M1
+ 6.0.0-M2
import
pom
diff --git a/intermediate/travel/pom.xml b/intermediate/travel/pom.xml
index 0d7e20f6..01ec885e 100644
--- a/intermediate/travel/pom.xml
+++ b/intermediate/travel/pom.xml
@@ -136,14 +136,14 @@
org.springframework
spring-framework-bom
- 6.0.0-M2
+ 6.0.0-M3
import
pom
org.springframework.integration
spring-integration-bom
- 6.0.0-M1
+ 6.0.0-M2
import
pom
diff --git a/intermediate/tx-synch/pom.xml b/intermediate/tx-synch/pom.xml
index 750d8ff6..c26510b9 100644
--- a/intermediate/tx-synch/pom.xml
+++ b/intermediate/tx-synch/pom.xml
@@ -137,14 +137,14 @@
org.springframework
spring-framework-bom
- 6.0.0-M2
+ 6.0.0-M3
import
pom
org.springframework.integration
spring-integration-bom
- 6.0.0-M1
+ 6.0.0-M2
import
pom