From d50375da8e399d5d84e0270e9a7692724d37794b Mon Sep 17 00:00:00 2001 From: Rossen Stoyanchev Date: Wed, 6 Jan 2021 21:29:19 +0000 Subject: [PATCH] Add more static imports to MockMvc snippets Closes gh-26311 --- src/docs/asciidoc/testing.adoc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/docs/asciidoc/testing.adoc b/src/docs/asciidoc/testing.adoc index fdedf48499..10af1de780 100644 --- a/src/docs/asciidoc/testing.adoc +++ b/src/docs/asciidoc/testing.adoc @@ -7045,6 +7045,8 @@ To perform requests that use any HTTP method, as the following example shows: [source,java,indent=0,subs="verbatim,quotes",role="primary"] .Java ---- + // static import of MockMvcRequestBuilders.* + mockMvc.perform(post("/hotels/{id}", 42).accept(MediaType.APPLICATION_JSON)); ---- @@ -7176,6 +7178,8 @@ performing a request, as the following example shows: [source,java,indent=0,subs="verbatim,quotes",role="primary"] .Java ---- + // static import of MockMvcRequestBuilders.* and MockMvcResultMatchers.* + mockMvc.perform(get("/accounts/1")).andExpect(status().isOk()); ---- @@ -7369,6 +7373,8 @@ or reactive type such as Reactor `Mono`: [source,java,indent=0,subs="verbatim,quotes",role="primary"] .Java ---- + // static import of MockMvcRequestBuilders.* and MockMvcResultMatchers.* + @Test void test() throws Exception { MvcResult mvcResult = this.mockMvc.perform(get("/path"))