summaryrefslogtreecommitdiffstats
path: root/container-core/src/test/java/com/yahoo/restapi/PathTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'container-core/src/test/java/com/yahoo/restapi/PathTest.java')
-rw-r--r--container-core/src/test/java/com/yahoo/restapi/PathTest.java15
1 files changed, 14 insertions, 1 deletions
diff --git a/container-core/src/test/java/com/yahoo/restapi/PathTest.java b/container-core/src/test/java/com/yahoo/restapi/PathTest.java
index 9e77dc7b3f0..566209d941b 100644
--- a/container-core/src/test/java/com/yahoo/restapi/PathTest.java
+++ b/container-core/src/test/java/com/yahoo/restapi/PathTest.java
@@ -11,7 +11,20 @@ import static org.junit.Assert.assertEquals;
* @author bratseth
*/
public class PathTest {
-
+
+ @Test
+ public void testWithPrefix() {
+ // Test that a path with a prefix matches spec
+ Path path = new Path("/ball/a/1/bar/fuz", "/ball");
+ assertTrue(path.matches("/a/{foo}/bar/{b}"));
+ assertEquals("1", path.get("foo"));
+ assertEquals("fuz", path.get("b"));
+
+ // One negative test where the prefix should not count
+ assertFalse(path.matches("/ball/a/{foo}/zoo/{b}"));
+ }
+
+
@Test
public void testPath() {
assertFalse(new Path("").matches("/a/{foo}/bar/{b}"));