DATAREST-222 - Path now quotes reference before matching.
We now actively quote the String reference to match a path against as it most likely is not a regular expression.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013 the original author or authors.
|
||||
* Copyright 2013-2014 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -67,4 +67,20 @@ public class PathUnitTests {
|
||||
public void doesNotPrefixAbsoluteUris() {
|
||||
assertThat(new Path("http://localhost").toString(), is("http://localhost"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-222
|
||||
*/
|
||||
@Test
|
||||
public void doesNotMatchIfReferenceContainsReservedCharacters() {
|
||||
assertThat(new Path("/foobar").matches("barfoo{?foo}"), is(false));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-222
|
||||
*/
|
||||
@Test
|
||||
public void doesNotMatchNullReference() {
|
||||
assertThat(new Path("/foobar").matches(null), is(false));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user