From 878f8cd3d9bfb7198c063f7b505125877f0f0c8e Mon Sep 17 00:00:00 2001 From: Artem Bilan Date: Thu, 15 Sep 2022 12:35:19 -0400 Subject: [PATCH] Improve some ZK tests --- .../integration/zookeeper/ZookeeperTestSupport.java | 11 +---------- .../metadata/ZookeeperMetadataStoreTests.java | 5 +++-- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/spring-integration-zookeeper/src/test/java/org/springframework/integration/zookeeper/ZookeeperTestSupport.java b/spring-integration-zookeeper/src/test/java/org/springframework/integration/zookeeper/ZookeeperTestSupport.java index 0beb57e67f..cc1513633f 100644 --- a/spring-integration-zookeeper/src/test/java/org/springframework/integration/zookeeper/ZookeeperTestSupport.java +++ b/spring-integration-zookeeper/src/test/java/org/springframework/integration/zookeeper/ZookeeperTestSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -81,13 +81,4 @@ public class ZookeeperTestSupport { return client; } - protected void closeClient(CuratorFramework client) { - try { - CloseableUtils.closeQuietly(client); - } - catch (Exception e) { - log.warn("Exception thrown while closing client: ", e); - } - } - } diff --git a/spring-integration-zookeeper/src/test/java/org/springframework/integration/zookeeper/metadata/ZookeeperMetadataStoreTests.java b/spring-integration-zookeeper/src/test/java/org/springframework/integration/zookeeper/metadata/ZookeeperMetadataStoreTests.java index 0019695420..e67ffd9e82 100644 --- a/spring-integration-zookeeper/src/test/java/org/springframework/integration/zookeeper/metadata/ZookeeperMetadataStoreTests.java +++ b/spring-integration-zookeeper/src/test/java/org/springframework/integration/zookeeper/metadata/ZookeeperMetadataStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -56,7 +56,7 @@ public class ZookeeperMetadataStoreTests extends ZookeeperTestSupport { @BeforeEach public void setUp() { super.setUp(); - this.metadataStore = new ZookeeperMetadataStore(client); + this.metadataStore = new ZookeeperMetadataStore(this.client); this.metadataStore.start(); } @@ -65,6 +65,7 @@ public class ZookeeperMetadataStoreTests extends ZookeeperTestSupport { public void tearDown() throws Exception { this.metadataStore.stop(); this.client.delete().deletingChildrenIfNeeded().forPath(this.metadataStore.getRoot()); + super.tearDown(); } @Test