add another path trie test for wildcard vs. contant

This commit is contained in:
Shay Banon 2011-12-20 17:42:06 +02:00
parent dd6c076454
commit 2b838b808e
1 changed files with 13 additions and 0 deletions

View File

@ -98,4 +98,17 @@ public class PathTrieTests {
assertThat(trie.retrieve("/b/testX", params), equalTo("test2"));
assertThat(params.get("name"), equalTo("testX"));
}
@Test
public void testPreferNonWildcardExecution() {
PathTrie<String> trie = new PathTrie<String>();
trie.insert("{test}", "test1");
trie.insert("b", "test2");
trie.insert("{test}/a", "test3");
trie.insert("b/a", "test4");
Map<String, String> params = newHashMap();
assertThat(trie.retrieve("/b", params), equalTo("test2"));
assertThat(trie.retrieve("/b/a", params), equalTo("test4"));
}
}