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
commit a46f130c5f960c8f90b6e26d82f53cdee4c4ca2b Author: Aurélien Pupier <[email protected]> AuthorDate: Fri Sep 25 16:46:13 2026 +0200 Do not use shared singleton service for Zookeeper Integration tests to stabilize test suite Signed-off-by: Aurélien Pupier <[email protected]> --- .../component/zookeeper/integration/ConsumeDataIT.java | 14 ++++++++------ .../zookeeper/integration/ZooKeeperITSupport.java | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/components/camel-zookeeper/src/test/java/org/apache/camel/component/zookeeper/integration/ConsumeDataIT.java b/components/camel-zookeeper/src/test/java/org/apache/camel/component/zookeeper/integration/ConsumeDataIT.java index 78c9f199c352..4af7c5323c95 100644 --- a/components/camel-zookeeper/src/test/java/org/apache/camel/component/zookeeper/integration/ConsumeDataIT.java +++ b/components/camel-zookeeper/src/test/java/org/apache/camel/component/zookeeper/integration/ConsumeDataIT.java @@ -30,11 +30,13 @@ import static org.junit.jupiter.api.Assertions.assertTrue; public class ConsumeDataIT extends ZooKeeperITSupport { + private static final String ENDPOINT_ZOOKEEPER_ID = "/camel-ConsumeDataIT"; + @Override protected RouteBuilder[] createRouteBuilders() { return new RouteBuilder[] { new RouteBuilder() { public void configure() { - from("zookeeper://{{zookeeper.connection.string}}/camel-ConsumeDataIT?repeat=true") + from("zookeeper://{{zookeeper.connection.string}}/" + ENDPOINT_ZOOKEEPER_ID + "?repeat=true") .to("mock:zookeeper-data"); } } }; @@ -64,7 +66,7 @@ public class ConsumeDataIT extends ZooKeeperITSupport { updateNode(10); delay(500); - client.deleteAll("/camel-ConsumeDataIT"); + client.deleteAll(ENDPOINT_ZOOKEEPER_ID); MockEndpoint.assertIsSatisfied(30, TimeUnit.SECONDS); @@ -90,7 +92,7 @@ public class ConsumeDataIT extends ZooKeeperITSupport { delay(500); // by now we are back waiting for a change so delete the node - client.deleteAll("/camel-ConsumeDataIT"); + client.deleteAll(ENDPOINT_ZOOKEEPER_ID); // recreate and update a number of times. createCamelNode(); @@ -98,20 +100,20 @@ public class ConsumeDataIT extends ZooKeeperITSupport { MockEndpoint.assertIsSatisfied(30, TimeUnit.SECONDS); - client.deleteAll("/camel-ConsumeDataIT"); + client.deleteAll(ENDPOINT_ZOOKEEPER_ID); } private void updateNode(int times) throws Exception { for (int x = 1; x < times; x++) { delay(500); - client.setData("/camel-ConsumeDataIT", testPayload + "_" + x, -1); + client.setData(ENDPOINT_ZOOKEEPER_ID, testPayload + "_" + x, -1); } } private void createCamelNode() throws Exception { try { delay(1000); - client.create("/camel-ConsumeDataIT", testPayload + "_0"); + client.create(ENDPOINT_ZOOKEEPER_ID, testPayload + "_0"); } catch (NodeExistsException e) { } } diff --git a/components/camel-zookeeper/src/test/java/org/apache/camel/component/zookeeper/integration/ZooKeeperITSupport.java b/components/camel-zookeeper/src/test/java/org/apache/camel/component/zookeeper/integration/ZooKeeperITSupport.java index 0102a16a495b..c902797161aa 100644 --- a/components/camel-zookeeper/src/test/java/org/apache/camel/component/zookeeper/integration/ZooKeeperITSupport.java +++ b/components/camel-zookeeper/src/test/java/org/apache/camel/component/zookeeper/integration/ZooKeeperITSupport.java @@ -45,7 +45,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; public class ZooKeeperITSupport extends CamelTestSupport { @RegisterExtension - static ZooKeeperService service = ZooKeeperServiceFactory.createSingletonService(); + static ZooKeeperService service = ZooKeeperServiceFactory.createService(); protected String testPayload = "This is a test"; protected byte[] testPayloadBytes = testPayload.getBytes();
