Fixing tests after merge

This commit is contained in:
Ryan Baxter
2025-05-22 15:30:30 -04:00
parent a1a33ff3c4
commit 03eb741d68
2 changed files with 6 additions and 5 deletions

View File

@@ -350,7 +350,7 @@ public abstract class BeforeFilterFunctions {
queryParams.add(name, replacement);
}
MultiValueMap<String, String> encodedQueryParams = UriUtils.encodeQueryParams(queryParams);
MultiValueMap<String, String> encodedQueryParams = MvcUtils.encodeQueryParams(queryParams);
URI rewrittenUri = UriComponentsBuilder.fromUri(request.uri())
.replaceQueryParams(unmodifiableMultiValueMap(encodedQueryParams))
.build(true)

View File

@@ -117,9 +117,9 @@ class BeforeFilterFunctionsTests {
@Test
void rewriteEncodedRequestParameter() {
MockHttpServletRequest servletRequest = MockMvcRequestBuilders.get("http://localhost/path")
.param("foo", "bar")
.param("baz[]", "qux[]")
.param("quux", "corge+")
.param("foo[]", "bar")
.param("baz", "qux")
.param("quux", "corge+")
.buildRequest(null);
ServerRequest request = ServerRequest.create(servletRequest, Collections.emptyList());
@@ -128,7 +128,8 @@ class BeforeFilterFunctionsTests {
assertThat(result.param("foo[]")).isPresent().hasValue("replacement[]");
assertThat(result.param("quux")).isPresent().hasValue("corge+");
assertThat(result.uri().toString()).hasToString("http://localhost/path?baz=qux&foo%5B%5D=replacement%5B%5D&quux=corge%2B");
assertThat(result.uri().toString())
.hasToString("http://localhost/path?quux=corge%2B&baz=qux&foo%5B%5D=replacement%5B%5D");
}
@Test