Assert status quo & add TODO

Issue: SPR-13537
master
Sam Brannen 9 years ago
parent 1c6febc45c
commit c52f9d3524
  1. 6
      spring-web/src/test/java/org/springframework/web/util/UriComponentsBuilderTests.java

@ -42,6 +42,7 @@ import static org.junit.Assert.*;
* @author Phillip Webb * @author Phillip Webb
* @author Oliver Gierke * @author Oliver Gierke
* @author David Eckel * @author David Eckel
* @author Sam Brannen
*/ */
public class UriComponentsBuilderTests { public class UriComponentsBuilderTests {
@ -609,18 +610,23 @@ public class UriComponentsBuilderTests {
public void queryParamWithValueWithEquals() throws Exception { public void queryParamWithValueWithEquals() throws Exception {
UriComponents uriComponents = UriComponentsBuilder.fromUriString("http://example.com/foo?bar=baz").build(); UriComponents uriComponents = UriComponentsBuilder.fromUriString("http://example.com/foo?bar=baz").build();
assertThat(uriComponents.toUriString(), equalTo("http://example.com/foo?bar=baz")); assertThat(uriComponents.toUriString(), equalTo("http://example.com/foo?bar=baz"));
assertThat(uriComponents.getQueryParams().get("bar").get(0), equalTo("baz"));
} }
@Test @Test
public void queryParamWithoutValueWithEquals() throws Exception { public void queryParamWithoutValueWithEquals() throws Exception {
UriComponents uriComponents = UriComponentsBuilder.fromUriString("http://example.com/foo?bar=").build(); UriComponents uriComponents = UriComponentsBuilder.fromUriString("http://example.com/foo?bar=").build();
assertThat(uriComponents.toUriString(), equalTo("http://example.com/foo?bar=")); assertThat(uriComponents.toUriString(), equalTo("http://example.com/foo?bar="));
assertThat(uriComponents.getQueryParams().get("bar").get(0), equalTo(""));
} }
@Test @Test
public void queryParamWithoutValueWithoutEquals() throws Exception { public void queryParamWithoutValueWithoutEquals() throws Exception {
UriComponents uriComponents = UriComponentsBuilder.fromUriString("http://example.com/foo?bar").build(); UriComponents uriComponents = UriComponentsBuilder.fromUriString("http://example.com/foo?bar").build();
assertThat(uriComponents.toUriString(), equalTo("http://example.com/foo?bar")); 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 @Test

Loading…
Cancel
Save