Skip to content

Commit 66d76a3

Browse files
committed
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`)
1 parent 66de5a2 commit 66d76a3

File tree

27 files changed

+81
-78
lines changed

27 files changed

+81
-78
lines changed

build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,12 @@ ext {
109109
servletApiVersion = '6.1.0'
110110
smackVersion = '4.4.8'
111111
springAmqpVersion = '3.2.5'
112-
springDataVersion = '2025.0.0'
112+
springDataVersion = '2025.1.0-SNAPSHOT'
113113
springGraphqlVersion = '1.4.0'
114114
springKafkaVersion = '3.3.6'
115115
springRetryVersion = '2.0.12'
116-
springSecurityVersion = '6.5.0'
117-
springVersion = '6.2.7'
116+
springSecurityVersion = '7.0.0-SNAPSHOT'
117+
springVersion = '7.0.0-SNAPSHOT'
118118
springWsVersion = '4.1.0'
119119
testcontainersVersion = '1.21.1'
120120
tomcatVersion = '11.0.7'

spring-integration-core/src/main/kotlin/org/springframework/integration/dsl/KotlinEnricherSpec.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020-2023 the original author or authors.
2+
* Copyright 2020-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -69,7 +69,7 @@ class KotlinEnricherSpec(override val delegate: EnricherSpec)
6969
this.delegate.requestPayloadExpression(requestPayloadExpression)
7070
}
7171

72-
fun <P> requestPayload(function: (Message<P>) -> Any) {
72+
fun <P: Any> requestPayload(function: (Message<P>) -> Any) {
7373
this.delegate.requestPayload(function)
7474
}
7575

@@ -93,7 +93,7 @@ class KotlinEnricherSpec(override val delegate: EnricherSpec)
9393
this.delegate.propertyExpression(key, expression)
9494
}
9595

96-
fun <P> propertyFunction(key: String, function: (Message<P>) -> Any) {
96+
fun <P: Any> propertyFunction(key: String, function: (Message<P>) -> Any) {
9797
this.delegate.propertyFunction(key, function)
9898
}
9999

@@ -105,7 +105,7 @@ class KotlinEnricherSpec(override val delegate: EnricherSpec)
105105
this.delegate.header(name, expression, overwrite)
106106
}
107107

108-
fun <P> headerFunction(name: String, function: (Message<P>) -> Any, overwrite: Boolean?) {
108+
fun <P: Any> headerFunction(name: String, function: (Message<P>) -> Any, overwrite: Boolean?) {
109109
this.delegate.header(name, function, overwrite)
110110
}
111111

spring-integration-core/src/main/kotlin/org/springframework/integration/dsl/KotlinIntegrationFlowDefinition.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -901,7 +901,7 @@ class KotlinIntegrationFlowDefinition(@PublishedApi internal val delegate: Integ
901901
* the `org.springframework.integration.handler.LoggingHandler`
902902
* as a default logging category and function for the log message.
903903
*/
904-
fun <P> log(function: (Message<P>) -> Any) {
904+
fun <P: Any> log(function: (Message<P>) -> Any) {
905905
this.delegate.log(function)
906906
}
907907

@@ -948,7 +948,7 @@ class KotlinIntegrationFlowDefinition(@PublishedApi internal val delegate: Integ
948948
* the `org.springframework.integration.handler.LoggingHandler`
949949
* as a default logging category and function for the log message.
950950
*/
951-
fun <P> log(level: LoggingHandler.Level, function: (Message<P>) -> Any) {
951+
fun <P: Any> log(level: LoggingHandler.Level, function: (Message<P>) -> Any) {
952952
this.delegate.log(level, function)
953953
}
954954

@@ -958,7 +958,7 @@ class KotlinIntegrationFlowDefinition(@PublishedApi internal val delegate: Integ
958958
* [LoggingHandler.Level] logging level,
959959
* the provided logging category and function for the log message.
960960
*/
961-
fun <P> log(category: String, function: (Message<P>) -> Any) {
961+
fun <P: Any> log(category: String, function: (Message<P>) -> Any) {
962962
this.delegate.log(category, function)
963963
}
964964

@@ -968,7 +968,7 @@ class KotlinIntegrationFlowDefinition(@PublishedApi internal val delegate: Integ
968968
* [LoggingHandler.Level] logging level, logging category
969969
* and function for the log message.
970970
*/
971-
fun <P> log(level: LoggingHandler.Level, category: String, function: (Message<P>) -> Any) {
971+
fun <P: Any> log(level: LoggingHandler.Level, category: String, function: (Message<P>) -> Any) {
972972
this.delegate.log(level, category, function)
973973
}
974974

@@ -1075,7 +1075,7 @@ class KotlinIntegrationFlowDefinition(@PublishedApi internal val delegate: Integ
10751075
* wrap it to a [Flux], apply provided function via [Flux.transform]
10761076
* and emit the result to one more [FluxMessageChannel], subscribed in the downstream flow.
10771077
*/
1078-
fun <I, O> fluxTransform(fluxFunction: (Flux<Message<I>>) -> Publisher<O>) {
1078+
fun <I: Any, O> fluxTransform(fluxFunction: (Flux<Message<I>>) -> Publisher<O>) {
10791079
this.delegate.fluxTransform(fluxFunction)
10801080
}
10811081

spring-integration-core/src/test/kotlin/org/springframework/integration/dsl/KotlinDslTests.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020-2024 the original author or authors.
2+
* Copyright 2020-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -197,7 +197,7 @@ class KotlinDslTests {
197197

198198
val receive = replyChannel.receive(10_000)
199199
assertThat(receive?.payload).isNotNull().isEqualTo("TEST")
200-
assertThat(receive.headers).doesNotContain("headerToRemove", null)
200+
assertThat(receive?.headers).isNotNull().doesNotContain("headerToRemove", null)
201201
assertThat(this.wireTapChannel.receive(10_000)?.payload).isNotNull().isEqualTo("test")
202202
}
203203

spring-integration-http/src/main/java/org/springframework/integration/http/aot/HttpRuntimeHints.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2022 the original author or authors.
2+
* Copyright 2022-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -16,6 +16,8 @@
1616

1717
package org.springframework.integration.http.aot;
1818

19+
import org.jspecify.annotations.Nullable;
20+
1921
import org.springframework.aot.hint.MemberCategory;
2022
import org.springframework.aot.hint.ReflectionHints;
2123
import org.springframework.aot.hint.RuntimeHints;
@@ -34,7 +36,7 @@
3436
class HttpRuntimeHints implements RuntimeHintsRegistrar {
3537

3638
@Override
37-
public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
39+
public void registerHints(RuntimeHints hints, @Nullable ClassLoader classLoader) {
3840
ReflectionHints reflectionHints = hints.reflection();
3941
reflectionHints.registerType(WebHandler.class, MemberCategory.INVOKE_PUBLIC_METHODS);
4042

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/**
22
* Provides classes to support Spring AOT.
33
*/
4-
@org.springframework.lang.NonNullApi
5-
@org.springframework.lang.NonNullFields
4+
@org.jspecify.annotations.NullMarked
65
package org.springframework.integration.http.aot;

spring-integration-http/src/main/java/org/springframework/integration/http/dsl/Http.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2023 the original author or authors.
2+
* Copyright 2016-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -19,12 +19,13 @@
1919
import java.net.URI;
2020
import java.util.function.Function;
2121

22+
import org.jspecify.annotations.Nullable;
23+
2224
import org.springframework.expression.Expression;
2325
import org.springframework.expression.common.LiteralExpression;
2426
import org.springframework.integration.expression.FunctionExpression;
2527
import org.springframework.integration.http.inbound.HttpRequestHandlingController;
2628
import org.springframework.integration.http.inbound.HttpRequestHandlingMessagingGateway;
27-
import org.springframework.lang.Nullable;
2829
import org.springframework.messaging.Message;
2930
import org.springframework.util.Assert;
3031
import org.springframework.web.client.RestTemplate;

spring-integration-http/src/main/java/org/springframework/integration/http/dsl/HttpInboundEndpointSupportSpec.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017-2024 the original author or authors.
2+
* Copyright 2017-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -22,6 +22,8 @@
2222
import java.util.function.Consumer;
2323
import java.util.function.Function;
2424

25+
import org.jspecify.annotations.Nullable;
26+
2527
import org.springframework.core.ResolvableType;
2628
import org.springframework.expression.Expression;
2729
import org.springframework.http.HttpEntity;
@@ -36,7 +38,6 @@
3638
import org.springframework.integration.http.inbound.RequestMapping;
3739
import org.springframework.integration.http.support.DefaultHttpHeaderMapper;
3840
import org.springframework.integration.mapping.HeaderMapper;
39-
import org.springframework.lang.Nullable;
4041
import org.springframework.util.Assert;
4142
import org.springframework.validation.Validator;
4243
import org.springframework.web.bind.annotation.RequestMethod;

spring-integration-http/src/main/java/org/springframework/integration/http/dsl/HttpMessageHandlerSpec.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2023 the original author or authors.
2+
* Copyright 2016-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -19,13 +19,14 @@
1919
import java.net.URI;
2020
import java.util.Arrays;
2121

22+
import org.jspecify.annotations.Nullable;
23+
2224
import org.springframework.expression.Expression;
2325
import org.springframework.expression.common.LiteralExpression;
2426
import org.springframework.http.client.ClientHttpRequestFactory;
2527
import org.springframework.http.converter.HttpMessageConverter;
2628
import org.springframework.integration.expression.ValueExpression;
2729
import org.springframework.integration.http.outbound.HttpRequestExecutingMessageHandler;
28-
import org.springframework.lang.Nullable;
2930
import org.springframework.util.Assert;
3031
import org.springframework.web.client.ResponseErrorHandler;
3132
import org.springframework.web.client.RestTemplate;
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/**
22
* Provides HTTP Components support for Spring Integration Java DSL.
33
*/
4-
@org.springframework.lang.NonNullApi
5-
@org.springframework.lang.NonNullFields
4+
@org.jspecify.annotations.NullMarked
65
package org.springframework.integration.http.dsl;

0 commit comments

Comments
 (0)