diff --git a/spring-webflux/src/main/kotlin/org/springframework/web/reactive/function/BodyExtractorsExtensions.kt b/spring-webflux/src/main/kotlin/org/springframework/web/reactive/function/BodyExtractorsExtensions.kt index 287e460868..b084b16825 100644 --- a/spring-webflux/src/main/kotlin/org/springframework/web/reactive/function/BodyExtractorsExtensions.kt +++ b/spring-webflux/src/main/kotlin/org/springframework/web/reactive/function/BodyExtractorsExtensions.kt @@ -12,7 +12,7 @@ import kotlin.reflect.KClass * @since 5.0 * @see [KT-11968](https://youtrack.jetbrains.com/issue/KT-11968) */ -inline fun toMono(): BodyExtractor, ReactiveHttpInputMessage> = +inline fun bodyToMono(): BodyExtractor, ReactiveHttpInputMessage> = BodyExtractors.toMono(T::class.java) /** @@ -22,7 +22,7 @@ inline fun toMono(): BodyExtractor, ReactiveHttpInputM * @since 5.0 * @see [KT-11968](https://youtrack.jetbrains.com/issue/KT-11968) */ -fun toMono(elementClass: KClass): BodyExtractor, ReactiveHttpInputMessage> = +fun bodyToMono(elementClass: KClass): BodyExtractor, ReactiveHttpInputMessage> = BodyExtractors.toMono(elementClass.java) /** @@ -32,7 +32,7 @@ fun toMono(elementClass: KClass): BodyExtractor, ReactiveHt * @since 5.0 * @see [KT-11968](https://youtrack.jetbrains.com/issue/KT-11968) */ -inline fun toFlux(): BodyExtractor, ReactiveHttpInputMessage> = +inline fun bodyToFlux(): BodyExtractor, ReactiveHttpInputMessage> = BodyExtractors.toFlux(T::class.java) /** @@ -42,5 +42,5 @@ inline fun toFlux(): BodyExtractor, ReactiveHttpInputM * @since 5.0 * @see [KT-11968](https://youtrack.jetbrains.com/issue/KT-11968) */ -fun toFlux(elementClass: KClass): BodyExtractor, ReactiveHttpInputMessage> = +fun bodyToFlux(elementClass: KClass): BodyExtractor, ReactiveHttpInputMessage> = BodyExtractors.toFlux(elementClass.java) diff --git a/spring-webflux/src/main/kotlin/org/springframework/web/reactive/function/BodyInsertersExtensions.kt b/spring-webflux/src/main/kotlin/org/springframework/web/reactive/function/BodyInsertersExtensions.kt index 14a4e12996..7dbc3b2cb1 100644 --- a/spring-webflux/src/main/kotlin/org/springframework/web/reactive/function/BodyInsertersExtensions.kt +++ b/spring-webflux/src/main/kotlin/org/springframework/web/reactive/function/BodyInsertersExtensions.kt @@ -10,7 +10,7 @@ import org.springframework.http.server.reactive.ServerHttpResponse * @author Sebastien Deleuze * @since 5.0 */ -inline fun , reified S : Any> fromPublisher(publisher: T): BodyInserter = +inline fun , reified S : Any> bodyFromPublisher(publisher: T): BodyInserter = BodyInserters.fromPublisher(publisher, S::class.java) /** @@ -19,5 +19,5 @@ inline fun , reified S : Any> fromPublisher(publisher: * @author Sebastien Deleuze * @since 5.0 */ -inline fun , reified S : Any> fromServerSentEvents(publisher: T): BodyInserter = +inline fun , reified S : Any> bodyFromServerSentEvents(publisher: T): BodyInserter = BodyInserters.fromServerSentEvents(publisher, S::class.java) diff --git a/spring-webflux/src/test/kotlin/org/springframework/web/reactive/function/BodyExtractorsExtensionsTests.kt b/spring-webflux/src/test/kotlin/org/springframework/web/reactive/function/BodyExtractorsExtensionsTests.kt index 884e19c06f..40d7849b56 100644 --- a/spring-webflux/src/test/kotlin/org/springframework/web/reactive/function/BodyExtractorsExtensionsTests.kt +++ b/spring-webflux/src/test/kotlin/org/springframework/web/reactive/function/BodyExtractorsExtensionsTests.kt @@ -15,23 +15,23 @@ import org.mockito.junit.MockitoJUnitRunner class BodyExtractorsExtensionsTests { @Test - fun `toMono with KClass`() { - assertNotNull(toMono(Foo::class)) + fun `bodyToMono with KClass`() { + assertNotNull(bodyToMono(Foo::class)) } @Test - fun `toMono with reified type parameter`() { - assertNotNull(toMono()) + fun `bodyToMono with reified type parameter`() { + assertNotNull(bodyToMono()) } @Test - fun `toFlux with KClass`() { - assertNotNull(toFlux(Foo::class)) + fun `bodyToFlux with KClass`() { + assertNotNull(bodyToFlux(Foo::class)) } @Test - fun `toFlux with reified type parameter`() { - assertNotNull(toFlux()) + fun `bodyToFlux with reified type parameter`() { + assertNotNull(bodyToFlux()) } class Foo diff --git a/spring-webflux/src/test/kotlin/org/springframework/web/reactive/function/BodyInsertersExtensionsTests.kt b/spring-webflux/src/test/kotlin/org/springframework/web/reactive/function/BodyInsertersExtensionsTests.kt index bfadffdf20..f68d8ad6e8 100644 --- a/spring-webflux/src/test/kotlin/org/springframework/web/reactive/function/BodyInsertersExtensionsTests.kt +++ b/spring-webflux/src/test/kotlin/org/springframework/web/reactive/function/BodyInsertersExtensionsTests.kt @@ -17,15 +17,15 @@ import org.reactivestreams.Publisher class BodyInsertersExtensionsTests { @Test - fun `fromPublisher with reified type parameters`() { + fun `bodyFromPublisher with reified type parameters`() { val publisher = mock>() - assertNotNull(fromPublisher(publisher)) + assertNotNull(bodyFromPublisher(publisher)) } @Test - fun `fromServerSentEvents with reified type parameters`() { + fun `bodyFromServerSentEvents with reified type parameters`() { val publisher = mock>() - assertNotNull(fromServerSentEvents(publisher)) + assertNotNull(bodyFromServerSentEvents(publisher)) } class Foo