From c52f9d35244720937398976ea7f1a6abc74a8443 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Sun, 4 Oct 2015 18:16:50 +0200 Subject: [PATCH] Assert status quo & add TODO Issue: SPR-13537 --- .../springframework/web/util/UriComponentsBuilderTests.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spring-web/src/test/java/org/springframework/web/util/UriComponentsBuilderTests.java b/spring-web/src/test/java/org/springframework/web/util/UriComponentsBuilderTests.java index e030d6f975..6b5e40e806 100644 --- a/spring-web/src/test/java/org/springframework/web/util/UriComponentsBuilderTests.java +++ b/spring-web/src/test/java/org/springframework/web/util/UriComponentsBuilderTests.java @@ -42,6 +42,7 @@ import static org.junit.Assert.*; * @author Phillip Webb * @author Oliver Gierke * @author David Eckel + * @author Sam Brannen */ public class UriComponentsBuilderTests { @@ -609,18 +610,23 @@ public class UriComponentsBuilderTests { public void queryParamWithValueWithEquals() throws Exception { UriComponents uriComponents = UriComponentsBuilder.fromUriString("http://example.com/foo?bar=baz").build(); assertThat(uriComponents.toUriString(), equalTo("http://example.com/foo?bar=baz")); + assertThat(uriComponents.getQueryParams().get("bar").get(0), equalTo("baz")); } @Test public void queryParamWithoutValueWithEquals() throws Exception { UriComponents uriComponents = UriComponentsBuilder.fromUriString("http://example.com/foo?bar=").build(); assertThat(uriComponents.toUriString(), equalTo("http://example.com/foo?bar=")); + assertThat(uriComponents.getQueryParams().get("bar").get(0), equalTo("")); } @Test public void queryParamWithoutValueWithoutEquals() throws Exception { UriComponents uriComponents = UriComponentsBuilder.fromUriString("http://example.com/foo?bar").build(); assertThat(uriComponents.toUriString(), equalTo("http://example.com/foo?bar")); + + // TODO [SPR-13537] Change equalTo(null) to equalTo(""). + assertThat(uriComponents.getQueryParams().get("bar").get(0), equalTo(null)); } @Test