Return consistent collection type for matrix variables

See gh-31483
This commit is contained in:
Bernie Schelberg
2023-10-24 17:08:13 +10:00
committed by Stéphane Nicoll
parent 6bdf7ad36a
commit ea30c8fb5b
2 changed files with 13 additions and 1 deletions

View File

@@ -155,6 +155,18 @@ public class MatrixVariablesMapMethodArgumentResolverTests {
assertThat(map).isEqualTo(Collections.emptyMap());
}
@Test
public void resolveMultiValueMapArgumentNoParams() throws Exception {
MethodParameter param = this.testMethod.annot(matrixAttribute().noPathVar())
.arg(MultiValueMap.class, String.class, String.class);
Object result = this.resolver.resolveArgument(param, this.mavContainer, this.webRequest, null);
//noinspection unchecked
assertThat(result).isInstanceOfSatisfying(MultiValueMap.class, map -> assertThat(map).isEmpty());
}
@Test
public void resolveArgumentNoMatch() throws Exception {
MultiValueMap<String, String> params2 = getVariablesFor("planes");