DATAREST-93 - Further refactorings and refinements regarding the search resource mapping.

This commit is contained in:
Oliver Gierke
2013-07-12 14:20:32 +02:00
parent f8e53058f8
commit a4d8a22428
20 changed files with 332 additions and 122 deletions

View File

@@ -19,9 +19,10 @@ import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import org.junit.Test;
import org.springframework.data.rest.core.Path;
/**
* Unit tests for {@link Path}.
*
* @author Oliver Gierke
*/
public class PathUnitTests {
@@ -46,4 +47,19 @@ public class PathUnitTests {
Path builder = new Path("foo/ ").slash("/ b a r").slash(" //foobar/// ");
assertThat(builder.toString(), is("/foo/bar/foobar"));
}
@Test
public void matchesWithLeadingSlash() {
assertThat(new Path("/foobar").matches("/foobar"), is(true));
}
@Test
public void matchesWithoutLeadingSlash() {
assertThat(new Path("/foobar").matches("foobar"), is(true));
}
@Test
public void doesNotMatchIfDifferent() {
assertThat(new Path("/foobar").matches("barfoo"), is(false));
}
}