Polish "Return consistent collection type for matrix variables"

See gh-31483
This commit is contained in:
Stéphane Nicoll
2023-10-24 10:49:41 +02:00
parent ea30c8fb5b
commit 9aa707ec4b
4 changed files with 42 additions and 20 deletions

View File

@@ -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.
@@ -21,6 +21,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;
@@ -163,8 +164,8 @@ public class MatrixVariablesMapMethodArgumentResolverTests {
Object result = this.resolver.resolveArgument(param, this.mavContainer, this.webRequest, null);
//noinspection unchecked
assertThat(result).isInstanceOfSatisfying(MultiValueMap.class, map -> assertThat(map).isEmpty());
assertThat(result).isInstanceOf(MultiValueMap.class)
.asInstanceOf(InstanceOfAssertFactories.MAP).isEmpty();
}
@Test