You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2023/11/14 07:01:21 UTC

(camel) 02/02: CAMEL-20109: Remove endpoint did not work if URI has # sign. Thanks to Peter Nowak for unit test.

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch remove-endpoint
in repository https://gitbox.apache.org/repos/asf/camel.git

commit a3f2f033a6d1ddbd8a8e1eca41bb9de62b64484c
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Tue Nov 14 08:00:47 2023 +0100

    CAMEL-20109: Remove endpoint did not work if URI has # sign. Thanks to Peter Nowak for unit test.
---
 .../org/apache/camel/impl/DefaultEndpointRegistryTest.java | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/core/camel-core/src/test/java/org/apache/camel/impl/DefaultEndpointRegistryTest.java b/core/camel-core/src/test/java/org/apache/camel/impl/DefaultEndpointRegistryTest.java
index 0bc1270c54e..84a72fa7f70 100644
--- a/core/camel-core/src/test/java/org/apache/camel/impl/DefaultEndpointRegistryTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/impl/DefaultEndpointRegistryTest.java
@@ -53,6 +53,20 @@ public class DefaultEndpointRegistryTest {
         Assertions.assertEquals(2, ctx.getEndpoints().size());
     }
 
+    @Test
+    public void testRemoveEndpointWithHash() throws Exception {
+        DefaultCamelContext ctx = new DefaultCamelContext();
+        ctx.start();
+
+        ctx.getEndpoint("direct:one");
+        Endpoint e = ctx.getEndpoint("stub:me?bean=#myBean");
+        ctx.getEndpoint("direct:three");
+
+        Assertions.assertEquals(3, ctx.getEndpoints().size());
+        ctx.removeEndpoint(e);
+        Assertions.assertEquals(2, ctx.getEndpoints().size());
+    }
+
     @Test
     public void testRemoveEndpointToD() throws Exception {
         DefaultCamelContext ctx = new DefaultCamelContext();