Skip to content

Commit e2832ea

Browse files
authored
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
1 parent 74f5819 commit e2832ea

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,17 @@ all failures will be tracked and reported.
445445
content().contentType("application/json;charset=UTF-8"));
446446
----
447447

448+
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
449+
.Kotlin
450+
----
451+
import org.springframework.test.web.servlet.get
452+
453+
mockMvc.get("/accounts/1").andExpectAll {
454+
status { isOk() }
455+
content { contentType(APPLICATION_JSON) }
456+
}
457+
----
458+
448459
`MockMvcResultMatchers.*` provides a number of expectations, some of which are further
449460
nested with more detailed expectations.
450461

0 commit comments

Comments
 (0)