|
25 | 25 | import java.util.Map;
|
26 | 26 | import java.util.stream.Stream;
|
27 | 27 |
|
28 |
| -import org.junit.jupiter.api.Assertions; |
29 | 28 | import org.junit.jupiter.params.ParameterizedTest;
|
30 | 29 | import org.junit.jupiter.params.provider.Arguments;
|
31 | 30 | import org.junit.jupiter.params.provider.MethodSource;
|
32 | 31 |
|
33 | 32 | import static org.assertj.core.api.Assertions.assertThat;
|
| 33 | +import static org.assertj.core.api.SoftAssertions.assertSoftly; |
34 | 34 | import static org.junit.jupiter.api.Named.named;
|
35 | 35 | import static org.junit.jupiter.params.provider.Arguments.arguments;
|
36 | 36 |
|
@@ -142,27 +142,28 @@ void equalsOnEmpty(MultiValueMap<String, String> map) {
|
142 | 142 | @ParameterizedMultiValueMapTest
|
143 | 143 | void canNotChangeAnUnmodifiableMultiValueMap(MultiValueMap<String, String> map) {
|
144 | 144 | MultiValueMap<String, String> asUnmodifiableMultiValueMap = CollectionUtils.unmodifiableMultiValueMap(map);
|
145 |
| - Assertions.assertAll( |
146 |
| - () -> Assertions.assertThrows(UnsupportedOperationException.class, |
147 |
| - () -> asUnmodifiableMultiValueMap.add("key", "value")), |
148 |
| - () -> Assertions.assertThrows(UnsupportedOperationException.class, |
149 |
| - () -> asUnmodifiableMultiValueMap.addIfAbsent("key", "value")), |
150 |
| - () -> Assertions.assertThrows(UnsupportedOperationException.class, |
151 |
| - () -> asUnmodifiableMultiValueMap.addAll("key", exampleListOfValues())), |
152 |
| - () -> Assertions.assertThrows(UnsupportedOperationException.class, |
153 |
| - () -> asUnmodifiableMultiValueMap.addAll(exampleMultiValueMap())), |
154 |
| - () -> Assertions.assertThrows(UnsupportedOperationException.class, |
155 |
| - () -> asUnmodifiableMultiValueMap.set("key", "value")), |
156 |
| - () -> Assertions.assertThrows(UnsupportedOperationException.class, |
157 |
| - () -> asUnmodifiableMultiValueMap.setAll(exampleHashMap())), |
158 |
| - () -> Assertions.assertThrows(UnsupportedOperationException.class, |
159 |
| - () -> asUnmodifiableMultiValueMap.put("key", exampleListOfValues())), |
160 |
| - () -> Assertions.assertThrows(UnsupportedOperationException.class, |
161 |
| - () -> asUnmodifiableMultiValueMap.putIfAbsent("key", exampleListOfValues())), |
162 |
| - () -> Assertions.assertThrows(UnsupportedOperationException.class, |
163 |
| - () -> asUnmodifiableMultiValueMap.putAll(exampleMultiValueMap())), |
164 |
| - () -> Assertions.assertThrows(UnsupportedOperationException.class, |
165 |
| - () -> asUnmodifiableMultiValueMap.remove("key1"))); |
| 145 | + assertSoftly(softly -> { |
| 146 | + softly.assertThatExceptionOfType(UnsupportedOperationException.class) |
| 147 | + .isThrownBy(() -> asUnmodifiableMultiValueMap.add("key", "value")); |
| 148 | + softly.assertThatExceptionOfType(UnsupportedOperationException.class) |
| 149 | + .isThrownBy(() -> asUnmodifiableMultiValueMap.addIfAbsent("key", "value")); |
| 150 | + softly.assertThatExceptionOfType(UnsupportedOperationException.class) |
| 151 | + .isThrownBy(() -> asUnmodifiableMultiValueMap.addAll("key", exampleListOfValues())); |
| 152 | + softly.assertThatExceptionOfType(UnsupportedOperationException.class) |
| 153 | + .isThrownBy(() -> asUnmodifiableMultiValueMap.addAll(exampleMultiValueMap())); |
| 154 | + softly.assertThatExceptionOfType(UnsupportedOperationException.class) |
| 155 | + .isThrownBy(() -> asUnmodifiableMultiValueMap.set("key", "value")); |
| 156 | + softly.assertThatExceptionOfType(UnsupportedOperationException.class) |
| 157 | + .isThrownBy(() -> asUnmodifiableMultiValueMap.setAll(exampleHashMap())); |
| 158 | + softly.assertThatExceptionOfType(UnsupportedOperationException.class) |
| 159 | + .isThrownBy(() -> asUnmodifiableMultiValueMap.put("key", exampleListOfValues())); |
| 160 | + softly.assertThatExceptionOfType(UnsupportedOperationException.class) |
| 161 | + .isThrownBy(() -> asUnmodifiableMultiValueMap.putIfAbsent("key", exampleListOfValues())); |
| 162 | + softly.assertThatExceptionOfType(UnsupportedOperationException.class) |
| 163 | + .isThrownBy(() -> asUnmodifiableMultiValueMap.putAll(exampleMultiValueMap())); |
| 164 | + softly.assertThatExceptionOfType(UnsupportedOperationException.class) |
| 165 | + .isThrownBy(() -> asUnmodifiableMultiValueMap.remove("key1")); |
| 166 | + }); |
166 | 167 | }
|
167 | 168 |
|
168 | 169 | private static List<String> exampleListOfValues() {
|
|
0 commit comments