From 45a4f6fc39f6aebdf27778fc1a7e1132842cd36b Mon Sep 17 00:00:00 2001 From: Clebert Suconic Date: Fri, 17 Apr 2020 16:32:13 -0400 Subject: [PATCH] ARTEMIS-2720 Additional test I wrote a small / quick test while I was testing the PR #3089 and I decided to keep it with the PR --- .../artemis/core/settings/RepositoryTest.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/core/settings/RepositoryTest.java b/artemis-server/src/test/java/org/apache/activemq/artemis/core/settings/RepositoryTest.java index bdcd493e98..7770472299 100644 --- a/artemis-server/src/test/java/org/apache/activemq/artemis/core/settings/RepositoryTest.java +++ b/artemis-server/src/test/java/org/apache/activemq/artemis/core/settings/RepositoryTest.java @@ -65,6 +65,18 @@ public class RepositoryTest extends ActiveMQTestBase { Assert.assertEquals("abd#", repo.getMatch("a.b.d")); } + @Test + public void testCacheWithWildcards() throws Throwable { + HierarchicalObjectRepository repo = new HierarchicalObjectRepository<>(); + + repo.addMatch("#", "root"); + Assert.assertEquals("root", repo.getMatch("b")); + + repo.addMatch("b", "leaf"); + Assert.assertEquals("leaf", repo.getMatch("b")); + } + + @Test public void testMatchingDocsCustomUnderscorDelimiter() throws Throwable { WildcardConfiguration wildcardConfiguration = new WildcardConfiguration();