Skip to content

Commit d50375d

Browse files
committed
Add more static imports to MockMvc snippets
Closes gh-26311
1 parent fb2e532 commit d50375d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/docs/asciidoc/testing.adoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7045,6 +7045,8 @@ To perform requests that use any HTTP method, as the following example shows:
70457045
[source,java,indent=0,subs="verbatim,quotes",role="primary"]
70467046
.Java
70477047
----
7048+
// static import of MockMvcRequestBuilders.*
7049+
70487050
mockMvc.perform(post("/hotels/{id}", 42).accept(MediaType.APPLICATION_JSON));
70497051
----
70507052

@@ -7176,6 +7178,8 @@ performing a request, as the following example shows:
71767178
[source,java,indent=0,subs="verbatim,quotes",role="primary"]
71777179
.Java
71787180
----
7181+
// static import of MockMvcRequestBuilders.* and MockMvcResultMatchers.*
7182+
71797183
mockMvc.perform(get("/accounts/1")).andExpect(status().isOk());
71807184
----
71817185

@@ -7369,6 +7373,8 @@ or reactive type such as Reactor `Mono`:
73697373
[source,java,indent=0,subs="verbatim,quotes",role="primary"]
73707374
.Java
73717375
----
7376+
// static import of MockMvcRequestBuilders.* and MockMvcResultMatchers.*
7377+
73727378
@Test
73737379
void test() throws Exception {
73747380
MvcResult mvcResult = this.mockMvc.perform(get("/path"))

0 commit comments

Comments
 (0)