Skip to content

Commit 7e4884f

Browse files
pcvolkmersnicoll
authored andcommitted
Add missing Kotlin example for expectAll()
See gh-33341
1 parent 38a3d18 commit 7e4884f

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

framework-docs/modules/ROOT/pages/testing/webtestclient.adoc

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,19 @@ Java::
339339
spec -> spec.expectHeader().contentType(MediaType.APPLICATION_JSON)
340340
);
341341
----
342+
343+
Kotlin::
344+
+
345+
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
346+
----
347+
client.get().uri("/persons/1")
348+
.accept(MediaType.APPLICATION_JSON)
349+
.exchange()
350+
.expectAll(
351+
{ spec -> spec.expectStatus().isOk() },
352+
{ spec -> spec.expectHeader().contentType(MediaType.APPLICATION_JSON) }
353+
)
354+
----
342355
======
343356

344357
You can then choose to decode the response body through one of the following:
@@ -704,4 +717,3 @@ Kotlin::
704717
.andExpect(model().attribute("string", "a string value"));
705718
----
706719
======
707-

0 commit comments

Comments
 (0)