diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 34627e39..8fa8a907 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -31,7 +31,7 @@ None of these is essential for a pull request, but they will all help ### Building from source -To build the source you will need Java 8 or later. +To build the source you will need Java 17 or later. The code is built with Gradle: ``` diff --git a/README.md b/README.md index a29c5891..e48f2435 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ To learn more about Spring REST Docs, please consult the [reference documentatio ## Building from source -You will need Java 8 or later to build Spring REST Docs. +You will need Java 17 or later to build Spring REST Docs. It is built using [Gradle][10]: ``` diff --git a/docs/src/test/java/com/example/mockmvc/ExampleApplicationJUnit5Tests.java b/docs/src/test/java/com/example/mockmvc/ExampleApplicationJUnit5Tests.java index a2e6ccc6..5b7faaef 100644 --- a/docs/src/test/java/com/example/mockmvc/ExampleApplicationJUnit5Tests.java +++ b/docs/src/test/java/com/example/mockmvc/ExampleApplicationJUnit5Tests.java @@ -28,14 +28,14 @@ import static org.springframework.restdocs.mockmvc.MockMvcRestDocumentation.documentationConfiguration; @ExtendWith(RestDocumentationExtension.class) -public class ExampleApplicationJUnit5Tests { +class ExampleApplicationJUnit5Tests { @SuppressWarnings("unused") // tag::setup[] private MockMvc mockMvc; @BeforeEach - public void setUp(WebApplicationContext webApplicationContext, RestDocumentationContextProvider restDocumentation) { + void setUp(WebApplicationContext webApplicationContext, RestDocumentationContextProvider restDocumentation) { this.mockMvc = MockMvcBuilders.webAppContextSetup(webApplicationContext) .apply(documentationConfiguration(restDocumentation)) // <1> .build(); diff --git a/docs/src/test/java/com/example/restassured/ExampleApplicationJUnit5Tests.java b/docs/src/test/java/com/example/restassured/ExampleApplicationJUnit5Tests.java index 7fa9bf1f..e3bcd3e0 100644 --- a/docs/src/test/java/com/example/restassured/ExampleApplicationJUnit5Tests.java +++ b/docs/src/test/java/com/example/restassured/ExampleApplicationJUnit5Tests.java @@ -27,14 +27,14 @@ import static org.springframework.restdocs.restassured.RestAssuredRestDocumentation.documentationConfiguration; @ExtendWith(RestDocumentationExtension.class) -public class ExampleApplicationJUnit5Tests { +class ExampleApplicationJUnit5Tests { @SuppressWarnings("unused") // tag::setup[] private RequestSpecification spec; @BeforeEach - public void setUp(RestDocumentationContextProvider restDocumentation) { + void setUp(RestDocumentationContextProvider restDocumentation) { this.spec = new RequestSpecBuilder().addFilter(documentationConfiguration(restDocumentation)) // <1> .build(); } diff --git a/docs/src/test/java/com/example/webtestclient/ExampleApplicationJUnit5Tests.java b/docs/src/test/java/com/example/webtestclient/ExampleApplicationJUnit5Tests.java index 10379ab4..a323bbac 100644 --- a/docs/src/test/java/com/example/webtestclient/ExampleApplicationJUnit5Tests.java +++ b/docs/src/test/java/com/example/webtestclient/ExampleApplicationJUnit5Tests.java @@ -27,14 +27,14 @@ import static org.springframework.restdocs.webtestclient.WebTestClientRestDocumentation.documentationConfiguration; @ExtendWith(RestDocumentationExtension.class) -public class ExampleApplicationJUnit5Tests { +class ExampleApplicationJUnit5Tests { @SuppressWarnings("unused") // tag::setup[] private WebTestClient webTestClient; @BeforeEach - public void setUp(ApplicationContext applicationContext, RestDocumentationContextProvider restDocumentation) { + void setUp(ApplicationContext applicationContext, RestDocumentationContextProvider restDocumentation) { this.webTestClient = WebTestClient.bindToApplicationContext(applicationContext).configureClient() .filter(documentationConfiguration(restDocumentation)) // <1> .build(); diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/preprocess/Preprocessors.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/preprocess/Preprocessors.java index a70b2169..d8ae46bb 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/preprocess/Preprocessors.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/preprocess/Preprocessors.java @@ -149,7 +149,7 @@ public static ParametersModifyingOperationPreprocessor modifyParameters() { /** * Returns a {@code HeadersModifyingOperationPreprocessor} that can then be configured - * to modify the headers of the request. + * to modify the headers of the request or response. * @return the preprocessor * @since 3.0.0 */ diff --git a/spring-restdocs-core/src/test/java/org/springframework/restdocs/operation/preprocess/HeadersModifyingOperationPreprocessorTests.java b/spring-restdocs-core/src/test/java/org/springframework/restdocs/operation/preprocess/HeadersModifyingOperationPreprocessorTests.java index ad55d141..9028c564 100644 --- a/spring-restdocs-core/src/test/java/org/springframework/restdocs/operation/preprocess/HeadersModifyingOperationPreprocessorTests.java +++ b/spring-restdocs-core/src/test/java/org/springframework/restdocs/operation/preprocess/HeadersModifyingOperationPreprocessorTests.java @@ -90,10 +90,10 @@ public void removeNonExistentHeader() { @Test public void removeHeader() { - OperationPreprocessor preprocessor = this.preprocessor.remove("a"); - assertThat(preprocessor.preprocess(createRequest((headers) -> headers.add("a", "apple"))).getHeaders()) + this.preprocessor.remove("a"); + assertThat(this.preprocessor.preprocess(createRequest((headers) -> headers.add("a", "apple"))).getHeaders()) .doesNotContainKey("a"); - assertThat(preprocessor.preprocess(createResponse((headers) -> headers.add("a", "apple"))).getHeaders()) + assertThat(this.preprocessor.preprocess(createResponse((headers) -> headers.add("a", "apple"))).getHeaders()) .doesNotContainKey("a"); } diff --git a/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/RestDocumentationRequestBuilders.java b/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/RestDocumentationRequestBuilders.java index 6dc03adb..cd957d05 100644 --- a/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/RestDocumentationRequestBuilders.java +++ b/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/RestDocumentationRequestBuilders.java @@ -231,7 +231,7 @@ public static MockMultipartHttpServletRequestBuilder multipart(String urlTemplat /** * Create a {@link MockMultipartHttpServletRequestBuilder} for a multipart request. * @param uri the URL - * @return the builder for the file upload request + * @return the builder for the multipart request * @since 2.0.6 */ public static MockMultipartHttpServletRequestBuilder multipart(URI uri) {