INT-4309 Http Header Mapper VarArgs Instead of []

JIRA: https://jira.spring.io/browse/INT-4309

More convenient for Java Config.

*Upgrade to Reactor 3.1 B-S, Reactor-Netty 0.7 B-S and Security 5.0 B-S.
Otherwise we are not compatible with the latest SF
This commit is contained in:
Gary Russell
2017-07-04 17:45:03 -04:00
committed by Artem Bilan
parent 47003077cc
commit 6c62af53f4
3 changed files with 15 additions and 8 deletions

View File

@@ -124,8 +124,8 @@ subprojects { subproject ->
mysqlVersion = '5.1.41'
pahoMqttClientVersion = '1.1.1'
postgresVersion = '42.0.0'
reactorNettyVersion = '0.6.4.RELEASE'
reactorVersion = '3.1.0.M2'
reactorNettyVersion = '0.7.0.BUILD-SNAPSHOT'
reactorVersion = '3.1.0.BUILD-SNAPSHOT'
romeToolsVersion = '1.7.2'
servletApiVersion = '3.1.0'
slf4jVersion = "1.7.25"
@@ -135,7 +135,7 @@ subprojects { subproject ->
springDataMongoVersion = '2.0.0.M4'
springDataRedisVersion = '2.0.0.M4'
springGemfireVersion = '2.0.0.M4'
springSecurityVersion = '5.0.0.M2'
springSecurityVersion = '5.0.0.BUILD-SNAPSHOT'
springSocialTwitterVersion = '2.0.0.M2'
springRetryVersion = '1.2.0.RELEASE'
springVersion = project.hasProperty('springVersion') ? project.springVersion : '5.0.0.BUILD-SNAPSHOT'
@@ -310,7 +310,7 @@ project('spring-integration-core') {
compile("com.esotericsoftware:kryo-shaded:$kryoShadedVersion", optional)
testCompile ("org.aspectj:aspectjweaver:$aspectjVersion")
compile "io.projectreactor:reactor-test:$reactorVersion"
testCompile "io.projectreactor:reactor-test:$reactorVersion"
}
}
@@ -341,6 +341,7 @@ project('spring-integration-file') {
testCompile "org.apache.derby:derby:$derbyVersion"
testCompile "org.apache.derby:derbyclient:$derbyVersion"
testCompile "redis.clients:jedis:$jedisVersion"
testCompile "io.projectreactor:reactor-test:$reactorVersion"
}
}
@@ -399,6 +400,7 @@ project('spring-integration-http') {
testCompile project(":spring-integration-security")
testCompile "org.springframework.security:spring-security-config:$springSecurityVersion"
testCompile "org.springframework.security:spring-security-test:$springSecurityVersion"
testCompile "io.projectreactor:reactor-test:$reactorVersion"
}
}

View File

@@ -368,9 +368,11 @@ public class DefaultHttpHeaderMapper implements HeaderMapper<HttpHeaders>, BeanF
* mapping outbound endpoint request headers.
* @param excludedOutboundStandardRequestHeaderNames the excludedStandardRequestHeaderNames to set
*/
public void setExcludedOutboundStandardRequestHeaderNames(String[] excludedOutboundStandardRequestHeaderNames) {
public void setExcludedOutboundStandardRequestHeaderNames(String... excludedOutboundStandardRequestHeaderNames) {
Assert.notNull(excludedOutboundStandardRequestHeaderNames,
"'excludedOutboundStandardRequestHeaderNames' must not be null");
Assert.noNullElements(excludedOutboundStandardRequestHeaderNames,
"'excludedOutboundStandardRequestHeaderNames' must not have null elements");
this.excludedOutboundStandardRequestHeaderNames = Arrays.copyOf(excludedOutboundStandardRequestHeaderNames,
excludedOutboundStandardRequestHeaderNames.length);
}
@@ -380,9 +382,11 @@ public class DefaultHttpHeaderMapper implements HeaderMapper<HttpHeaders>, BeanF
* mapping inbound endpoint response headers.
* @param excludedInboundStandardResponseHeaderNames the excludedStandardResponseHeaderNames to set
*/
public void setExcludedInboundStandardResponseHeaderNames(String[] excludedInboundStandardResponseHeaderNames) {
public void setExcludedInboundStandardResponseHeaderNames(String... excludedInboundStandardResponseHeaderNames) {
Assert.notNull(excludedInboundStandardResponseHeaderNames,
"'excludedInboundStandardResponseHeaderNames' must not be null");
Assert.noNullElements(excludedInboundStandardResponseHeaderNames,
"'excludedInboundStandardResponseHeaderNames' must not have null elements");
this.excludedInboundStandardResponseHeaderNames = Arrays.copyOf(excludedInboundStandardResponseHeaderNames,
excludedInboundStandardResponseHeaderNames.length);
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* 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.
@@ -50,6 +50,7 @@ import org.springframework.util.StopWatch;
* @author Mark Fisher
* @author Gunnar Hillert
* @author Artem Bilan
* @author Gary Russell
* @since 2.0.1
*/
public class DefaultHttpHeaderMapperFromMessageOutboundTests {
@@ -685,7 +686,7 @@ public class DefaultHttpHeaderMapperFromMessageOutboundTests {
public void dontPropagateContentLength() {
DefaultHttpHeaderMapper mapper = DefaultHttpHeaderMapper.outboundMapper();
// not suppressed on outbound request, by default
mapper.setExcludedOutboundStandardRequestHeaderNames(new String[] {"Content-Length"});
mapper.setExcludedOutboundStandardRequestHeaderNames("Content-Length");
Map<String, Object> messageHeaders = new HashMap<String, Object>();
messageHeaders.put("Content-Length", 4);