Skip to content

Commit ddee309

Browse files
committed
Merge pull request #33341 from pcvolkmer
* pr/33341: Add missing Kotlin example for expectAll() Closes gh-33341
2 parents 38a3d18 + 7e4884f commit ddee309

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)