Upgrade dependencies including Gradle
* Fix compatibility with upgraded dependencies * Move `What's New` for `5.4` to `history` * Add `XmlUnit` dependency since the latest AssertJ has deprecated its `isXmlEqualTo()` * Remove `javax.annotation-api` and `apiguardian-api` as redundant dependencies
This commit is contained in:
62
build.gradle
62
build.gradle
@@ -1,6 +1,7 @@
|
||||
buildscript {
|
||||
ext.kotlinVersion = '1.4.10'
|
||||
ext.kotlinVersion = '1.4.20'
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven { url 'https://repo.spring.io/plugins-release' }
|
||||
}
|
||||
dependencies {
|
||||
@@ -14,7 +15,7 @@ plugins {
|
||||
id 'io.spring.nohttp' version '0.0.5.RELEASE' apply false
|
||||
id 'org.ajoberstar.grgit' version '4.1.0'
|
||||
id "io.spring.dependency-management" version '1.0.10.RELEASE'
|
||||
id 'com.jfrog.artifactory' version '4.18.0' apply false
|
||||
id 'com.jfrog.artifactory' version '4.18.2' apply false
|
||||
id 'org.jetbrains.dokka' version '0.10.1'
|
||||
id 'org.asciidoctor.jvm.pdf' version '3.3.0'
|
||||
id 'org.asciidoctor.jvm.gems' version '3.3.0'
|
||||
@@ -48,31 +49,30 @@ ext {
|
||||
activeMqVersion = '5.16.0'
|
||||
apacheSshdVersion = '2.5.1'
|
||||
aspectjVersion = '1.9.6'
|
||||
assertjVersion = '3.17.2'
|
||||
assertjVersion = '3.18.1'
|
||||
assertkVersion = '0.23'
|
||||
avroVersion = '1.10.0'
|
||||
awaitilityVersion = '4.0.3'
|
||||
commonsDbcp2Version = '2.8.0'
|
||||
commonsIoVersion = '2.8.0'
|
||||
commonsNetVersion = '3.7'
|
||||
commonsNetVersion = '3.7.2'
|
||||
curatorVersion = '4.3.0'
|
||||
derbyVersion = '10.14.2.0'
|
||||
ftpServerVersion = '1.1.1'
|
||||
googleJsr305Version = '3.0.2'
|
||||
groovyVersion = '3.0.6'
|
||||
hamcrestVersion = '2.2'
|
||||
hazelcastVersion = '4.0.3'
|
||||
hibernateVersion = '5.4.23.Final'
|
||||
hazelcastVersion = '4.1'
|
||||
hibernateVersion = '5.4.25.Final'
|
||||
hsqldbVersion = '2.5.1'
|
||||
h2Version = '1.4.200'
|
||||
jacksonVersion = '2.11.3'
|
||||
jacksonVersion = '2.12.0'
|
||||
javaxActivationVersion = '1.2.0'
|
||||
javaxAnnotationVersion= '1.3.2'
|
||||
jaxbVersion = '2.3.3'
|
||||
jeroMqVersion = '0.5.2'
|
||||
jmsApiVersion = '2.0.1'
|
||||
jpa21ApiVersion = '1.0.2.Final'
|
||||
jpaApiVersion = '2.2.1'
|
||||
jpaApiVersion = '2.7.7'
|
||||
jrubyVersion = '9.2.13.0'
|
||||
jschVersion = '0.1.55'
|
||||
jsonpathVersion = '2.4.0'
|
||||
@@ -81,13 +81,13 @@ ext {
|
||||
jythonVersion = '2.7.2'
|
||||
kryoShadedVersion = '4.0.2'
|
||||
lettuceVersion = '6.0.1.RELEASE'
|
||||
log4jVersion = '2.13.3'
|
||||
log4jVersion = '2.14.0'
|
||||
mailVersion = '1.6.5'
|
||||
micrometerVersion = '1.5.7'
|
||||
mockitoVersion = '3.6.0'
|
||||
mongoDriverVersion = '4.1.1'
|
||||
micrometerVersion = '1.6.1'
|
||||
mockitoVersion = '3.6.28'
|
||||
mongoDriverVersion = '4.2.0-beta1'
|
||||
mysqlVersion = '8.0.22'
|
||||
pahoMqttClientVersion = '1.2.4'
|
||||
pahoMqttClientVersion = '1.2.5'
|
||||
postgresVersion = '42.2.18'
|
||||
r2dbch2Version='0.8.4.RELEASE'
|
||||
reactorVersion = '2020.0.1'
|
||||
@@ -99,14 +99,15 @@ ext {
|
||||
smackVersion = '4.3.5'
|
||||
soapVersion = '1.4.0'
|
||||
springAmqpVersion = project.hasProperty('springAmqpVersion') ? project.springAmqpVersion : '2.3.1'
|
||||
springDataVersion = project.hasProperty('springDataVersion') ? project.springDataVersion : '2020.0.1'
|
||||
springKafkaVersion = '2.6.3'
|
||||
springDataVersion = project.hasProperty('springDataVersion') ? project.springDataVersion : '2021.0.0-SNAPSHOT'
|
||||
springKafkaVersion = '2.7.0-SNAPSHOT'
|
||||
springRetryVersion = '1.3.0'
|
||||
springSecurityVersion = project.hasProperty('springSecurityVersion') ? project.springSecurityVersion : '5.4.1'
|
||||
springSecurityVersion = project.hasProperty('springSecurityVersion') ? project.springSecurityVersion : '5.5.0-SNAPSHOT'
|
||||
springVersion = project.hasProperty('springVersion') ? project.springVersion : '5.3.1'
|
||||
springWsVersion = '3.0.10.RELEASE'
|
||||
tomcatVersion = "9.0.39"
|
||||
xstreamVersion = '1.4.13'
|
||||
springWsVersion = '3.1.0-SNAPSHOT'
|
||||
tomcatVersion = "9.0.40"
|
||||
xmlUnitVersion = '2.8.1'
|
||||
xstreamVersion = '1.4.14'
|
||||
|
||||
javaProjects = subprojects - project(':spring-integration-bom')
|
||||
}
|
||||
@@ -124,6 +125,8 @@ allprojects {
|
||||
maven { url 'https://repo.spring.io/libs-snapshot' }
|
||||
}
|
||||
// maven { url 'https://repo.spring.io/libs-staging-local' }
|
||||
|
||||
maven { url 'https://repository.apache.org/content/groups/staging/' } // Kafka Client
|
||||
}
|
||||
|
||||
ext.javadocLinks = [
|
||||
@@ -196,6 +199,10 @@ configure(javaProjects) { subproject ->
|
||||
targetCompatibility = 1.8
|
||||
}
|
||||
|
||||
compileTestJava {
|
||||
sourceCompatibility = 11
|
||||
}
|
||||
|
||||
compileKotlin {
|
||||
kotlinOptions {
|
||||
jvmTarget = '1.8'
|
||||
@@ -203,7 +210,7 @@ configure(javaProjects) { subproject ->
|
||||
}
|
||||
compileTestKotlin {
|
||||
kotlinOptions {
|
||||
jvmTarget = '1.8'
|
||||
jvmTarget = '11'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -237,10 +244,6 @@ configure(javaProjects) { subproject ->
|
||||
testImplementation 'io.projectreactor:reactor-test'
|
||||
testImplementation "com.jayway.jsonpath:json-path:$jsonpathVersion"
|
||||
testImplementation 'com.fasterxml.jackson.core:jackson-databind'
|
||||
testImplementation "javax.annotation:javax.annotation-api:$javaxAnnotationVersion"
|
||||
|
||||
// To avoid compiler warnings about @API annotations in JUnit code
|
||||
testCompileOnly 'org.apiguardian:apiguardian-api:1.0.0'
|
||||
|
||||
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
|
||||
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
|
||||
@@ -325,7 +328,7 @@ configure(javaProjects) { subproject ->
|
||||
|
||||
checkstyle {
|
||||
configDirectory.set(rootProject.file("src/checkstyle"))
|
||||
toolVersion = project.hasProperty('checkstyleVersion') ? project.checkstyleVersion : '8.37'
|
||||
toolVersion = project.hasProperty('checkstyleVersion') ? project.checkstyleVersion : '8.38'
|
||||
}
|
||||
|
||||
jar {
|
||||
@@ -581,7 +584,7 @@ project('spring-integration-jpa') {
|
||||
dependencies {
|
||||
api project(':spring-integration-core')
|
||||
api 'org.springframework:spring-orm'
|
||||
optionalApi "org.eclipse.persistence:javax.persistence:$jpaApiVersion"
|
||||
optionalApi "org.eclipse.persistence:org.eclipse.persistence.jpa:$jpaApiVersion"
|
||||
|
||||
testImplementation ('org.springframework.data:spring-data-jpa') {
|
||||
exclude group: 'org.springframework'
|
||||
@@ -589,7 +592,7 @@ project('spring-integration-jpa') {
|
||||
testImplementation "com.h2database:h2:$h2Version"
|
||||
testImplementation "org.hibernate:hibernate-entitymanager:$hibernateVersion"
|
||||
|
||||
testRuntimeOnly "org.hibernate.javax.persistence:hibernate-jpa-2.1-api:$jpa21ApiVersion"
|
||||
// testRuntimeOnly "org.hibernate.javax.persistence:hibernate-jpa-2.1-api:$jpa21ApiVersion"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -723,7 +726,7 @@ project('spring-integration-sftp') {
|
||||
api project(':spring-integration-file')
|
||||
api "com.jcraft:jsch:$jschVersion"
|
||||
api 'org.springframework:spring-context-support'
|
||||
optionalApi "javax.activation:javax.activation-api:$javaxActivationVersion"
|
||||
// optionalApi "javax.activation:javax.activation-api:$javaxActivationVersion"
|
||||
optionalApi "org.apache.sshd:sshd-sftp:$apacheSshdVersion"
|
||||
|
||||
testImplementation "org.apache.sshd:sshd-core:$apacheSshdVersion"
|
||||
@@ -848,6 +851,7 @@ project('spring-integration-xml') {
|
||||
}
|
||||
|
||||
testImplementation "com.sun.xml.bind:jaxb-impl:$jaxbVersion"
|
||||
testImplementation "org.xmlunit:xmlunit-assertj3:$xmlUnitVersion"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
@@ -27,8 +27,6 @@ import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -105,7 +103,7 @@ public class MessagingAnnotationsWithBeanAnnotationTests {
|
||||
@Autowired
|
||||
private PollableChannel discardChannel;
|
||||
|
||||
@Resource(name = "collector")
|
||||
@Autowired
|
||||
private List<Message<?>> collector;
|
||||
|
||||
@Autowired(required = false)
|
||||
|
||||
@@ -229,26 +229,12 @@ public class KafkaMessageListenerContainerSpec<K, V>
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set whether the container should ack messages that throw exceptions or not.
|
||||
* @param ackOnError whether the container should acknowledge messages that throw
|
||||
* exceptions.
|
||||
* @return the spec.
|
||||
* @deprecated in favor of {@code GenericErrorHandler.isAckAfterHandle()}.
|
||||
* @see ContainerProperties#setAckOnError(boolean)
|
||||
*/
|
||||
@Deprecated
|
||||
public KafkaMessageListenerContainerSpec<K, V> ackOnError(boolean ackOnError) {
|
||||
this.target.getContainerProperties().setAckOnError(ackOnError);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the group id for this container. Overrides any {@code group.id} property
|
||||
* provided by the consumer factory configuration.
|
||||
* @param groupId the group id.
|
||||
* @return the spec.
|
||||
* @see ContainerProperties#setAckOnError(boolean)
|
||||
* @see ContainerProperties#setGroupId(String)
|
||||
*/
|
||||
public KafkaMessageListenerContainerSpec<K, V> groupId(String groupId) {
|
||||
this.target.getContainerProperties().setGroupId(groupId);
|
||||
|
||||
@@ -25,8 +25,6 @@ import java.security.Principal;
|
||||
import java.time.Duration;
|
||||
import java.util.Collections;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.hamcrest.Matchers;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
@@ -120,7 +118,8 @@ public class WebFluxDslTests {
|
||||
@Qualifier("webFluxWithReplyPayloadToFlux.handler")
|
||||
private WebFluxRequestExecutingMessageHandler webFluxWithReplyPayloadToFlux;
|
||||
|
||||
@Resource(name = "httpReactiveProxyFlow.webflux:outbound-gateway#0")
|
||||
@Autowired
|
||||
@Qualifier("httpReactiveProxyFlow.webflux:outbound-gateway#0")
|
||||
private WebFluxRequestExecutingMessageHandler httpReactiveProxyFlow;
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2020 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,8 +16,8 @@
|
||||
|
||||
package org.springframework.integration.xml;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||
import static org.xmlunit.assertj3.XmlAssert.assertThat;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@@ -30,15 +30,14 @@ import javax.xml.transform.dom.DOMSource;
|
||||
import javax.xml.transform.sax.SAXSource;
|
||||
import javax.xml.transform.stream.StreamSource;
|
||||
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Node;
|
||||
import org.w3c.dom.NodeList;
|
||||
import org.xml.sax.InputSource;
|
||||
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
import org.springframework.integration.xml.util.XmlTestUtil;
|
||||
import org.springframework.messaging.MessagingException;
|
||||
|
||||
/**
|
||||
@@ -56,7 +55,7 @@ public class DefaultXmlPayloadConverterTests {
|
||||
|
||||
private static Document testDocument;
|
||||
|
||||
@BeforeClass
|
||||
@BeforeAll
|
||||
public static void setUp() throws Exception {
|
||||
testDocument =
|
||||
DocumentBuilderFactory.newInstance()
|
||||
@@ -65,9 +64,9 @@ public class DefaultXmlPayloadConverterTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetDocumentWithString() throws Exception {
|
||||
public void testGetDocumentWithString() {
|
||||
Document doc = converter.convertToDocument(TEST_DOCUMENT_AS_STRING);
|
||||
assertThat(XmlTestUtil.docToString(doc)).isXmlEqualTo(TEST_DOCUMENT_AS_STRING);
|
||||
assertThat(doc).and(TEST_DOCUMENT_AS_STRING).areIdentical();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -84,15 +83,15 @@ public class DefaultXmlPayloadConverterTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetNodePassingString() throws Exception {
|
||||
public void testGetNodePassingString() {
|
||||
Node n = converter.convertToNode(TEST_DOCUMENT_AS_STRING);
|
||||
assertThat(XmlTestUtil.docToString((Document) n)).isXmlEqualTo(TEST_DOCUMENT_AS_STRING);
|
||||
assertThat(n).and(TEST_DOCUMENT_AS_STRING).areIdentical();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetNodePassingDocument() throws Exception {
|
||||
Node n = converter.convertToNode(testDocument);
|
||||
assertThat(XmlTestUtil.docToString((Document) n)).isXmlEqualTo(TEST_DOCUMENT_AS_STRING);
|
||||
assertThat(n).and(TEST_DOCUMENT_AS_STRING).areIdentical();
|
||||
}
|
||||
|
||||
|
||||
@@ -152,14 +151,14 @@ public class DefaultXmlPayloadConverterTests {
|
||||
@Test
|
||||
public void testConvertBytesToDocument() throws Exception {
|
||||
Document doc = converter.convertToDocument(TEST_DOCUMENT_AS_STRING.getBytes());
|
||||
assertThat(XmlTestUtil.docToString(doc)).isXmlEqualTo(TEST_DOCUMENT_AS_STRING);
|
||||
assertThat(doc).and(TEST_DOCUMENT_AS_STRING).areIdentical();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testConvertFileToDocument() throws Exception {
|
||||
File file = new ClassPathResource("org/springframework/integration/xml/customSource.data").getFile();
|
||||
Document doc = converter.convertToDocument(file);
|
||||
assertThat(XmlTestUtil.docToString(doc)).isXmlEqualTo(TEST_DOCUMENT_AS_STRING);
|
||||
assertThat(doc).and(TEST_DOCUMENT_AS_STRING).areSimilar();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -167,7 +166,7 @@ public class DefaultXmlPayloadConverterTests {
|
||||
InputStream inputStream = new ClassPathResource("org/springframework/integration/xml/customSource.data")
|
||||
.getInputStream();
|
||||
Document doc = converter.convertToDocument(inputStream);
|
||||
assertThat(XmlTestUtil.docToString(doc)).isXmlEqualTo(TEST_DOCUMENT_AS_STRING);
|
||||
assertThat(doc).and(TEST_DOCUMENT_AS_STRING).areSimilar();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -175,13 +174,13 @@ public class DefaultXmlPayloadConverterTests {
|
||||
ClassPathResource resource = new ClassPathResource("org/springframework/integration/xml/customSource.data");
|
||||
StreamSource source = new StreamSource(resource.getInputStream());
|
||||
Document doc = converter.convertToDocument(source);
|
||||
assertThat(XmlTestUtil.docToString(doc)).isXmlEqualTo(TEST_DOCUMENT_AS_STRING);
|
||||
assertThat(doc).and(TEST_DOCUMENT_AS_STRING).areSimilar();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testConvertCustomSourceToDocument() throws Exception {
|
||||
public void testConvertCustomSourceToDocument() {
|
||||
Document doc = converter.convertToDocument(new MySource());
|
||||
assertThat(XmlTestUtil.docToString(doc)).isXmlEqualTo(TEST_DOCUMENT_AS_STRING);
|
||||
assertThat(doc).and(TEST_DOCUMENT_AS_STRING).areSimilar();
|
||||
}
|
||||
|
||||
private static class MySource implements Source {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2020 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,19 +16,17 @@
|
||||
|
||||
package org.springframework.integration.xml.source;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||
import static org.xmlunit.assertj3.XmlAssert.assertThat;
|
||||
|
||||
import java.io.StringReader;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.transform.Source;
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
import javax.xml.transform.dom.DOMSource;
|
||||
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.w3c.dom.Document;
|
||||
import org.xml.sax.InputSource;
|
||||
|
||||
@@ -47,13 +45,10 @@ public class DomSourceFactoryTests {
|
||||
|
||||
private static Document doc;
|
||||
|
||||
private static Transformer transformer;
|
||||
|
||||
@BeforeClass
|
||||
@BeforeAll
|
||||
public static void setUp() throws Exception {
|
||||
StringReader reader = new StringReader(docContent);
|
||||
doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new InputSource(reader));
|
||||
transformer = TransformerFactory.newInstance().newTransformer();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -61,7 +56,7 @@ public class DomSourceFactoryTests {
|
||||
Source source = sourceFactory.createSource(doc);
|
||||
assertThat(source).isNotNull();
|
||||
assertThat(source).isInstanceOf(DOMSource.class);
|
||||
assertThat(XmlTestUtil.sourceToString(source)).isXmlEqualTo(docContent);
|
||||
assertThat(XmlTestUtil.sourceToString(source)).and(docContent).areIdentical();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -69,7 +64,7 @@ public class DomSourceFactoryTests {
|
||||
Source source = sourceFactory.createSource(docContent);
|
||||
assertThat(source).isNotNull();
|
||||
assertThat(source).isInstanceOf(DOMSource.class);
|
||||
assertThat(XmlTestUtil.sourceToString(source)).isXmlEqualTo(docContent);
|
||||
assertThat(XmlTestUtil.sourceToString(source)).and(docContent).areIdentical();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2020 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,12 +16,12 @@
|
||||
|
||||
package org.springframework.integration.xml.source;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||
import static org.xmlunit.assertj3.XmlAssert.assertThat;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.w3c.dom.Document;
|
||||
|
||||
import org.springframework.integration.xml.util.XmlTestUtil;
|
||||
@@ -46,7 +46,7 @@ public class StringSourceTests {
|
||||
BufferedReader reader = new BufferedReader(source.getReader());
|
||||
String docAsString = reader.readLine();
|
||||
|
||||
assertThat(docAsString).isXmlEqualTo(docString);
|
||||
assertThat(docAsString).and(docString).areIdentical();
|
||||
}
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ public class StringSourceTests {
|
||||
BufferedReader reader = new BufferedReader(source.getReader());
|
||||
String docAsString = reader.readLine();
|
||||
|
||||
assertThat(docAsString).isXmlEqualTo(docString);
|
||||
assertThat(docAsString).and(docString).areIdentical();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2020 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,8 +16,8 @@
|
||||
|
||||
package org.springframework.integration.xml.transformer;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||
import static org.xmlunit.assertj3.XmlAssert.assertThat;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
@@ -25,8 +25,8 @@ import javax.xml.transform.OutputKeys;
|
||||
import javax.xml.transform.dom.DOMResult;
|
||||
import javax.xml.transform.sax.SAXResult;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.integration.xml.util.XmlTestUtil;
|
||||
import org.springframework.messaging.MessagingException;
|
||||
@@ -42,21 +42,21 @@ public class ResultToStringTransformerTests {
|
||||
|
||||
private ResultToStringTransformer transformer;
|
||||
|
||||
private String doc = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><order><orderItem>test</orderItem></order>";
|
||||
private static final String doc = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><order><orderItem>test</orderItem></order>";
|
||||
|
||||
|
||||
@Before
|
||||
@BeforeEach
|
||||
public void setUp() {
|
||||
transformer = new ResultToStringTransformer();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testWithDomResult() throws Exception {
|
||||
DOMResult result = XmlTestUtil.getDomResultForString(this.doc);
|
||||
DOMResult result = XmlTestUtil.getDomResultForString(doc);
|
||||
Object transformed = transformer.transformResult(result);
|
||||
assertThat(transformed).isInstanceOf(String.class);
|
||||
String transformedString = (String) transformed;
|
||||
assertThat(transformedString).isXmlEqualTo(this.doc);
|
||||
assertThat(transformedString).and(doc).areIdentical();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -78,7 +78,7 @@ public class ResultToStringTransformerTests {
|
||||
Object transformed = transformer.transformResult(result);
|
||||
assertThat(transformed).isInstanceOf(String.class);
|
||||
String transformedString = (String) transformed;
|
||||
assertThat(transformedString).isXmlEqualTo(this.doc);
|
||||
assertThat(transformedString).and(doc).areIdentical();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2020 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,9 +16,9 @@
|
||||
|
||||
package org.springframework.integration.xml.transformer;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||
import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
|
||||
import static org.xmlunit.assertj3.XmlAssert.assertThat;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@@ -29,10 +29,9 @@ import javax.xml.transform.TransformerException;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
import javax.xml.transform.dom.DOMResult;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.TemporaryFolder;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.io.TempDir;
|
||||
import org.mockito.Mockito;
|
||||
import org.w3c.dom.Document;
|
||||
|
||||
@@ -67,10 +66,10 @@ public class XsltPayloadTransformerTests {
|
||||
|
||||
private final String outputAsString = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><bob>test</bob>";
|
||||
|
||||
@Rule
|
||||
public TemporaryFolder temporaryFolder = new TemporaryFolder();
|
||||
@TempDir
|
||||
public File temporaryFolder;
|
||||
|
||||
@Before
|
||||
@BeforeEach
|
||||
public void setUp() throws Exception {
|
||||
this.testTransformer = new XsltPayloadTransformer(getXslTemplates());
|
||||
this.testTransformer.setBeanFactory(Mockito.mock(BeanFactory.class));
|
||||
@@ -85,8 +84,7 @@ public class XsltPayloadTransformerTests {
|
||||
assertThat(transformed)
|
||||
.as("Wrong return type for document payload")
|
||||
.isInstanceOf(Document.class);
|
||||
Document transformedDocument = (Document) transformed;
|
||||
assertThat(XmlTestUtil.docToString(transformedDocument)).isXmlEqualTo(this.outputAsString);
|
||||
assertThat(transformed).and(this.outputAsString).areSimilar();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -99,9 +97,10 @@ public class XsltPayloadTransformerTests {
|
||||
.isInstanceOf(DOMResult.class);
|
||||
|
||||
DOMResult result = (DOMResult) transformed;
|
||||
assertThat(XmlTestUtil.docToString((Document) result.getNode()))
|
||||
assertThat(result.getNode())
|
||||
.as("Document incorrect after transformation")
|
||||
.isXmlEqualTo(this.outputAsString);
|
||||
.and(this.outputAsString)
|
||||
.areSimilar();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -112,10 +111,10 @@ public class XsltPayloadTransformerTests {
|
||||
.as("Wrong return type for document payload")
|
||||
.isInstanceOf(String.class);
|
||||
|
||||
String transformedString = (String) transformed;
|
||||
assertThat(transformedString)
|
||||
assertThat(transformed)
|
||||
.as("String incorrect after transform")
|
||||
.isXmlEqualTo(this.outputAsString);
|
||||
.and(this.outputAsString)
|
||||
.areIdentical();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -128,9 +127,10 @@ public class XsltPayloadTransformerTests {
|
||||
.isInstanceOf(DOMResult.class);
|
||||
|
||||
DOMResult result = (DOMResult) transformed;
|
||||
assertThat(XmlTestUtil.docToString((Document) result.getNode()))
|
||||
assertThat(result.getNode())
|
||||
.as("Document incorrect after transformation")
|
||||
.isXmlEqualTo(this.outputAsString);
|
||||
.and(this.outputAsString)
|
||||
.areSimilar();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -259,7 +259,8 @@ public class XsltPayloadTransformerTests {
|
||||
" <xsl:template match=\"order\">hello world</xsl:template>" +
|
||||
"</xsl:stylesheet>";
|
||||
|
||||
File xsltFile = this.temporaryFolder.newFile();
|
||||
this.temporaryFolder.mkdir();
|
||||
File xsltFile = File.createTempFile("test", null, this.temporaryFolder);
|
||||
FileCopyUtils.copy(xsl.getBytes(), xsltFile);
|
||||
return new FileSystemResource(xsltFile);
|
||||
}
|
||||
|
||||
@@ -78,6 +78,7 @@
|
||||
<module name="AvoidStaticImport">
|
||||
<property name="excludes"
|
||||
value="org.assertj.core.api.Assertions.*,
|
||||
org.xmlunit.assertj3.XmlAssert.*,
|
||||
org.assertj.core.api.Assumptions.*,
|
||||
org.awaitility.Awaitility.*,
|
||||
org.mockito.Mockito.*,
|
||||
|
||||
89
src/reference/asciidoc/changes-5.3-5.4.adoc
Normal file
89
src/reference/asciidoc/changes-5.3-5.4.adoc
Normal file
@@ -0,0 +1,89 @@
|
||||
[[migration-5.3-5.4]]
|
||||
=== Changes between 5.3 and 5.4
|
||||
|
||||
[[x5.4-new-components]]
|
||||
=== New Components
|
||||
|
||||
[[x5.4-sik]]
|
||||
==== Apache Kafka Channel Adapters
|
||||
The standalone https://projects.spring.io/spring-integration-kafka/[Spring Integration Kafka] project has been merged as a `spring-integration-kafka` module to this project.
|
||||
|
||||
The `KafkaProducerMessageHandler` `sendTimeoutExpression` default has changed.
|
||||
|
||||
You can now access the `Future<?>` for underlying `send()` operations.
|
||||
|
||||
See <<./kafka.adoc#kafka,Spring for Apache Kafka Support>> for more information.
|
||||
|
||||
[[x5.4-r2dbc]]
|
||||
==== R2DBC Channel Adapters
|
||||
|
||||
The Channel Adapters for R2DBC database interaction have been introduced.
|
||||
See <<./r2dbc.adoc#r2dbc,R2DBC Support>> for more information.
|
||||
|
||||
[[x5.4-redis-stream]]
|
||||
==== Redis Stream Support
|
||||
|
||||
The Channel Adapters for Redis Stream support have been introduced.
|
||||
See <<./redis.adoc#redis-stream-outbound,Redis Stream Outbound Channel Adapter>> for more information.
|
||||
|
||||
[[x5.4-renewable-lock]]
|
||||
==== Renewable Lock Registry
|
||||
|
||||
A Renewable lock registry has been introduced to allow renew lease of a distributed lock.
|
||||
See <<./jdbc.adoc#jdbc-lock-registry,JDBC implementation>> for more information.
|
||||
|
||||
[[x5.4-zeromq]]
|
||||
==== ZeroMQ Support
|
||||
|
||||
`ZeroMqChannel`, `ZeroMqMessageHandler` and `ZeroMqMessageProducer` have been introduced.
|
||||
See <<./zeromq.adoc#zeromq,ZeroMQ Support>> for more information.
|
||||
|
||||
[[x5.4-general]]
|
||||
=== General Changes
|
||||
|
||||
The one-way messaging gateway (the `void` method return type) now sets a `nullChannel` explicitly into the `replyChannel` header to ignore any possible downstream replies.
|
||||
See <<./gateway.adoc#gateway-default-reply-channel,Setting the Default Reply Channel>> for more information.
|
||||
|
||||
Also the gateway method invokers (`GatewayProxyFactoryBean.MethodInvocationGateway`) are now supplied with the managed bean name as a combination of gateway proxy bean name plus method signature.
|
||||
For example: `sampleGateway#echo(String)`.
|
||||
This effects message history and metrics exposed for the gateway method calls and also give fine-grained logs during start and close of application context.
|
||||
|
||||
The aggregator (and resequencer) can now expire orphaned groups (groups in a persistent store where no new messages arrive after an application restart).
|
||||
See <<./aggregator.adoc#aggregator-expiring-groups, Aggregator Expiring Groups>> for more information.
|
||||
|
||||
The legacy metrics that were replaced by Micrometer meters have been removed.
|
||||
|
||||
The <<./barrier.adoc#barrier,Thread Barrier>> has now two separate timeout options: `requestTimeout` and `triggerTimeout`.
|
||||
|
||||
[[x5.4-tcp]]
|
||||
=== TCP/UDP Changes
|
||||
|
||||
Connection factories now support multiple sending components (`TcpSender`); they remain limited to one receiving component (`TcpListener`).
|
||||
This allows, for example, an inbound gateway and outbound channel adapter to share the same factory, supporting both request/reply and arbitrary messaging from the server to the client.
|
||||
Shared factories should not be used with outbound gateways, unless single-use connections or the `ThreadAffinityClientConnectionFactory` are being used.
|
||||
See <<./ip.adoc#ip-collaborating-adapters,Collaborating Channel Adapters>> and <<./ip.adoc#tcp-gateways, TCP Gateways>> for more information.
|
||||
|
||||
The UDP channel adapters can now be configured with a `SocketCustomizer` which allows the setting of socket properties that are not directly supported by the adapters.
|
||||
See <<./ip.adoc#udp-adapters,UDP Adapters>> for more information.
|
||||
|
||||
[[x5.4-rmi]]
|
||||
=== RMI Changes
|
||||
|
||||
The `spring-integration-rmi` module is deprecated with no replacement and is going to be removed in the next major version.
|
||||
See <<./rmi.adoc#rmi, RMI Support>> for more information.
|
||||
|
||||
|
||||
[[x5.4-amqp]]
|
||||
=== AMQP Changes
|
||||
|
||||
The outbound endpoints now have a new mechanism for handling publisher confirms and returns.
|
||||
See <<./amqp.adoc#alternative-confirms-returns,Alternative Mechanism for Publisher Confirms and Returns>> for more information.
|
||||
|
||||
A new `BatchMode.EXTRACT_PAYLOAD_WITH_HEADERS` is supported by the `AmqpInboundChannelAdapter`.
|
||||
See <<./amqp.adoc#amqp-inbound-channel-adapter,Inbound Channel Adapter>> for more information.
|
||||
|
||||
[[x5.4-mail]]
|
||||
=== Mail Changes
|
||||
|
||||
The `AbstractMailReceiver` can now produce the `MimeMessage` as-is without eager fetching its content.
|
||||
See <<./mail.adoc#mail-inbound, Mail-receiving Channel Adapter>> for more information.
|
||||
@@ -2,6 +2,8 @@
|
||||
== Change History
|
||||
|
||||
// BE SURE TO PRECEDE ALL include:: with a blank line - see https://github.com/asciidoctor/asciidoctor/issues/1297
|
||||
include::./changes-5.3-5.4.adoc[]
|
||||
|
||||
include::./changes-5.2-5.3.adoc[]
|
||||
|
||||
include::./changes-5.1-5.2.adoc[]
|
||||
|
||||
@@ -6,7 +6,7 @@ ifdef::backend-html5[]
|
||||
*{revnumber}*
|
||||
endif::[]
|
||||
|
||||
(C) 2009 - 2020 Pivotal Software, Inc.
|
||||
(C) 2009 - 2021 VMware, Inc.
|
||||
All rights reserved.
|
||||
|
||||
Copies of this document may be made for your own use and for distribution to others, provided that you do not charge any fee for such copies and further provided that each copy contains this Copyright Notice, whether distributed in print or electronically.
|
||||
|
||||
@@ -15,13 +15,13 @@ This section details the compatible https://www.oracle.com/technetwork/java/java
|
||||
[[supported-java-versions]]
|
||||
=== Compatible Java Versions
|
||||
|
||||
For Spring Integration 5.4.x, the minimum compatible Java version is Java SE 8.
|
||||
For Spring Integration 5.5.x, the minimum compatible Java version is Java SE 8.
|
||||
Older versions of Java are not supported.
|
||||
|
||||
[[supported-spring-versions]]
|
||||
=== Compatible Versions of the Spring Framework
|
||||
|
||||
Spring Integration 5.4.x requires Spring Framework 5.3 or later.
|
||||
Spring Integration 5.5.x requires Spring Framework 5.3 or later.
|
||||
|
||||
[[code-conventions]]
|
||||
== Code Conventions
|
||||
|
||||
@@ -2,99 +2,18 @@
|
||||
= What's New?
|
||||
|
||||
[[spring-integration-intro-new]]
|
||||
For those who are already familiar with Spring Integration, this chapter provides a brief overview of the new features of version 5.4.
|
||||
For those who are already familiar with Spring Integration, this chapter provides a brief overview of the new features of version 5.5.
|
||||
|
||||
If you are interested in the changes and features that were introduced in earlier versions, see the <<./history.adoc#history,Change History>>.
|
||||
|
||||
[[whats-new]]
|
||||
|
||||
== What's New in Spring Integration 5.4?
|
||||
== What's New in Spring Integration 5.5?
|
||||
|
||||
If you are interested in more details, see the Issue Tracker tickets that were resolved as part of the 5.4 development process.
|
||||
If you are interested in more details, see the Issue Tracker tickets that were resolved as part of the 5.5 development process.
|
||||
|
||||
[[x5.4-new-components]]
|
||||
[[x5.5-new-components]]
|
||||
=== New Components
|
||||
|
||||
[[x5.4-sik]]
|
||||
==== Apache Kafka Channel Adapters
|
||||
The standalone https://projects.spring.io/spring-integration-kafka/[Spring Integration Kafka] project has been merged as a `spring-integration-kafka` module to this project.
|
||||
|
||||
The `KafkaProducerMessageHandler` `sendTimeoutExpression` default has changed.
|
||||
|
||||
You can now access the `Future<?>` for underlying `send()` operations.
|
||||
|
||||
See <<./kafka.adoc#kafka,Spring for Apache Kafka Support>> for more information.
|
||||
|
||||
[[x5.4-r2dbc]]
|
||||
==== R2DBC Channel Adapters
|
||||
|
||||
The Channel Adapters for R2DBC database interaction have been introduced.
|
||||
See <<./r2dbc.adoc#r2dbc,R2DBC Support>> for more information.
|
||||
|
||||
[[x5.4-redis-stream]]
|
||||
==== Redis Stream Support
|
||||
|
||||
The Channel Adapters for Redis Stream support have been introduced.
|
||||
See <<./redis.adoc#redis-stream-outbound,Redis Stream Outbound Channel Adapter>> for more information.
|
||||
|
||||
[[x5.4-renewable-lock]]
|
||||
==== Renewable Lock Registry
|
||||
|
||||
A Renewable lock registry has been introduced to allow renew lease of a distributed lock.
|
||||
See <<./jdbc.adoc#jdbc-lock-registry,JDBC implementation>> for more information.
|
||||
|
||||
[[x5.4-zeromq]]
|
||||
==== ZeroMQ Support
|
||||
|
||||
`ZeroMqChannel`, `ZeroMqMessageHandler` and `ZeroMqMessageProducer` have been introduced.
|
||||
See <<./zeromq.adoc#zeromq,ZeroMQ Support>> for more information.
|
||||
|
||||
[[x5.4-general]]
|
||||
[[x5.5-general]]
|
||||
=== General Changes
|
||||
|
||||
The one-way messaging gateway (the `void` method return type) now sets a `nullChannel` explicitly into the `replyChannel` header to ignore any possible downstream replies.
|
||||
See <<./gateway.adoc#gateway-default-reply-channel,Setting the Default Reply Channel>> for more information.
|
||||
|
||||
Also the gateway method invokers (`GatewayProxyFactoryBean.MethodInvocationGateway`) are now supplied with the managed bean name as a combination of gateway proxy bean name plus method signature.
|
||||
For example: `sampleGateway#echo(String)`.
|
||||
This effects message history and metrics exposed for the gateway method calls and also give fine-grained logs during start and close of application context.
|
||||
|
||||
The aggregator (and resequencer) can now expire orphaned groups (groups in a persistent store where no new messages arrive after an application restart).
|
||||
See <<./aggregator.adoc#aggregator-expiring-groups, Aggregator Expiring Groups>> for more information.
|
||||
|
||||
The legacy metrics that were replaced by Micrometer meters have been removed.
|
||||
|
||||
The <<./barrier.adoc#barrier,Thread Barrier>> has now two separate timeout options: `requestTimeout` and `triggerTimeout`.
|
||||
|
||||
[[x5.4-tcp]]
|
||||
=== TCP/UDP Changes
|
||||
|
||||
Connection factories now support multiple sending components (`TcpSender`); they remain limited to one receiving component (`TcpListener`).
|
||||
This allows, for example, an inbound gateway and outbound channel adapter to share the same factory, supporting both request/reply and arbitrary messaging from the server to the client.
|
||||
Shared factories should not be used with outbound gateways, unless single-use connections or the `ThreadAffinityClientConnectionFactory` are being used.
|
||||
See <<./ip.adoc#ip-collaborating-adapters,Collaborating Channel Adapters>> and <<./ip.adoc#tcp-gateways, TCP Gateways>> for more information.
|
||||
|
||||
The UDP channel adapters can now be configured with a `SocketCustomizer` which allows the setting of socket properties that are not directly supported by the adapters.
|
||||
See <<./ip.adoc#udp-adapters,UDP Adapters>> for more information.
|
||||
|
||||
[[x5.4-rmi]]
|
||||
=== RMI Changes
|
||||
|
||||
The `spring-integration-rmi` module is deprecated with no replacement and is going to be removed in the next major version.
|
||||
See <<./rmi.adoc#rmi, RMI Support>> for more information.
|
||||
|
||||
|
||||
[[x5.4-amqp]]
|
||||
=== AMQP Changes
|
||||
|
||||
The outbound endpoints now have a new mechanism for handling publisher confirms and returns.
|
||||
See <<./amqp.adoc#alternative-confirms-returns,Alternative Mechanism for Publisher Confirms and Returns>> for more information.
|
||||
|
||||
A new `BatchMode.EXTRACT_PAYLOAD_WITH_HEADERS` is supported by the `AmqpInboundChannelAdapter`.
|
||||
See <<./amqp.adoc#amqp-inbound-channel-adapter,Inbound Channel Adapter>> for more information.
|
||||
|
||||
[[x5.4-mail]]
|
||||
=== Mail Changes
|
||||
|
||||
The `AbstractMailReceiver` can now produce the `MimeMessage` as-is without eager fetching its content.
|
||||
See <<./mail.adoc#mail-inbound, Mail-receiving Channel Adapter>> for more information.
|
||||
|
||||
Reference in New Issue
Block a user