diff --git a/docs/src/test/java/com/example/AlwaysDo.java b/docs/src/test/java/com/example/AlwaysDo.java index 9962b217..d4575b9a 100644 --- a/docs/src/test/java/com/example/AlwaysDo.java +++ b/docs/src/test/java/com/example/AlwaysDo.java @@ -25,18 +25,18 @@ import org.springframework.test.web.servlet.setup.MockMvcBuilders; import org.springframework.web.context.WebApplicationContext; public class AlwaysDo { - + private MockMvc mockMvc; - + private WebApplicationContext context; // tag::always-do[] @Before public void setUp() { - this.mockMvc = MockMvcBuilders.webAppContextSetup(this.context) - .apply(documentationConfiguration()) - .alwaysDo(document("{method-name}/{step}/")) - .build(); + this.mockMvc = MockMvcBuilders.webAppContextSetup(this.context) + .apply(documentationConfiguration()) + .alwaysDo(document("{method-name}/{step}/")) + .build(); } // end::always-do[] } diff --git a/docs/src/test/java/com/example/CustomEncoding.java b/docs/src/test/java/com/example/CustomEncoding.java index 997ab9c3..1c72fcff 100644 --- a/docs/src/test/java/com/example/CustomEncoding.java +++ b/docs/src/test/java/com/example/CustomEncoding.java @@ -25,12 +25,12 @@ import org.springframework.test.web.servlet.setup.MockMvcBuilders; import org.springframework.web.context.WebApplicationContext; public class CustomEncoding { - + @Autowired private WebApplicationContext context; - + private MockMvc mockMvc; - + @Before public void setUp() { // tag::custom-encoding[] diff --git a/docs/src/test/java/com/example/CustomUriConfiguration.java b/docs/src/test/java/com/example/CustomUriConfiguration.java index 845481d4..265e414b 100644 --- a/docs/src/test/java/com/example/CustomUriConfiguration.java +++ b/docs/src/test/java/com/example/CustomUriConfiguration.java @@ -25,12 +25,12 @@ import org.springframework.test.web.servlet.setup.MockMvcBuilders; import org.springframework.web.context.WebApplicationContext; public class CustomUriConfiguration { - + @Autowired private WebApplicationContext context; - + private MockMvc mockMvc; - + @Before public void setUp() { // tag::custom-uri-configuration[] diff --git a/docs/src/test/java/com/example/ExampleApplicationTests.java b/docs/src/test/java/com/example/ExampleApplicationTests.java index 2ac5f6b9..e6c97e44 100644 --- a/docs/src/test/java/com/example/ExampleApplicationTests.java +++ b/docs/src/test/java/com/example/ExampleApplicationTests.java @@ -25,13 +25,13 @@ import org.springframework.web.context.WebApplicationContext; import static org.springframework.restdocs.RestDocumentation.documentationConfiguration; public class ExampleApplicationTests { - + // tag::mock-mvc-setup[] @Autowired private WebApplicationContext context; - + private MockMvc mockMvc; - + @Before public void setUp() { this.mockMvc = MockMvcBuilders.webAppContextSetup(this.context) diff --git a/docs/src/test/java/com/example/Hypermedia.java b/docs/src/test/java/com/example/Hypermedia.java index 8c69f2db..a9e0de17 100644 --- a/docs/src/test/java/com/example/Hypermedia.java +++ b/docs/src/test/java/com/example/Hypermedia.java @@ -26,9 +26,9 @@ import org.springframework.http.MediaType; import org.springframework.test.web.servlet.MockMvc; public class Hypermedia { - + private MockMvc mockMvc; - + public void links() throws Exception { // tag::links[] this.mockMvc.perform(get("/").accept(MediaType.APPLICATION_JSON)) @@ -38,16 +38,16 @@ public class Hypermedia { linkWithRel("bravo").description("Link to the bravo resource"))); // <3> // end::links[] } - + public void explicitExtractor() throws Exception { this.mockMvc.perform(get("/").accept(MediaType.APPLICATION_JSON)) .andExpect(status().isOk()) //tag::explicit-extractor[] .andDo(document("index").withLinks(halLinks(), // <1> - linkWithRel("alpha").description("Link to the alpha resource"), + linkWithRel("alpha").description("Link to the alpha resource"), linkWithRel("bravo").description("Link to the bravo resource"))); // end::explicit-extractor[] } - + } diff --git a/docs/src/test/java/com/example/InvokeService.java b/docs/src/test/java/com/example/InvokeService.java index 7a863eab..18fc8508 100644 --- a/docs/src/test/java/com/example/InvokeService.java +++ b/docs/src/test/java/com/example/InvokeService.java @@ -26,7 +26,7 @@ import org.springframework.test.web.servlet.MockMvc; public class InvokeService { private MockMvc mockMvc; - + public void invokeService() throws Exception { // tag::invoke-service[] this.mockMvc.perform(get("/").accept(MediaType.APPLICATION_JSON)) // <1> @@ -34,5 +34,5 @@ public class InvokeService { .andDo(document("index")); // <3> // end::invoke-service[] } - + } diff --git a/docs/src/test/java/com/example/Payload.java b/docs/src/test/java/com/example/Payload.java index ddfd7579..bec0f361 100644 --- a/docs/src/test/java/com/example/Payload.java +++ b/docs/src/test/java/com/example/Payload.java @@ -26,9 +26,9 @@ import org.springframework.restdocs.payload.FieldType; import org.springframework.test.web.servlet.MockMvc; public class Payload { - + private MockMvc mockMvc; - + public void response() throws Exception { // tag::response[] this.mockMvc.perform(get("/user/5").accept(MediaType.APPLICATION_JSON)) @@ -38,7 +38,7 @@ private MockMvc mockMvc; fieldWithPath("contact.email").description("The user's email address"))); // <3> // end::response[] } - + public void explicitType() throws Exception { this.mockMvc.perform(get("/user/5").accept(MediaType.APPLICATION_JSON)) .andExpect(status().isOk()) diff --git a/docs/src/test/java/com/example/QueryParameters.java b/docs/src/test/java/com/example/QueryParameters.java index 682d2387..ca81142c 100644 --- a/docs/src/test/java/com/example/QueryParameters.java +++ b/docs/src/test/java/com/example/QueryParameters.java @@ -26,7 +26,7 @@ import org.springframework.test.web.servlet.MockMvc; public class QueryParameters { private MockMvc mockMvc; - + public void queryParameters() throws Exception { // tag::query-parameters[] this.mockMvc.perform(get("/users?page=2&per_page=100")) @@ -37,5 +37,5 @@ public class QueryParameters { )); // end::query-parameters[] } - + } diff --git a/docs/src/test/java/com/example/ResponsePostProcessing.java b/docs/src/test/java/com/example/ResponsePostProcessing.java index 605b4534..c9a6bcb0 100644 --- a/docs/src/test/java/com/example/ResponsePostProcessing.java +++ b/docs/src/test/java/com/example/ResponsePostProcessing.java @@ -25,7 +25,7 @@ import org.springframework.test.web.servlet.MockMvc; public class ResponsePostProcessing { private MockMvc mockMvc; - + public void general() throws Exception { // tag::general[] this.mockMvc.perform(get("/")) @@ -34,5 +34,5 @@ public class ResponsePostProcessing { .andDocument("index")); // <2> // end::general[] } - + }