|
|
|
@ -70,6 +70,7 @@ import org.springframework.web.util.UriUtils; |
|
|
|
* {@code MockHttpServletRequest} can be plugged in via {@link #with(RequestPostProcessor)}. |
|
|
|
* {@code MockHttpServletRequest} can be plugged in via {@link #with(RequestPostProcessor)}. |
|
|
|
* |
|
|
|
* |
|
|
|
* @author Rossen Stoyanchev |
|
|
|
* @author Rossen Stoyanchev |
|
|
|
|
|
|
|
* @author Juergen Hoeller |
|
|
|
* @author Arjen Poutsma |
|
|
|
* @author Arjen Poutsma |
|
|
|
* @author Sam Brannen |
|
|
|
* @author Sam Brannen |
|
|
|
* @author Kamill Sokol |
|
|
|
* @author Kamill Sokol |
|
|
|
@ -630,10 +631,13 @@ public class MockHttpServletRequestBuilder |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (this.content != null && this.contentType != null) { |
|
|
|
if (this.content != null && this.content.length > 0) { |
|
|
|
MediaType mediaType = MediaType.parseMediaType(this.contentType); |
|
|
|
String requestContentType = request.getContentType(); |
|
|
|
if (MediaType.APPLICATION_FORM_URLENCODED.includes(mediaType)) { |
|
|
|
if (requestContentType != null) { |
|
|
|
addRequestParams(request, parseFormData(mediaType)); |
|
|
|
MediaType mediaType = MediaType.parseMediaType(requestContentType); |
|
|
|
|
|
|
|
if (MediaType.APPLICATION_FORM_URLENCODED.includes(mediaType)) { |
|
|
|
|
|
|
|
addRequestParams(request, parseFormData(mediaType)); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|