From 09c9cac857e07bf33c6894bfaff02fb07f45dc70 Mon Sep 17 00:00:00 2001 From: Johnny Lim Date: Sat, 21 May 2016 12:34:23 +0900 Subject: [PATCH] Polish --- docs/src/docs/asciidoc/getting-started.adoc | 4 ++-- docs/src/test/java/com/example/mockmvc/Payload.java | 2 +- .../test/java/com/example/restassured/Payload.java | 11 +++++------ .../preprocess/OperationPreprocessorAdapter.java | 2 +- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/docs/src/docs/asciidoc/getting-started.adoc b/docs/src/docs/asciidoc/getting-started.adoc index eb9c1fe5..094c64c2 100644 --- a/docs/src/docs/asciidoc/getting-started.adoc +++ b/docs/src/docs/asciidoc/getting-started.adoc @@ -171,7 +171,7 @@ static content] by Spring Boot. To do so, configure your project's build so that 1. The documentation is generated before the jar is built 2. The generated documentation is included in the jar -[source,xml,indent=0,role="primary",role="primary"] +[source,xml,indent=0,role="primary"] .Maven ---- <1> @@ -253,7 +253,7 @@ When using JUnit, the first step in generating documentation snippets is to decl snippets should be written. This output directory should match the snippets directory that you have configured in your `build.gradle` or `pom.xml` file. -For Maven (`pom.xml` that will typically be `target/generated-snippets` and for +For Maven (`pom.xml`) that will typically be `target/generated-snippets` and for Gradle (`build.gradle`) it will typically be `build/generated-snippets`: [source,java,indent=0,role="primary"] diff --git a/docs/src/test/java/com/example/mockmvc/Payload.java b/docs/src/test/java/com/example/mockmvc/Payload.java index b811c1a6..615354a3 100644 --- a/docs/src/test/java/com/example/mockmvc/Payload.java +++ b/docs/src/test/java/com/example/mockmvc/Payload.java @@ -80,7 +80,7 @@ public class Payload { this.mockMvc.perform(get("/books/1").accept(MediaType.APPLICATION_JSON)) .andExpect(status().isOk()) .andDo(document("book", responseFields(book))); // <1> - // end::single-book[] + // end::single-book[] // tag::book-array[] this.mockMvc.perform(get("/books").accept(MediaType.APPLICATION_JSON)) diff --git a/docs/src/test/java/com/example/restassured/Payload.java b/docs/src/test/java/com/example/restassured/Payload.java index 225eb619..155e357e 100644 --- a/docs/src/test/java/com/example/restassured/Payload.java +++ b/docs/src/test/java/com/example/restassured/Payload.java @@ -68,9 +68,9 @@ public class Payload { fieldWithPath("email").description("The user's email address") .attributes(key("constraints") .value("Must be a valid email address"))))) // <3> - // end::constraints[] - .when().post("/users") - .then().assertThat().statusCode(is(200)); + // end::constraints[] + .when().post("/users") + .then().assertThat().statusCode(is(200)); } public void descriptorReuse() throws Exception { @@ -90,10 +90,9 @@ public class Payload { .filter(document("books", responseFields( fieldWithPath("[]").description("An array of books")) // <1> .andWithPrefix("[].", book))) // <2> - .when().get("/books/1") - .then().assertThat().statusCode(is(200)); + .when().get("/books/1") + .then().assertThat().statusCode(is(200)); // end::book-array[] - } } diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/preprocess/OperationPreprocessorAdapter.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/preprocess/OperationPreprocessorAdapter.java index f2654c1b..544de0f4 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/preprocess/OperationPreprocessorAdapter.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/preprocess/OperationPreprocessorAdapter.java @@ -21,7 +21,7 @@ import org.springframework.restdocs.operation.OperationResponse; /** * An implementation of {@link OperationPreprocessor} that returns the request and - * response as-is. To be subclasses by preprocessor implementations that only modify the + * response as-is. To be subclassed by preprocessor implementations that only modify the * request or the response. * * @author Andy Wilkinson