Browse Source

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
pull/29768/head
Simon Baslé 2 years ago committed by GitHub
parent
commit
e2832ea596
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      framework-docs/src/docs/asciidoc/testing/spring-mvc-test-framework.adoc

11
framework-docs/src/docs/asciidoc/testing/spring-mvc-test-framework.adoc

@ -445,6 +445,17 @@ all failures will be tracked and reported. @@ -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.

Loading…
Cancel
Save