Skip to content

Commit

Permalink
Polish spring-projects#29727: Mention Kotlin andExpectAll in referenc…
Browse files Browse the repository at this point in the history
…e manual (spring-projects#29766)

This just adds a Kotlin snippet alongside the Java snippet in the
reference manual.

Relates to spring-projectsgh-29727
Closes spring-projectsgh-27317
  • Loading branch information
simonbasle authored and mdeinum committed Jun 29, 2023
1 parent 8a43da1 commit db0d67b
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down

0 comments on commit db0d67b

Please sign in to comment.