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

apupier pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new 0803b0440172 [camel-hazelcast] Flaky unit test 
HazelcastReplicatedmapConsumerTest.testRemove
0803b0440172 is described below

commit 0803b04401721b7b1a0dfeb132d90fb4bf0e47f9
Author: JinyuChen97 <[email protected]>
AuthorDate: Tue Mar 10 12:51:23 2026 +0000

    [camel-hazelcast] Flaky unit test 
HazelcastReplicatedmapConsumerTest.testRemove
    
    https://issues.apache.org/jira/browse/CAMEL-22506
---
 .../HazelcastReplicatedmapConsumerTest.java         | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git 
a/components/camel-hazelcast/src/test/java/org/apache/camel/component/hazelcast/HazelcastReplicatedmapConsumerTest.java
 
b/components/camel-hazelcast/src/test/java/org/apache/camel/component/hazelcast/HazelcastReplicatedmapConsumerTest.java
index 047562447da6..5f15432f88d0 100644
--- 
a/components/camel-hazelcast/src/test/java/org/apache/camel/component/hazelcast/HazelcastReplicatedmapConsumerTest.java
+++ 
b/components/camel-hazelcast/src/test/java/org/apache/camel/component/hazelcast/HazelcastReplicatedmapConsumerTest.java
@@ -28,7 +28,9 @@ import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.test.junit6.CamelTestSupport;
 import org.awaitility.Awaitility;
 import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.TestInstance;
 
@@ -54,6 +56,25 @@ public class HazelcastReplicatedmapConsumerTest extends 
CamelTestSupport {
         }
     }
 
+    @BeforeEach
+    public void resetState() {
+        map.clear();
+        MockEndpoint.resetMocks(context);
+    }
+
+    @AfterEach
+    public void debugMocks() {
+        context.getEndpoints().stream()
+                .filter(e -> e instanceof MockEndpoint)
+                .map(e -> (MockEndpoint) e)
+                .forEach(m -> {
+                    System.out.println(
+                            m.getEndpointUri()
+                                       + " expected=" + m.getExpectedCount()
+                                       + " received=" + 
m.getReceivedCounter());
+                });
+    }
+
     @Override
     protected CamelContext createCamelContext() throws Exception {
         CamelContext context = super.createCamelContext();

Reply via email to