Upgrade to Spring Framework 7.0

* Upgrade to Spring Data `2025.1.0`
* Upgrade to Spring Security `7.0`
* Fix all the compilation errors, including for Kotlin (not clear how they passed before upgrade to SF `7.0`)
This commit is contained in:
Artem Bilan
2025-06-04 16:36:44 -04:00
parent 66de5a2c93
commit 66d76a3aa3
27 changed files with 81 additions and 78 deletions

View File

@@ -109,12 +109,12 @@ ext {
servletApiVersion = '6.1.0'
smackVersion = '4.4.8'
springAmqpVersion = '3.2.5'
springDataVersion = '2025.0.0'
springDataVersion = '2025.1.0-SNAPSHOT'
springGraphqlVersion = '1.4.0'
springKafkaVersion = '3.3.6'
springRetryVersion = '2.0.12'
springSecurityVersion = '6.5.0'
springVersion = '6.2.7'
springSecurityVersion = '7.0.0-SNAPSHOT'
springVersion = '7.0.0-SNAPSHOT'
springWsVersion = '4.1.0'
testcontainersVersion = '1.21.1'
tomcatVersion = '11.0.7'

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2020-2023 the original author or authors.
* Copyright 2020-2025 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.
@@ -69,7 +69,7 @@ class KotlinEnricherSpec(override val delegate: EnricherSpec)
this.delegate.requestPayloadExpression(requestPayloadExpression)
}
fun <P> requestPayload(function: (Message<P>) -> Any) {
fun <P: Any> requestPayload(function: (Message<P>) -> Any) {
this.delegate.requestPayload(function)
}
@@ -93,7 +93,7 @@ class KotlinEnricherSpec(override val delegate: EnricherSpec)
this.delegate.propertyExpression(key, expression)
}
fun <P> propertyFunction(key: String, function: (Message<P>) -> Any) {
fun <P: Any> propertyFunction(key: String, function: (Message<P>) -> Any) {
this.delegate.propertyFunction(key, function)
}
@@ -105,7 +105,7 @@ class KotlinEnricherSpec(override val delegate: EnricherSpec)
this.delegate.header(name, expression, overwrite)
}
fun <P> headerFunction(name: String, function: (Message<P>) -> Any, overwrite: Boolean?) {
fun <P: Any> headerFunction(name: String, function: (Message<P>) -> Any, overwrite: Boolean?) {
this.delegate.header(name, function, overwrite)
}

View File

@@ -901,7 +901,7 @@ class KotlinIntegrationFlowDefinition(@PublishedApi internal val delegate: Integ
* the `org.springframework.integration.handler.LoggingHandler`
* as a default logging category and function for the log message.
*/
fun <P> log(function: (Message<P>) -> Any) {
fun <P: Any> log(function: (Message<P>) -> Any) {
this.delegate.log(function)
}
@@ -948,7 +948,7 @@ class KotlinIntegrationFlowDefinition(@PublishedApi internal val delegate: Integ
* the `org.springframework.integration.handler.LoggingHandler`
* as a default logging category and function for the log message.
*/
fun <P> log(level: LoggingHandler.Level, function: (Message<P>) -> Any) {
fun <P: Any> log(level: LoggingHandler.Level, function: (Message<P>) -> Any) {
this.delegate.log(level, function)
}
@@ -958,7 +958,7 @@ class KotlinIntegrationFlowDefinition(@PublishedApi internal val delegate: Integ
* [LoggingHandler.Level] logging level,
* the provided logging category and function for the log message.
*/
fun <P> log(category: String, function: (Message<P>) -> Any) {
fun <P: Any> log(category: String, function: (Message<P>) -> Any) {
this.delegate.log(category, function)
}
@@ -968,7 +968,7 @@ class KotlinIntegrationFlowDefinition(@PublishedApi internal val delegate: Integ
* [LoggingHandler.Level] logging level, logging category
* and function for the log message.
*/
fun <P> log(level: LoggingHandler.Level, category: String, function: (Message<P>) -> Any) {
fun <P: Any> log(level: LoggingHandler.Level, category: String, function: (Message<P>) -> Any) {
this.delegate.log(level, category, function)
}
@@ -1075,7 +1075,7 @@ class KotlinIntegrationFlowDefinition(@PublishedApi internal val delegate: Integ
* wrap it to a [Flux], apply provided function via [Flux.transform]
* and emit the result to one more [FluxMessageChannel], subscribed in the downstream flow.
*/
fun <I, O> fluxTransform(fluxFunction: (Flux<Message<I>>) -> Publisher<O>) {
fun <I: Any, O> fluxTransform(fluxFunction: (Flux<Message<I>>) -> Publisher<O>) {
this.delegate.fluxTransform(fluxFunction)
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2020-2024 the original author or authors.
* Copyright 2020-2025 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.
@@ -197,7 +197,7 @@ class KotlinDslTests {
val receive = replyChannel.receive(10_000)
assertThat(receive?.payload).isNotNull().isEqualTo("TEST")
assertThat(receive.headers).doesNotContain("headerToRemove", null)
assertThat(receive?.headers).isNotNull().doesNotContain("headerToRemove", null)
assertThat(this.wireTapChannel.receive(10_000)?.payload).isNotNull().isEqualTo("test")
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2022 the original author or authors.
* Copyright 2022-2025 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,6 +16,8 @@
package org.springframework.integration.http.aot;
import org.jspecify.annotations.Nullable;
import org.springframework.aot.hint.MemberCategory;
import org.springframework.aot.hint.ReflectionHints;
import org.springframework.aot.hint.RuntimeHints;
@@ -34,7 +36,7 @@ import org.springframework.web.server.WebHandler;
class HttpRuntimeHints implements RuntimeHintsRegistrar {
@Override
public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
public void registerHints(RuntimeHints hints, @Nullable ClassLoader classLoader) {
ReflectionHints reflectionHints = hints.reflection();
reflectionHints.registerType(WebHandler.class, MemberCategory.INVOKE_PUBLIC_METHODS);

View File

@@ -1,6 +1,5 @@
/**
* Provides classes to support Spring AOT.
*/
@org.springframework.lang.NonNullApi
@org.springframework.lang.NonNullFields
@org.jspecify.annotations.NullMarked
package org.springframework.integration.http.aot;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2016-2023 the original author or authors.
* Copyright 2016-2025 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,12 +19,13 @@ package org.springframework.integration.http.dsl;
import java.net.URI;
import java.util.function.Function;
import org.jspecify.annotations.Nullable;
import org.springframework.expression.Expression;
import org.springframework.expression.common.LiteralExpression;
import org.springframework.integration.expression.FunctionExpression;
import org.springframework.integration.http.inbound.HttpRequestHandlingController;
import org.springframework.integration.http.inbound.HttpRequestHandlingMessagingGateway;
import org.springframework.lang.Nullable;
import org.springframework.messaging.Message;
import org.springframework.util.Assert;
import org.springframework.web.client.RestTemplate;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2017-2024 the original author or authors.
* Copyright 2017-2025 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.
@@ -22,6 +22,8 @@ import java.util.Map;
import java.util.function.Consumer;
import java.util.function.Function;
import org.jspecify.annotations.Nullable;
import org.springframework.core.ResolvableType;
import org.springframework.expression.Expression;
import org.springframework.http.HttpEntity;
@@ -36,7 +38,6 @@ import org.springframework.integration.http.inbound.CrossOrigin;
import org.springframework.integration.http.inbound.RequestMapping;
import org.springframework.integration.http.support.DefaultHttpHeaderMapper;
import org.springframework.integration.mapping.HeaderMapper;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
import org.springframework.validation.Validator;
import org.springframework.web.bind.annotation.RequestMethod;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2016-2023 the original author or authors.
* Copyright 2016-2025 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,13 +19,14 @@ package org.springframework.integration.http.dsl;
import java.net.URI;
import java.util.Arrays;
import org.jspecify.annotations.Nullable;
import org.springframework.expression.Expression;
import org.springframework.expression.common.LiteralExpression;
import org.springframework.http.client.ClientHttpRequestFactory;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.integration.expression.ValueExpression;
import org.springframework.integration.http.outbound.HttpRequestExecutingMessageHandler;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
import org.springframework.web.client.ResponseErrorHandler;
import org.springframework.web.client.RestTemplate;

View File

@@ -1,6 +1,5 @@
/**
* Provides HTTP Components support for Spring Integration Java DSL.
*/
@org.springframework.lang.NonNullApi
@org.springframework.lang.NonNullFields
@org.jspecify.annotations.NullMarked
package org.springframework.integration.http.dsl;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2017-2024 the original author or authors.
* Copyright 2017-2025 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.
@@ -21,6 +21,8 @@ import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
import org.jspecify.annotations.Nullable;
import org.springframework.core.ResolvableType;
import org.springframework.expression.EvaluationContext;
import org.springframework.expression.Expression;
@@ -36,7 +38,6 @@ import org.springframework.integration.gateway.MessagingGatewaySupport;
import org.springframework.integration.http.support.DefaultHttpHeaderMapper;
import org.springframework.integration.http.support.IntegrationWebExchangeBindException;
import org.springframework.integration.mapping.HeaderMapper;
import org.springframework.lang.Nullable;
import org.springframework.messaging.MessageHeaders;
import org.springframework.util.Assert;
import org.springframework.util.ClassUtils;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2024 the original author or authors.
* Copyright 2002-2025 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.
@@ -130,9 +130,9 @@ public class HttpRequestHandlingMessagingGateway extends HttpRequestHandlingEndp
HttpHeaders outputHeaders = response.getHeaders();
HttpHeaders entityHeaders = responseEntity.getHeaders();
entityHeaders.entrySet()
entityHeaders.headerSet()
.stream()
.filter(entry -> !outputHeaders.containsKey(entry.getKey()))
.filter(entry -> !outputHeaders.containsHeader(entry.getKey()))
.forEach(entry -> outputHeaders.put(entry.getKey(), entry.getValue()));
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2017-2024 the original author or authors.
* Copyright 2017-2025 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.
@@ -31,6 +31,8 @@ import java.util.concurrent.locks.ReentrantLock;
import javax.xml.transform.Source;
import org.jspecify.annotations.Nullable;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.expression.EvaluationContext;
@@ -51,7 +53,6 @@ import org.springframework.integration.http.support.DefaultHttpHeaderMapper;
import org.springframework.integration.mapping.HeaderMapper;
import org.springframework.integration.support.AbstractIntegrationMessageBuilder;
import org.springframework.integration.support.MessageBuilderFactory;
import org.springframework.lang.Nullable;
import org.springframework.messaging.Message;
import org.springframework.util.Assert;
import org.springframework.util.ClassUtils;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2024 the original author or authors.
* Copyright 2002-2025 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.
@@ -20,6 +20,8 @@ import java.net.URI;
import java.util.List;
import java.util.Map;
import org.jspecify.annotations.Nullable;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.expression.Expression;
import org.springframework.expression.common.LiteralExpression;
@@ -29,7 +31,6 @@ import org.springframework.http.ResponseEntity;
import org.springframework.http.client.ClientHttpRequestFactory;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.integration.expression.ValueExpression;
import org.springframework.lang.Nullable;
import org.springframework.messaging.Message;
import org.springframework.messaging.MessageHandlingException;
import org.springframework.util.Assert;

View File

@@ -1,6 +1,5 @@
/**
* Provides classes supporting outbound endpoints.
*/
@org.springframework.lang.NonNullApi
@org.springframework.lang.NonNullFields
@org.jspecify.annotations.NullMarked
package org.springframework.integration.http.outbound;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2024 the original author or authors.
* Copyright 2002-2025 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.
@@ -39,6 +39,7 @@ import java.util.Set;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jspecify.annotations.Nullable;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory;
@@ -51,7 +52,6 @@ import org.springframework.http.HttpMethod;
import org.springframework.http.MediaType;
import org.springframework.integration.mapping.HeaderMapper;
import org.springframework.integration.support.utils.IntegrationUtils;
import org.springframework.lang.Nullable;
import org.springframework.messaging.MessageHeaders;
import org.springframework.util.Assert;
import org.springframework.util.CollectionUtils;
@@ -773,7 +773,7 @@ public class DefaultHttpHeaderMapper implements HeaderMapper<HttpHeaders>, BeanF
this.logger.debug("inboundHeaderNames=" + Arrays.toString(this.inboundHeaderNames));
}
Map<String, Object> target = new HashMap<>();
Set<String> headerNames = source.keySet();
Set<String> headerNames = source.headerNames();
for (String name : headerNames) {
String lowerName = name.toLowerCase(Locale.ROOT);
if (shouldMapInboundHeader(lowerName)) {
@@ -793,7 +793,7 @@ public class DefaultHttpHeaderMapper implements HeaderMapper<HttpHeaders>, BeanF
String prefixedName = StringUtils.startsWithIgnoreCase(name, this.userDefinedHeaderPrefix)
? name
: this.userDefinedHeaderPrefix + name;
Object value = source.containsKey(prefixedName)
Object value = source.containsHeader(prefixedName)
? getHttpHeader(source, prefixedName)
: getHttpHeader(source, name);
if (value != null) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013-2022 the original author or authors.
* Copyright 2013-2025 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.
@@ -44,7 +44,6 @@ import org.springframework.mock.web.MockHttpServletResponse;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.context.request.RequestAttributes;
@@ -129,7 +128,7 @@ public class HttpProxyScenarioTests {
assertThat(httpHeaders.getFirst("If-Unmodified-Since")).isEqualTo(ifUnmodifiedSinceValue);
assertThat(httpHeaders.getFirst("Connection")).isEqualTo("Keep-Alive");
MultiValueMap<String, String> responseHeaders = new LinkedMultiValueMap<>(httpHeaders);
HttpHeaders responseHeaders = HttpHeaders.copyOf(httpHeaders);
responseHeaders.set("Connection", "close");
responseHeaders.set("Content-Disposition", contentDispositionValue);
return new ResponseEntity<>(responseHeaders, HttpStatus.OK);
@@ -190,7 +189,7 @@ public class HttpProxyScenarioTests {
assertThat(((MultiValueMap<String, ?>) entity.getBody()).getFirst("foo"))
.isEqualTo("foo".getBytes());
MultiValueMap<String, String> responseHeaders = new LinkedMultiValueMap<>(httpHeaders);
HttpHeaders responseHeaders = HttpHeaders.copyOf(httpHeaders);
responseHeaders.set("Connection", "close");
responseHeaders.set("Content-Type", "text/plain");
return new ResponseEntity<>(responseHeaders, HttpStatus.OK);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2024 the original author or authors.
* Copyright 2002-2025 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.
@@ -78,10 +78,10 @@ public class CookieTests {
assertThat(br.readLine()).isNull();
br.close();
assertThat(allHeaders.size()).isEqualTo(3);
assertThat(allHeaders.get(0).containsKey("Cookie")).isFalse();
assertThat(allHeaders.get(1).containsKey("Cookie")).isTrue();
assertThat(allHeaders.get(0).containsHeader("Cookie")).isFalse();
assertThat(allHeaders.get(1).containsHeader("Cookie")).isTrue();
assertThat(allHeaders.get(1).get("Cookie").get(0)).isEqualTo("JSESSIONID=X123");
assertThat(allHeaders.get(2).containsKey("Cookie")).isTrue();
assertThat(allHeaders.get(2).containsHeader("Cookie")).isTrue();
assertThat(allHeaders.get(2).get("Cookie").get(0)).isEqualTo("JSESSIONID=X124");
}
@@ -92,7 +92,7 @@ public class CookieTests {
public ClientHttpRequest createRequest(URI uri, HttpMethod httpMethod) {
return new ClientHttpRequest() {
private HttpHeaders headers = new HttpHeaders();
private final HttpHeaders headers = new HttpHeaders();
public HttpHeaders getHeaders() {
return headers;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2024 the original author or authors.
* Copyright 2002-2025 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.
@@ -21,7 +21,6 @@ import java.io.IOException;
import java.io.Serializable;
import java.net.URI;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
@@ -861,9 +860,9 @@ public class HttpRequestExecutingMessageHandlerTests {
StepVerifier.create(httpHeadersSink.asMono())
.assertNext(headers ->
assertThat(headers)
.containsEntry(HttpHeaders.CONTENT_TYPE,
Arrays.asList(MediaType.APPLICATION_JSON_VALUE)))
assertThat(headers.headerSet())
.contains(Map.entry(HttpHeaders.CONTENT_TYPE,
List.of(MediaType.APPLICATION_JSON_VALUE))))
.verifyComplete();
}

View File

@@ -616,7 +616,7 @@ public class DefaultHttpHeaderMapperFromMessageOutboundTests {
messageHeaders.put("abcdef", "abcdef-value");
HttpHeaders headers = new HttpHeaders();
mapper.fromHeaders(new MessageHeaders(messageHeaders), headers);
assertThat(headers).hasSize(3);
assertThat(headers.headerSet()).hasSize(3);
assertThat(headers.get("1x")).isNull();
assertThat(headers.get("z1")).isNull();
assertThat(headers.get("abc")).isNull();
@@ -639,7 +639,7 @@ public class DefaultHttpHeaderMapperFromMessageOutboundTests {
messageHeaders.put("Accept", "text/xml");
HttpHeaders headers = new HttpHeaders();
mapper.fromHeaders(new MessageHeaders(messageHeaders), headers);
assertThat(headers).hasSize(3);
assertThat(headers.headerSet()).hasSize(3);
assertThat(headers.get("foobar")).hasSize(1);
assertThat(headers.getFirst("foobar")).isEqualTo("abc");
assertThat(headers.getContentType().toString()).isEqualTo("text/html");

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015-2024 the original author or authors.
* Copyright 2015-2025 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.
@@ -72,7 +72,7 @@ import org.springframework.web.socket.config.annotation.WebSocketMessageBrokerCo
import org.springframework.web.socket.messaging.SessionSubscribeEvent;
import org.springframework.web.socket.messaging.WebSocketStompClient;
import org.springframework.web.socket.server.HandshakeInterceptor;
import org.springframework.web.socket.server.standard.TomcatRequestUpgradeStrategy;
import org.springframework.web.socket.server.standard.StandardWebSocketUpgradeStrategy;
import org.springframework.web.socket.server.support.DefaultHandshakeHandler;
import org.springframework.web.socket.sockjs.client.SockJsClient;
import org.springframework.web.socket.sockjs.client.WebSocketTransport;
@@ -309,7 +309,7 @@ public class StompInboundChannelAdapterWebSocketIntegrationTests {
@Bean
public DefaultHandshakeHandler handshakeHandler() {
return new DefaultHandshakeHandler(new TomcatRequestUpgradeStrategy());
return new DefaultHandshakeHandler(new StandardWebSocketUpgradeStrategy());
}
@Override

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015-2024 the original author or authors.
* Copyright 2015-2025 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.
@@ -72,7 +72,7 @@ import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBr
import org.springframework.web.socket.config.annotation.StompEndpointRegistry;
import org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer;
import org.springframework.web.socket.messaging.WebSocketStompClient;
import org.springframework.web.socket.server.standard.TomcatRequestUpgradeStrategy;
import org.springframework.web.socket.server.standard.StandardWebSocketUpgradeStrategy;
import org.springframework.web.socket.server.support.DefaultHandshakeHandler;
import org.springframework.web.socket.sockjs.client.SockJsClient;
import org.springframework.web.socket.sockjs.client.WebSocketTransport;
@@ -246,7 +246,7 @@ public class StompMessageHandlerWebSocketIntegrationTests {
@Bean
public DefaultHandshakeHandler handshakeHandler() {
return new DefaultHandshakeHandler(new TomcatRequestUpgradeStrategy());
return new DefaultHandshakeHandler(new StandardWebSocketUpgradeStrategy());
}
@Override

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2017-2024 the original author or authors.
* Copyright 2017-2025 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.
@@ -384,8 +384,8 @@ public class WebFluxInboundEndpoint extends BaseHttpInboundEndpoint implements W
org.springframework.http.HttpHeaders responseHeaders = exchange.getResponse().getHeaders();
if (!entityHeaders.isEmpty()) {
entityHeaders.entrySet().stream()
.filter(entry -> !responseHeaders.containsKey(entry.getKey()))
entityHeaders.headerSet().stream()
.filter(entry -> !responseHeaders.containsHeader(entry.getKey()))
.forEach(entry -> responseHeaders.put(entry.getKey(), entry.getValue()));
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2017-2024 the original author or authors.
* Copyright 2017-2025 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.
@@ -100,8 +100,8 @@ class WebFluxRequestExecutingMessageHandlerTests {
void noContentLengthHeaderForGetMethod() {
ClientHttpConnector httpConnector =
new HttpHandlerConnector((request, response) -> {
assertThat(request.getHeaders())
.doesNotContainKey(org.springframework.http.HttpHeaders.CONTENT_LENGTH);
assertThat(request.getHeaders().headerNames())
.doesNotContain(org.springframework.http.HttpHeaders.CONTENT_LENGTH);
response.setStatusCode(HttpStatus.OK);
return Mono.defer(response::setComplete);
});

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014-2024 the original author or authors.
* Copyright 2014-2025 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.
@@ -88,7 +88,7 @@ import org.springframework.web.socket.messaging.SessionConnectedEvent;
import org.springframework.web.socket.messaging.SessionSubscribeEvent;
import org.springframework.web.socket.messaging.StompSubProtocolHandler;
import org.springframework.web.socket.messaging.SubProtocolHandler;
import org.springframework.web.socket.server.standard.TomcatRequestUpgradeStrategy;
import org.springframework.web.socket.server.standard.StandardWebSocketUpgradeStrategy;
import org.springframework.web.socket.server.support.DefaultHandshakeHandler;
import org.springframework.web.socket.sockjs.client.SockJsClient;
import org.springframework.web.socket.sockjs.client.WebSocketTransport;
@@ -473,7 +473,7 @@ public class StompIntegrationTests {
@Bean
public DefaultHandshakeHandler handshakeHandler() {
return new DefaultHandshakeHandler(new TomcatRequestUpgradeStrategy());
return new DefaultHandshakeHandler(new StandardWebSocketUpgradeStrategy());
}
@Override

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2021-2024 the original author or authors.
* Copyright 2021-2025 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.
@@ -43,7 +43,7 @@ import org.springframework.web.socket.WebSocketHandler;
import org.springframework.web.socket.client.WebSocketClient;
import org.springframework.web.socket.client.standard.StandardWebSocketClient;
import org.springframework.web.socket.server.HandshakeHandler;
import org.springframework.web.socket.server.standard.TomcatRequestUpgradeStrategy;
import org.springframework.web.socket.server.standard.StandardWebSocketUpgradeStrategy;
import org.springframework.web.socket.server.support.DefaultHandshakeHandler;
import static org.assertj.core.api.Assertions.assertThat;
@@ -155,7 +155,7 @@ public class WebSocketDslTests {
@Bean
public DefaultHandshakeHandler handshakeHandler() {
return new DefaultHandshakeHandler(new TomcatRequestUpgradeStrategy());
return new DefaultHandshakeHandler(new StandardWebSocketUpgradeStrategy());
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014-2022 the original author or authors.
* Copyright 2014-2025 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.
@@ -78,7 +78,7 @@ import org.springframework.web.socket.handler.WebSocketHandlerDecoratorFactory;
import org.springframework.web.socket.messaging.StompSubProtocolHandler;
import org.springframework.web.socket.messaging.SubProtocolHandler;
import org.springframework.web.socket.server.RequestUpgradeStrategy;
import org.springframework.web.socket.server.standard.TomcatRequestUpgradeStrategy;
import org.springframework.web.socket.server.standard.StandardWebSocketUpgradeStrategy;
import org.springframework.web.socket.server.support.DefaultHandshakeHandler;
import org.springframework.web.socket.sockjs.client.SockJsClient;
import org.springframework.web.socket.sockjs.client.WebSocketTransport;
@@ -362,7 +362,7 @@ public class WebSocketServerTests {
}
public static class MyTomcatRequestUpgradeStrategy extends TomcatRequestUpgradeStrategy implements Lifecycle {
public static class MyTomcatRequestUpgradeStrategy extends StandardWebSocketUpgradeStrategy implements Lifecycle {
@Override
public void start() {