Skip to content

Polish #808

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

```
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]:

```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down