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

@@ -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")
}