File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
spring-web/src/test/java/org/springframework/web/util Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 4242 * @author Phillip Webb
4343 * @author Oliver Gierke
4444 * @author David Eckel
45+ * @author Sam Brannen
4546 */
4647public 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
You can’t perform that action at this time.
0 commit comments