SPR-5973: Cleaning it up
This commit is contained in:
@@ -19,9 +19,10 @@ package org.springframework.web.util;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
@@ -55,11 +56,11 @@ public class UriBuilderTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore("Working on it")
|
||||
public void templateVarsVarArgs() throws URISyntaxException {
|
||||
UriBuilder builder = UriBuilder.newInstance();
|
||||
URI result = builder.scheme("http").host("example.com").path("{foo}").build("bar");
|
||||
URI result = UriBuilder.fromPath("/{foo}/{bar}").build("baz", "qux");
|
||||
|
||||
URI expected = new URI("http://example.com/bar");
|
||||
URI expected = new URI("http://example.com/baz/qux");
|
||||
assertEquals("Invalid result URI", expected, result);
|
||||
}
|
||||
|
||||
@@ -82,11 +83,11 @@ public class UriBuilderTests {
|
||||
|
||||
@Test
|
||||
public void templateVarsMap() throws URISyntaxException {
|
||||
Map<String, String> vars = Collections.singletonMap("foo", "bar");
|
||||
UriBuilder builder = UriBuilder.newInstance();
|
||||
URI result = builder.scheme("http").host("example.com").path("{foo}").build(vars);
|
||||
|
||||
URI expected = new URI("http://example.com/bar");
|
||||
Map<String, String> vars = new HashMap<String, String>(2);
|
||||
vars.put("bar", "qux");
|
||||
vars.put("foo", "baz");
|
||||
URI result = UriBuilder.fromPath("/{foo}/{bar}").build(vars);
|
||||
URI expected = new URI("/baz/qux");
|
||||
assertEquals("Invalid result URI", expected, result);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user