}
@Test
public void getPattern() {
// relative path
pattern = new AuthTargetPattern("test");
assertMatches(false, "/a/b/test");
assertMatches(false, "/a/test/");
assertMatches(false, "/a/test/b");
assertMatches(true, "/test");
assertMatches(true, "/test/");
assertMatches(true, "/test/b");
assertMatches(false, "/atest");
assertMatches(false, "/testb");
assertMatches(false, "/atestb");
assertMatches(false, "test");
assertMatches(false, "test/");
// abs path
pattern = new AuthTargetPattern("/t/est");
assertMatches(false, "/a/b/t/est");
assertMatches(false, "/a/t/est/");
assertMatches(false, "/a/t/est/b");
assertMatches(true, "/t/est");
assertMatches(true, "/t/est/");
assertMatches(true, "/t/est/b");
assertMatches(false, "/at/est");
assertMatches(false, "/t/estb");
assertMatches(false, "/at/estb");
assertMatches(false, "t/est");
assertMatches(false, "t/est/");
// root path
pattern = new AuthTargetPattern("/");
assertMatches(true, null);
assertMatches(true, " ");
assertMatches(true, " /");
}