File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
web/src/test/java/org/springframework/security/web/servlet Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 17
17
package org .springframework .security .web .servlet ;
18
18
19
19
import java .util .LinkedHashMap ;
20
+ import java .util .List ;
20
21
import java .util .Map ;
21
22
import java .util .function .Consumer ;
22
23
import java .util .regex .Matcher ;
27
28
import org .springframework .http .HttpMethod ;
28
29
import org .springframework .mock .web .MockHttpServletRequest ;
29
30
import org .springframework .util .StringUtils ;
31
+ import org .springframework .web .util .UriComponentsBuilder ;
30
32
31
33
public final class TestMockHttpServletRequests {
32
34
@@ -149,6 +151,14 @@ public Builder serverName(String serverName) {
149
151
150
152
public MockHttpServletRequest build () {
151
153
MockHttpServletRequest request = new MockHttpServletRequest ();
154
+ Map <String , List <String >> params = UriComponentsBuilder .fromUriString ("?" + this .queryString )
155
+ .build ()
156
+ .getQueryParams ();
157
+ for (Map .Entry <String , List <String >> entry : params .entrySet ()) {
158
+ for (String value : entry .getValue ()) {
159
+ request .addParameter (entry .getKey (), value );
160
+ }
161
+ }
152
162
applyElement (request ::setContextPath , this .contextPath );
153
163
applyElement (request ::setContextPath , this .contextPath );
154
164
applyElement (request ::setMethod , this .method .name ());
You can’t perform that action at this time.
0 commit comments