diff --git a/src/test/java/org/elasticsearch/test/unit/common/path/PathTrieTests.java b/src/test/java/org/elasticsearch/test/unit/common/path/PathTrieTests.java index 249762c19b2..57a14f70f70 100644 --- a/src/test/java/org/elasticsearch/test/unit/common/path/PathTrieTests.java +++ b/src/test/java/org/elasticsearch/test/unit/common/path/PathTrieTests.java @@ -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 trie = new PathTrie(); + trie.insert("{test}", "test1"); + trie.insert("b", "test2"); + trie.insert("{test}/a", "test3"); + trie.insert("b/a", "test4"); + + Map params = newHashMap(); + assertThat(trie.retrieve("/b", params), equalTo("test2")); + assertThat(trie.retrieve("/b/a", params), equalTo("test4")); + } }