Various MultiValueMap improvements
This commit makes several improvements to MultiValueMap: - asSingleValueMap offers a single-value view (as opposed to the existing toSingleValueMap, which offers a copy) - fromSingleValue is a static method that adapts a Map<?,?> to the MultiValueMap interface - fromMultiValue is a static method that adapts a Map<?,List<?>> to the MultiValueMap interface Closes gh-32832
This commit is contained in:
@@ -206,7 +206,7 @@ class MultipartRouterFunctionIntegrationTests extends AbstractRouterFunctionInte
|
||||
return request
|
||||
.body(BodyExtractors.toMultipartData())
|
||||
.flatMap(map -> {
|
||||
Map<String, Part> parts = map.toSingleValueMap();
|
||||
Map<String, Part> parts = map.asSingleValueMap();
|
||||
try {
|
||||
assertThat(parts).hasSize(2);
|
||||
assertThat(((FilePart) parts.get("fooPart")).filename()).isEqualTo("foo.txt");
|
||||
|
||||
Reference in New Issue
Block a user