From e2832ea596908322d35f2ed3aceb300368373d8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Basl=C3=A9?= Date: Wed, 4 Jan 2023 19:11:54 +0100 Subject: [PATCH] Polish #29727: Mention Kotlin andExpectAll in reference manual (#29766) This just adds a Kotlin snippet alongside the Java snippet in the reference manual. Relates to gh-29727 Closes gh-27317 --- .../asciidoc/testing/spring-mvc-test-framework.adoc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/framework-docs/src/docs/asciidoc/testing/spring-mvc-test-framework.adoc b/framework-docs/src/docs/asciidoc/testing/spring-mvc-test-framework.adoc index 196212377fa..10f21afe611 100644 --- a/framework-docs/src/docs/asciidoc/testing/spring-mvc-test-framework.adoc +++ b/framework-docs/src/docs/asciidoc/testing/spring-mvc-test-framework.adoc @@ -445,6 +445,17 @@ all failures will be tracked and reported. content().contentType("application/json;charset=UTF-8")); ---- +[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"] +.Kotlin +---- + import org.springframework.test.web.servlet.get + + mockMvc.get("/accounts/1").andExpectAll { + status { isOk() } + content { contentType(APPLICATION_JSON) } + } +---- + `MockMvcResultMatchers.*` provides a number of expectations, some of which are further nested with more detailed expectations.