File tree 2 files changed +13
-2
lines changed
main/kotlin/org/springframework/test/web/servlet
test/kotlin/org/springframework/test/web/servlet
2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2019 the original author or authors.
2
+ * Copyright 2002-2024 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -116,6 +116,7 @@ open class MockHttpServletRequestDsl internal constructor (private val builder:
116
116
var params: MultiValueMap <String , String >? = null
117
117
118
118
/* *
119
+ * @since 6.1.5
119
120
* @see [MockHttpServletRequestBuilder.queryParam]
120
121
*/
121
122
fun queryParam (name : String , vararg values : String ) {
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2023 the original author or authors.
2
+ * Copyright 2002-2024 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -219,6 +219,16 @@ class MockMvcExtensionsTests {
219
219
" Content type expected:<text/plain> but was:<application/json>" )
220
220
}
221
221
222
+ @Test
223
+ fun queryParameter () {
224
+ val result = mockMvc.get(" /" ) {
225
+ queryParam(" foo" , " bar" )
226
+ queryParam(" foo" , " baz" )
227
+ }.andReturn()
228
+ assertThat(result.request.parameterMap[" foo" ]).containsExactly(" bar" , " baz" )
229
+ assertThat(result.request.queryString).isEqualTo(" foo=bar&foo=baz" )
230
+ }
231
+
222
232
223
233
@RestController
224
234
private class PersonController {
You can’t perform that action at this time.
0 commit comments