Skip to content

Commit b9a0e6b

Browse files
committed
Update documentation about WebTestClient Kotlin issue
Issue: SPR-16057
1 parent 419b444 commit b9a0e6b

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

spring-test/src/main/java/org/springframework/test/web/reactive/server/WebTestClient.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,13 @@
6666
*
6767
* <p>See the static {@code bindToXxx} entry points for creating an instance.
6868
*
69+
* <p><strong>Warning</strong>: {@code WebTestClient} is not usable yet in Kotlin due to a
70+
* <a href="https://youtrack.jetbrains.com/issue/KT-5464">type inference issue</a> which is
71+
* expected to be fixed as of Kotlin 1.3. You can watch
72+
* <a href="https://jira.spring.io/browse/SPR-16057">SPR-16057</a> for up-to-date information.
73+
* Meanwhile, the proposed alternative is to use directly {@link WebClient} with its Reactor
74+
* and Spring Kotlin extensions to perform integration tests on an embedded WebFlux server.
75+
*
6976
* @author Rossen Stoyanchev
7077
* @since 5.0
7178
*/

src/docs/asciidoc/languages/kotlin.adoc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -654,6 +654,17 @@ class SpecificationLikeTests {
654654
----
655655

656656

657+
[[kotlin-webtestclient-issue]]
658+
==== `WebTestClient` type inference issue in Kotlin
659+
660+
`WebTestClient` is not usable yet in Kotlin due to a
661+
https://youtrack.jetbrains.com/issue/KT-5464[type inference issue] which is
662+
expected to be fixed as of Kotlin 1.3. You can watch
663+
https://jira.spring.io/browse/SPR-16057[SPR-16057] for up-to-date information. Meanwhile,
664+
the proposed alternative is to use directly `WebClient` with its Reactor and Spring Kotlin
665+
extensions to perform integration tests on an embedded WebFlux server.
666+
667+
657668

658669

659670
[[kotlin-getting-started]]
@@ -729,6 +740,7 @@ Here is a list of pending issues related to Spring + Kotlin support.
729740

730741
==== Spring Framework
731742

743+
* https://jira.spring.io/browse/SPR-16057[Unable to use WebTestClient with mock server in Kotlin]
732744
* https://jira.spring.io/browse/SPR-15413[Add support for Kotlin coroutines]
733745

734746

src/docs/asciidoc/testing-webtestclient.adoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ to any server over an HTTP connection. It can also bind directly to WebFlux appl
88
with <<testing.adoc#mock-objects-web-reactive,mock request and response>> objects,
99
without the need for an HTTP server.
1010

11+
[NOTE]
12+
====
13+
`WebTestClient` is not usable yet in Kotlin, see <<languages.adoc#kotlin-webtestclient-issue, this section>> for more details.
14+
====
1115

1216

1317

0 commit comments

Comments
 (0)