From 132f3c91f460fdb56324fdc5008704a782da8387 Mon Sep 17 00:00:00 2001 From: Khokhlov Aleksey Date: Wed, 8 Nov 2023 23:09:02 +0400 Subject: [PATCH] reset redis before ClusterCommandTest added --- .../jedis/commands/jedis/ClusterCommandsTest.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/test/java/redis/clients/jedis/commands/jedis/ClusterCommandsTest.java b/src/test/java/redis/clients/jedis/commands/jedis/ClusterCommandsTest.java index 374ba93b62..aa265bec59 100644 --- a/src/test/java/redis/clients/jedis/commands/jedis/ClusterCommandsTest.java +++ b/src/test/java/redis/clients/jedis/commands/jedis/ClusterCommandsTest.java @@ -13,9 +13,9 @@ import org.junit.After; import org.junit.AfterClass; import org.junit.Before; +import org.junit.BeforeClass; import org.junit.Test; -import redis.clients.jedis.BuilderFactory; import redis.clients.jedis.HostAndPort; import redis.clients.jedis.Jedis; import redis.clients.jedis.args.ClusterResetType; @@ -51,8 +51,17 @@ public void tearDown() { node2.disconnect(); } + @BeforeClass + public static void resetRedisBefore() { + removeSlots(); + } + @AfterClass - public static void removeSlots() throws InterruptedException { + public static void resetRedisAfter() { + removeSlots(); + } + + public static void removeSlots() { try (Jedis node = new Jedis(nodeInfo1)) { node.auth("cluster"); node.clusterReset(ClusterResetType.SOFT);