Skip to content

Commit c52f9d3

Browse files
committed
Assert status quo & add TODO
Issue: SPR-13537
1 parent 1c6febc commit c52f9d3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

spring-web/src/test/java/org/springframework/web/util/UriComponentsBuilderTests.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
* @author Phillip Webb
4343
* @author Oliver Gierke
4444
* @author David Eckel
45+
* @author Sam Brannen
4546
*/
4647
public class UriComponentsBuilderTests {
4748

@@ -609,18 +610,23 @@ public void buildAndExpandOpaque() {
609610
public void queryParamWithValueWithEquals() throws Exception {
610611
UriComponents uriComponents = UriComponentsBuilder.fromUriString("http://example.com/foo?bar=baz").build();
611612
assertThat(uriComponents.toUriString(), equalTo("http://example.com/foo?bar=baz"));
613+
assertThat(uriComponents.getQueryParams().get("bar").get(0), equalTo("baz"));
612614
}
613615

614616
@Test
615617
public void queryParamWithoutValueWithEquals() throws Exception {
616618
UriComponents uriComponents = UriComponentsBuilder.fromUriString("http://example.com/foo?bar=").build();
617619
assertThat(uriComponents.toUriString(), equalTo("http://example.com/foo?bar="));
620+
assertThat(uriComponents.getQueryParams().get("bar").get(0), equalTo(""));
618621
}
619622

620623
@Test
621624
public void queryParamWithoutValueWithoutEquals() throws Exception {
622625
UriComponents uriComponents = UriComponentsBuilder.fromUriString("http://example.com/foo?bar").build();
623626
assertThat(uriComponents.toUriString(), equalTo("http://example.com/foo?bar"));
627+
628+
// TODO [SPR-13537] Change equalTo(null) to equalTo("").
629+
assertThat(uriComponents.getQueryParams().get("bar").get(0), equalTo(null));
624630
}
625631

626632
@Test

0 commit comments

Comments
 (0)