Polish "Return consistent collection type for matrix variables"
See gh-31483
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -22,6 +22,7 @@ import java.util.Collections;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.assertj.core.api.InstanceOfAssertFactories;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@@ -139,6 +140,19 @@ public class MatrixVariablesMapMethodArgumentResolverTests {
|
||||
assertThat(mapAll.get("colors")).isEqualTo("red");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void resolveMultiValueMapArgumentNoParams() {
|
||||
|
||||
MethodParameter param = this.testMethod.annot(matrixAttribute().noPathVar())
|
||||
.arg(MultiValueMap.class, String.class, String.class);
|
||||
|
||||
Object result = this.resolver.resolveArgument(param,
|
||||
new BindingContext(), this.exchange).block(Duration.ZERO);
|
||||
|
||||
assertThat(result).isInstanceOf(MultiValueMap.class)
|
||||
.asInstanceOf(InstanceOfAssertFactories.MAP).isEmpty();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void resolveArgumentNoParams() throws Exception {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user