Browse Source

Polish

pull/32926/head
Stéphane Nicoll 2 years ago
parent
commit
2d1e58b928
  1. 9
      spring-test/src/main/java/org/springframework/test/web/servlet/request/MockHttpServletRequestBuilder.java
  2. 4
      spring-test/src/main/java/org/springframework/test/web/servlet/request/MockMvcRequestBuilders.java

9
spring-test/src/main/java/org/springframework/test/web/servlet/request/MockHttpServletRequestBuilder.java

@ -145,7 +145,7 @@ public class MockHttpServletRequestBuilder @@ -145,7 +145,7 @@ public class MockHttpServletRequestBuilder
* <p>Although this class cannot be extended, additional ways to initialize
* the {@code MockHttpServletRequest} can be plugged in via
* {@link #with(RequestPostProcessor)}.
* @param httpMethod the HTTP method (GET, POST, etc)
* @param httpMethod the HTTP method (GET, POST, etc.)
* @param url a URL template; the resulting URL will be encoded
* @param vars zero or more URI variables
*/
@ -164,7 +164,7 @@ public class MockHttpServletRequestBuilder @@ -164,7 +164,7 @@ public class MockHttpServletRequestBuilder
/**
* Alternative to {@link #MockHttpServletRequestBuilder(HttpMethod, String, Object...)}
* with a pre-built URI.
* @param httpMethod the HTTP method (GET, POST, etc)
* @param httpMethod the HTTP method (GET, POST, etc.)
* @param url the URL
* @since 4.0.3
*/
@ -797,7 +797,7 @@ public class MockHttpServletRequestBuilder @@ -797,7 +797,7 @@ public class MockHttpServletRequestBuilder
}
}
catch (Exception ex) {
// Must be invalid, ignore..
// Must be invalid, ignore
}
}
}
@ -894,7 +894,8 @@ public class MockHttpServletRequestBuilder @@ -894,7 +894,8 @@ public class MockHttpServletRequestBuilder
HttpInputMessage message = new HttpInputMessage() {
@Override
public InputStream getBody() {
return (content != null ? new ByteArrayInputStream(content) : InputStream.nullInputStream());
byte[] bodyContent = MockHttpServletRequestBuilder.this.content;
return (bodyContent != null ? new ByteArrayInputStream(bodyContent) : InputStream.nullInputStream());
}
@Override
public HttpHeaders getHeaders() {

4
spring-test/src/main/java/org/springframework/test/web/servlet/request/MockMvcRequestBuilders.java

@ -176,7 +176,7 @@ public abstract class MockMvcRequestBuilders { @@ -176,7 +176,7 @@ public abstract class MockMvcRequestBuilders {
/**
* Create a {@link MockHttpServletRequestBuilder} for a request with the given HTTP method.
* @param method the HTTP method (GET, POST, etc)
* @param method the HTTP method (GET, POST, etc.)
* @param urlTemplate a URL template; the resulting URL will be encoded
* @param uriVariables zero or more URI variables
*/
@ -186,7 +186,7 @@ public abstract class MockMvcRequestBuilders { @@ -186,7 +186,7 @@ public abstract class MockMvcRequestBuilders {
/**
* Create a {@link MockHttpServletRequestBuilder} for a request with the given HTTP method.
* @param httpMethod the HTTP method (GET, POST, etc)
* @param httpMethod the HTTP method (GET, POST, etc.)
* @param uri the URL
* @since 4.0.3
*/

Loading…
Cancel
Save