|
1 | 1 | /*
|
2 |
| - * Copyright 2002-2024 the original author or authors. |
| 2 | + * Copyright 2002-2025 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
|
24 | 24 | import java.util.Arrays;
|
25 | 25 | import java.util.Collections;
|
26 | 26 | import java.util.List;
|
| 27 | +import java.util.Map; |
27 | 28 |
|
28 | 29 | import org.junit.jupiter.api.Test;
|
29 | 30 | import org.junit.jupiter.params.ParameterizedTest;
|
@@ -157,22 +158,22 @@ void expandWithFragmentOrder(ParserType parserType) {
|
157 | 158 |
|
158 | 159 | @Test
|
159 | 160 | void expandQueryParamWithArray() {
|
160 |
| - UriComponents uri = UriComponentsBuilder.fromPath("/hello") |
| 161 | + String uri = UriComponentsBuilder.fromPath("/hello") |
161 | 162 | .queryParam("name", "{name}")
|
162 |
| - .build(); |
163 |
| - uri = uri.expand(Collections.singletonMap("name", new String[]{"foo", "bar"})); |
| 163 | + .buildAndExpand(Map.of("name", new String[] {"foo", "bar"})) |
| 164 | + .toString(); |
164 | 165 |
|
165 |
| - assertThat(uri.toString()).hasToString("/hello?name=foo,bar"); |
| 166 | + assertThat(uri).isEqualTo("/hello?name=foo,bar"); |
166 | 167 | }
|
167 | 168 |
|
168 | 169 | @Test
|
169 | 170 | void expandQueryParamWithList() {
|
170 |
| - UriComponents uri = UriComponentsBuilder.fromPath("/hello") |
| 171 | + String uri = UriComponentsBuilder.fromPath("/hello") |
171 | 172 | .queryParam("name", "{name}")
|
172 |
| - .build(); |
173 |
| - uri = uri.expand(Collections.singletonMap("name", List.of("foo", "bar"))); |
| 173 | + .buildAndExpand(Map.of("name", List.of("foo", "bar"))) |
| 174 | + .toString(); |
174 | 175 |
|
175 |
| - assertThat(uri.toString()).hasToString("/hello?name=foo,bar"); |
| 176 | + assertThat(uri).isEqualTo("/hello?name=foo,bar"); |
176 | 177 | }
|
177 | 178 |
|
178 | 179 | @ParameterizedTest // SPR-12123
|
|
0 commit comments