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
This commit is contained in:
Simon Baslé 2023-01-04 19:11:54 +01:00 committed by GitHub
parent 74f58198fd
commit e2832ea596
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 0 deletions

View File

@ -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.