This is an automated email from the ASF dual-hosted git repository. ctubbsii pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/accumulo.git
The following commit(s) were added to refs/heads/main by this push: new 40dc910caa Fix trivial unused variable warnings 40dc910caa is described below commit 40dc910caa840e7aa94f6f17b0521aa80a270050 Author: Christopher Tubbs <ctubb...@apache.org> AuthorDate: Wed Nov 27 18:40:41 2024 -0500 Fix trivial unused variable warnings * Remove 2 unused variables * Fix unused variable in ZookeeperLockCheckerTest by restoring the deleted test case by copying the original code from the 3.1 branch, and updating the implementation to match on a mock object --- .../core/clientImpl/ZookeeperLockCheckerTest.java | 19 +++++++++++++++++-- .../java/org/apache/accumulo/test/fate/FateIT.java | 1 - .../accumulo/test/fate/user/UserFateStoreIT.java | 3 --- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/core/src/test/java/org/apache/accumulo/core/clientImpl/ZookeeperLockCheckerTest.java b/core/src/test/java/org/apache/accumulo/core/clientImpl/ZookeeperLockCheckerTest.java index b047bbc3aa..9629c69ffc 100644 --- a/core/src/test/java/org/apache/accumulo/core/clientImpl/ZookeeperLockCheckerTest.java +++ b/core/src/test/java/org/apache/accumulo/core/clientImpl/ZookeeperLockCheckerTest.java @@ -18,13 +18,18 @@ */ package org.apache.accumulo.core.clientImpl; +import static org.easymock.EasyMock.anyObject; import static org.easymock.EasyMock.createMock; import static org.easymock.EasyMock.expect; +import static org.easymock.EasyMock.expectLastCall; import static org.easymock.EasyMock.replay; +import static org.easymock.EasyMock.verify; + +import java.util.function.Predicate; import org.apache.accumulo.core.fate.zookeeper.ZooCache; -import org.apache.accumulo.core.lock.ServiceLockPaths; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; public class ZookeeperLockCheckerTest { private ClientContext context; @@ -37,8 +42,18 @@ public class ZookeeperLockCheckerTest { expect(context.getZooKeeperRoot()).andReturn("/accumulo/iid").anyTimes(); zc = createMock(ZooCache.class); expect(context.getZooCache()).andReturn(zc).anyTimes(); - expect(context.getServerPaths()).andReturn(new ServiceLockPaths(context)).anyTimes(); replay(context); zklc = new ZookeeperLockChecker(context); } + + @Test + public void testInvalidateCache() { + @SuppressWarnings("unchecked") + Predicate<String> anyObj = anyObject(Predicate.class); + zc.clear(anyObj); + expectLastCall(); + replay(zc); + zklc.invalidateCache("server"); + verify(zc); + } } diff --git a/test/src/main/java/org/apache/accumulo/test/fate/FateIT.java b/test/src/main/java/org/apache/accumulo/test/fate/FateIT.java index d36e98bdec..d128f24a65 100644 --- a/test/src/main/java/org/apache/accumulo/test/fate/FateIT.java +++ b/test/src/main/java/org/apache/accumulo/test/fate/FateIT.java @@ -490,7 +490,6 @@ public abstract class FateIT extends SharedMiniClusterBase implements FateTestRu protected void testNoWriteAfterDelete(FateStore<TestEnv> store, ServerContext sctx) throws Exception { - final String tableName = getUniqueNames(1)[0]; final FateId fateId = store.create(); final Repo<TestEnv> repo = new TestRepo("testNoWriteAfterDelete"); diff --git a/test/src/main/java/org/apache/accumulo/test/fate/user/UserFateStoreIT.java b/test/src/main/java/org/apache/accumulo/test/fate/user/UserFateStoreIT.java index c82662182c..ead901b7ed 100644 --- a/test/src/main/java/org/apache/accumulo/test/fate/user/UserFateStoreIT.java +++ b/test/src/main/java/org/apache/accumulo/test/fate/user/UserFateStoreIT.java @@ -39,7 +39,6 @@ import org.apache.accumulo.core.data.Range; import org.apache.accumulo.core.data.Value; import org.apache.accumulo.core.fate.AbstractFateStore; import org.apache.accumulo.core.fate.FateId; -import org.apache.accumulo.core.fate.FateInstanceType; import org.apache.accumulo.core.fate.FateStore; import org.apache.accumulo.core.fate.ReadOnlyFateStore.TStatus; import org.apache.accumulo.core.fate.user.UserFateStore; @@ -62,8 +61,6 @@ import com.google.common.collect.MoreCollectors; public class UserFateStoreIT extends SharedMiniClusterBase { - private static final FateInstanceType fateInstanceType = FateInstanceType.USER; - @BeforeAll public static void setup() throws Exception { SharedMiniClusterBase.startMiniCluster();