@@ -428,8 +428,8 @@ public MockHttpServletRequestBuilder queryParams(MultiValueMap<String, String> p
428
428
}
429
429
430
430
/**
431
- * Appends the given value(s) to the given form field and also add to the
432
- * {@link #param(String, String...) request parameters} map.
431
+ * Append the given value(s) to the given form field and also add them to the
432
+ * {@linkplain #param(String, String...) request parameters} map.
433
433
* @param name the field name
434
434
* @param values one or more values
435
435
* @since 6.1.7
@@ -783,14 +783,14 @@ public final MockHttpServletRequest buildRequest(ServletContext servletContext)
783
783
if (this .content != null && this .content .length > 0 ) {
784
784
throw new IllegalStateException ("Could not write form data with an existing body" );
785
785
}
786
- Charset charset = (this .characterEncoding != null
787
- ? Charset .forName (this .characterEncoding ) : StandardCharsets .UTF_8 );
788
- MediaType mediaType = (request .getContentType () != null
789
- ? MediaType .parseMediaType (request .getContentType ())
790
- : new MediaType (MediaType .APPLICATION_FORM_URLENCODED , charset ));
786
+ Charset charset = (this .characterEncoding != null ?
787
+ Charset .forName (this .characterEncoding ) : StandardCharsets .UTF_8 );
788
+ MediaType mediaType = (request .getContentType () != null ?
789
+ MediaType .parseMediaType (request .getContentType ()) :
790
+ new MediaType (MediaType .APPLICATION_FORM_URLENCODED , charset ));
791
791
if (!mediaType .isCompatibleWith (MediaType .APPLICATION_FORM_URLENCODED )) {
792
- throw new IllegalStateException ("Invalid content type: '" + mediaType
793
- + "' is not compatible with '" + MediaType .APPLICATION_FORM_URLENCODED + "'" );
792
+ throw new IllegalStateException ("Invalid content type: '" + mediaType +
793
+ "' is not compatible with '" + MediaType .APPLICATION_FORM_URLENCODED + "'" );
794
794
}
795
795
request .setContent (writeFormData (mediaType , charset ));
796
796
if (request .getContentType () == null ) {
0 commit comments