diff --git a/src/test/java/redis/clients/jedis/ACLJedisPoolTest.java b/src/test/java/redis/clients/jedis/ACLJedisPoolTest.java index 0d160e8697..a019d518d4 100644 --- a/src/test/java/redis/clients/jedis/ACLJedisPoolTest.java +++ b/src/test/java/redis/clients/jedis/ACLJedisPoolTest.java @@ -4,13 +4,11 @@ import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; -import static io.redis.test.utils.RedisVersionUtil.getRedisVersion; - import java.net.URI; import java.net.URISyntaxException; import io.redis.test.annotations.SinceRedisVersion; -import io.redis.test.utils.RedisVersionRule; +import redis.clients.jedis.util.RedisVersionRule; import org.apache.commons.pool2.impl.GenericObjectPoolConfig; import org.junit.ClassRule; import org.junit.Test; diff --git a/src/test/java/redis/clients/jedis/ACLJedisSentinelPoolTest.java b/src/test/java/redis/clients/jedis/ACLJedisSentinelPoolTest.java index a14cfbbc9a..fb1fcc72e1 100644 --- a/src/test/java/redis/clients/jedis/ACLJedisSentinelPoolTest.java +++ b/src/test/java/redis/clients/jedis/ACLJedisSentinelPoolTest.java @@ -1,14 +1,12 @@ package redis.clients.jedis; import static org.junit.Assert.*; -import static io.redis.test.utils.RedisVersionUtil.getRedisVersion; - import java.util.HashSet; import java.util.Set; import java.util.stream.Collectors; import io.redis.test.annotations.SinceRedisVersion; -import io.redis.test.utils.RedisVersionRule; +import redis.clients.jedis.util.RedisVersionRule; import org.apache.commons.pool2.impl.GenericObjectPoolConfig; import org.junit.*; diff --git a/src/test/java/redis/clients/jedis/ACLJedisTest.java b/src/test/java/redis/clients/jedis/ACLJedisTest.java index 1d72195a5d..1b10870d5e 100644 --- a/src/test/java/redis/clients/jedis/ACLJedisTest.java +++ b/src/test/java/redis/clients/jedis/ACLJedisTest.java @@ -1,7 +1,7 @@ package redis.clients.jedis; import static org.junit.Assert.assertEquals; -import static io.redis.test.utils.RedisVersionUtil.getRedisVersion; +import static redis.clients.jedis.util.RedisVersionUtil.getRedisVersion; import java.net.URISyntaxException; import org.junit.BeforeClass; diff --git a/src/test/java/redis/clients/jedis/JedisClusterTestBase.java b/src/test/java/redis/clients/jedis/JedisClusterTestBase.java index 7d9813b760..8720216fae 100644 --- a/src/test/java/redis/clients/jedis/JedisClusterTestBase.java +++ b/src/test/java/redis/clients/jedis/JedisClusterTestBase.java @@ -2,8 +2,8 @@ import static redis.clients.jedis.Protocol.CLUSTER_HASHSLOTS; -import io.redis.test.utils.EnabledOnCommandRule; -import io.redis.test.utils.RedisVersionRule; +import redis.clients.jedis.util.EnabledOnCommandRule; +import redis.clients.jedis.util.RedisVersionRule; import org.junit.After; import org.junit.Before; import org.junit.Rule; diff --git a/src/test/java/redis/clients/jedis/SSLACLJedisClusterTest.java b/src/test/java/redis/clients/jedis/SSLACLJedisClusterTest.java index 0772ede767..516af0f8ec 100644 --- a/src/test/java/redis/clients/jedis/SSLACLJedisClusterTest.java +++ b/src/test/java/redis/clients/jedis/SSLACLJedisClusterTest.java @@ -11,7 +11,7 @@ import io.redis.test.annotations.SinceRedisVersion; import io.redis.test.utils.RedisVersion; -import io.redis.test.utils.RedisVersionUtil; +import redis.clients.jedis.util.RedisVersionUtil; import org.junit.*; import redis.clients.jedis.util.TlsUtil; diff --git a/src/test/java/redis/clients/jedis/SSLACLJedisTest.java b/src/test/java/redis/clients/jedis/SSLACLJedisTest.java index d90965aa0f..06b6fa1f79 100644 --- a/src/test/java/redis/clients/jedis/SSLACLJedisTest.java +++ b/src/test/java/redis/clients/jedis/SSLACLJedisTest.java @@ -1,6 +1,6 @@ package redis.clients.jedis; -import static io.redis.test.utils.RedisVersionUtil.getRedisVersion; +import static redis.clients.jedis.util.RedisVersionUtil.getRedisVersion; import static org.junit.Assert.*; import static redis.clients.jedis.util.TlsUtil.*; diff --git a/src/test/java/redis/clients/jedis/SSLJedisClusterTest.java b/src/test/java/redis/clients/jedis/SSLJedisClusterTest.java index 7465881c15..5f325d4710 100644 --- a/src/test/java/redis/clients/jedis/SSLJedisClusterTest.java +++ b/src/test/java/redis/clients/jedis/SSLJedisClusterTest.java @@ -11,7 +11,7 @@ import io.redis.test.annotations.SinceRedisVersion; import io.redis.test.utils.RedisVersion; -import io.redis.test.utils.RedisVersionUtil; +import redis.clients.jedis.util.RedisVersionUtil; import redis.clients.jedis.util.TlsUtil; import org.junit.Assert; import org.junit.BeforeClass; diff --git a/src/test/java/redis/clients/jedis/commands/commandobjects/CommandObjectsStandaloneTestBase.java b/src/test/java/redis/clients/jedis/commands/commandobjects/CommandObjectsStandaloneTestBase.java index 00a57f1ff6..707db79bb2 100644 --- a/src/test/java/redis/clients/jedis/commands/commandobjects/CommandObjectsStandaloneTestBase.java +++ b/src/test/java/redis/clients/jedis/commands/commandobjects/CommandObjectsStandaloneTestBase.java @@ -1,7 +1,7 @@ package redis.clients.jedis.commands.commandobjects; -import io.redis.test.utils.EnabledOnCommandRule; -import io.redis.test.utils.RedisVersionRule; +import redis.clients.jedis.util.EnabledOnCommandRule; +import redis.clients.jedis.util.RedisVersionRule; import org.junit.Rule; import redis.clients.jedis.HostAndPorts; import redis.clients.jedis.RedisProtocol; @@ -12,9 +12,9 @@ public abstract class CommandObjectsStandaloneTestBase extends CommandObjectsTestBase { @Rule - public RedisVersionRule versionRule = new RedisVersionRule(endpoint.getHostAndPort(), endpoint.getClientConfigBuilder().build()); + public RedisVersionRule versionRule = new RedisVersionRule(endpoint); @Rule - public EnabledOnCommandRule enabledOnCommandRule = new EnabledOnCommandRule(endpoint.getHostAndPort(), endpoint.getClientConfigBuilder().build()); + public EnabledOnCommandRule enabledOnCommandRule = new EnabledOnCommandRule(endpoint); public CommandObjectsStandaloneTestBase(RedisProtocol protocol) { super(protocol, HostAndPorts.getRedisEndpoint("standalone0")); diff --git a/src/test/java/redis/clients/jedis/commands/commandobjects/CommandObjectsTestBase.java b/src/test/java/redis/clients/jedis/commands/commandobjects/CommandObjectsTestBase.java index 8e194105e0..fac2d9efc2 100644 --- a/src/test/java/redis/clients/jedis/commands/commandobjects/CommandObjectsTestBase.java +++ b/src/test/java/redis/clients/jedis/commands/commandobjects/CommandObjectsTestBase.java @@ -6,7 +6,7 @@ import java.util.Collection; import io.redis.test.utils.RedisVersion; -import io.redis.test.utils.RedisVersionUtil; +import redis.clients.jedis.util.RedisVersionUtil; import org.junit.Before; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; diff --git a/src/test/java/redis/clients/jedis/commands/jedis/AccessControlListCommandsTest.java b/src/test/java/redis/clients/jedis/commands/jedis/AccessControlListCommandsTest.java index 571eb93b8f..56d30ac1cc 100644 --- a/src/test/java/redis/clients/jedis/commands/jedis/AccessControlListCommandsTest.java +++ b/src/test/java/redis/clients/jedis/commands/jedis/AccessControlListCommandsTest.java @@ -11,7 +11,7 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; -import static io.redis.test.utils.RedisVersionUtil.getRedisVersion; +import static redis.clients.jedis.util.RedisVersionUtil.getRedisVersion; import java.util.Arrays; import java.util.List; diff --git a/src/test/java/redis/clients/jedis/commands/jedis/ClientCommandsTest.java b/src/test/java/redis/clients/jedis/commands/jedis/ClientCommandsTest.java index 24dd66e914..ec72e266a4 100644 --- a/src/test/java/redis/clients/jedis/commands/jedis/ClientCommandsTest.java +++ b/src/test/java/redis/clients/jedis/commands/jedis/ClientCommandsTest.java @@ -16,8 +16,8 @@ import java.util.regex.Pattern; import io.redis.test.annotations.SinceRedisVersion; -import io.redis.test.utils.EnabledOnCommandRule; -import io.redis.test.utils.RedisVersionRule; +import redis.clients.jedis.util.EnabledOnCommandRule; +import redis.clients.jedis.util.RedisVersionRule; import org.junit.After; import org.junit.Before; import org.junit.Rule; @@ -43,9 +43,9 @@ public class ClientCommandsTest extends JedisCommandsTestBase { private Jedis client; @Rule - public RedisVersionRule versionRule = new RedisVersionRule(endpoint.getHostAndPort(), endpoint.getClientConfigBuilder().build()); + public RedisVersionRule versionRule = new RedisVersionRule(endpoint); @Rule - public EnabledOnCommandRule enabledOnCommandRule = new EnabledOnCommandRule(endpoint.getHostAndPort(), endpoint.getClientConfigBuilder().build()); + public EnabledOnCommandRule enabledOnCommandRule = new EnabledOnCommandRule(endpoint); public ClientCommandsTest(RedisProtocol protocol) { super(protocol); 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 c94585ac3e..3b07d14f4b 100644 --- a/src/test/java/redis/clients/jedis/commands/jedis/ClusterCommandsTest.java +++ b/src/test/java/redis/clients/jedis/commands/jedis/ClusterCommandsTest.java @@ -10,8 +10,8 @@ import java.util.Map; import io.redis.test.annotations.SinceRedisVersion; -import io.redis.test.utils.EnabledOnCommandRule; -import io.redis.test.utils.RedisVersionRule; +import redis.clients.jedis.util.EnabledOnCommandRule; +import redis.clients.jedis.util.RedisVersionRule; import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers; import org.junit.*; diff --git a/src/test/java/redis/clients/jedis/commands/jedis/ClusterJedisCommandsTestBase.java b/src/test/java/redis/clients/jedis/commands/jedis/ClusterJedisCommandsTestBase.java index da973f41ca..232e49b6b9 100644 --- a/src/test/java/redis/clients/jedis/commands/jedis/ClusterJedisCommandsTestBase.java +++ b/src/test/java/redis/clients/jedis/commands/jedis/ClusterJedisCommandsTestBase.java @@ -5,8 +5,8 @@ import java.util.HashSet; import java.util.Set; -import io.redis.test.utils.EnabledOnCommandRule; -import io.redis.test.utils.RedisVersionRule; +import redis.clients.jedis.util.EnabledOnCommandRule; +import redis.clients.jedis.util.RedisVersionRule; import org.junit.After; import org.junit.AfterClass; import org.junit.Before; diff --git a/src/test/java/redis/clients/jedis/commands/jedis/HashesCommandsTest.java b/src/test/java/redis/clients/jedis/commands/jedis/HashesCommandsTest.java index a3d85d2c92..370fb7cfd8 100644 --- a/src/test/java/redis/clients/jedis/commands/jedis/HashesCommandsTest.java +++ b/src/test/java/redis/clients/jedis/commands/jedis/HashesCommandsTest.java @@ -32,14 +32,13 @@ import java.util.stream.Collectors; import io.redis.test.annotations.SinceRedisVersion; -import io.redis.test.utils.EnabledOnCommandRule; -import io.redis.test.utils.RedisVersionRule; +import redis.clients.jedis.util.EnabledOnCommandRule; +import redis.clients.jedis.util.RedisVersionRule; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -import redis.clients.jedis.HostAndPorts; import redis.clients.jedis.Pipeline; import redis.clients.jedis.RedisProtocol; import redis.clients.jedis.Response; @@ -53,10 +52,10 @@ public class HashesCommandsTest extends JedisCommandsTestBase { @Rule - public RedisVersionRule versionRule = new RedisVersionRule(endpoint.getHostAndPort(), endpoint.getClientConfigBuilder().build()); + public RedisVersionRule versionRule = new RedisVersionRule(endpoint); @Rule - public EnabledOnCommandRule enabledOnCommandRule = new EnabledOnCommandRule(endpoint.getHostAndPort(), endpoint.getClientConfigBuilder().build()); + public EnabledOnCommandRule enabledOnCommandRule = new EnabledOnCommandRule(endpoint); final byte[] bfoo = { 0x01, 0x02, 0x03, 0x04 }; final byte[] bbar = { 0x05, 0x06, 0x07, 0x08 }; diff --git a/src/test/java/redis/clients/jedis/commands/jedis/JedisCommandsTestBase.java b/src/test/java/redis/clients/jedis/commands/jedis/JedisCommandsTestBase.java index 7a25858160..b73e707f19 100644 --- a/src/test/java/redis/clients/jedis/commands/jedis/JedisCommandsTestBase.java +++ b/src/test/java/redis/clients/jedis/commands/jedis/JedisCommandsTestBase.java @@ -2,8 +2,8 @@ import java.util.Collection; -import io.redis.test.utils.EnabledOnCommandRule; -import io.redis.test.utils.RedisVersionRule; +import redis.clients.jedis.util.EnabledOnCommandRule; +import redis.clients.jedis.util.RedisVersionRule; import org.junit.After; import org.junit.Before; import org.junit.Rule; @@ -15,13 +15,11 @@ public abstract class JedisCommandsTestBase { @Rule public RedisVersionRule versionRule = new RedisVersionRule( - HostAndPorts.getRedisEndpoint("standalone0").getHostAndPort(), - HostAndPorts.getRedisEndpoint("standalone0").getClientConfigBuilder().build()); + HostAndPorts.getRedisEndpoint("standalone0")); @Rule public EnabledOnCommandRule enabledOnCommandRule = new EnabledOnCommandRule( - HostAndPorts.getRedisEndpoint("standalone0").getHostAndPort(), - HostAndPorts.getRedisEndpoint("standalone0").getClientConfigBuilder().build()); + HostAndPorts.getRedisEndpoint("standalone0")); /** * Input data for parameterized tests. In principle all subclasses of this diff --git a/src/test/java/redis/clients/jedis/commands/jedis/ScriptingCommandsTest.java b/src/test/java/redis/clients/jedis/commands/jedis/ScriptingCommandsTest.java index fd0a7a86c0..714110fc26 100644 --- a/src/test/java/redis/clients/jedis/commands/jedis/ScriptingCommandsTest.java +++ b/src/test/java/redis/clients/jedis/commands/jedis/ScriptingCommandsTest.java @@ -10,7 +10,7 @@ import io.redis.test.annotations.SinceRedisVersion; import io.redis.test.utils.RedisVersion; -import io.redis.test.utils.RedisVersionUtil; +import redis.clients.jedis.util.RedisVersionUtil; import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers; import org.junit.Before; diff --git a/src/test/java/redis/clients/jedis/commands/jedis/StreamsCommandsTest.java b/src/test/java/redis/clients/jedis/commands/jedis/StreamsCommandsTest.java index 719014bdfc..7500b984c9 100644 --- a/src/test/java/redis/clients/jedis/commands/jedis/StreamsCommandsTest.java +++ b/src/test/java/redis/clients/jedis/commands/jedis/StreamsCommandsTest.java @@ -20,7 +20,7 @@ import io.redis.test.annotations.SinceRedisVersion; import io.redis.test.utils.RedisVersion; -import io.redis.test.utils.RedisVersionUtil; +import redis.clients.jedis.util.RedisVersionUtil; import org.hamcrest.Matchers; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/src/test/java/redis/clients/jedis/commands/unified/BitCommandsTestBase.java b/src/test/java/redis/clients/jedis/commands/unified/BitCommandsTestBase.java index 7d559e1518..483a6aa4b9 100644 --- a/src/test/java/redis/clients/jedis/commands/unified/BitCommandsTestBase.java +++ b/src/test/java/redis/clients/jedis/commands/unified/BitCommandsTestBase.java @@ -9,8 +9,6 @@ import java.util.List; import io.redis.test.annotations.SinceRedisVersion; -import io.redis.test.utils.RedisVersionRule; -import org.junit.Rule; import org.junit.Test; import redis.clients.jedis.Protocol; diff --git a/src/test/java/redis/clients/jedis/commands/unified/cluster/ClusterAllKindOfValuesCommandsTest.java b/src/test/java/redis/clients/jedis/commands/unified/cluster/ClusterAllKindOfValuesCommandsTest.java index ca8be570ee..5f0df2a7a3 100644 --- a/src/test/java/redis/clients/jedis/commands/unified/cluster/ClusterAllKindOfValuesCommandsTest.java +++ b/src/test/java/redis/clients/jedis/commands/unified/cluster/ClusterAllKindOfValuesCommandsTest.java @@ -10,8 +10,8 @@ import java.util.HashSet; import java.util.Set; -import io.redis.test.utils.EnabledOnCommandRule; -import io.redis.test.utils.RedisVersionRule; +import redis.clients.jedis.util.EnabledOnCommandRule; +import redis.clients.jedis.util.RedisVersionRule; import org.junit.After; import org.junit.Before; import org.junit.Rule; diff --git a/src/test/java/redis/clients/jedis/commands/unified/cluster/ClusterBitCommandsTest.java b/src/test/java/redis/clients/jedis/commands/unified/cluster/ClusterBitCommandsTest.java index 505722574b..2515f5acfe 100644 --- a/src/test/java/redis/clients/jedis/commands/unified/cluster/ClusterBitCommandsTest.java +++ b/src/test/java/redis/clients/jedis/commands/unified/cluster/ClusterBitCommandsTest.java @@ -2,8 +2,8 @@ import static org.junit.Assert.assertEquals; -import io.redis.test.utils.EnabledOnCommandRule; -import io.redis.test.utils.RedisVersionRule; +import redis.clients.jedis.util.EnabledOnCommandRule; +import redis.clients.jedis.util.RedisVersionRule; import org.junit.*; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; diff --git a/src/test/java/redis/clients/jedis/commands/unified/cluster/ClusterHashesCommandsTest.java b/src/test/java/redis/clients/jedis/commands/unified/cluster/ClusterHashesCommandsTest.java index 81a6889dd5..d5024b1bb3 100644 --- a/src/test/java/redis/clients/jedis/commands/unified/cluster/ClusterHashesCommandsTest.java +++ b/src/test/java/redis/clients/jedis/commands/unified/cluster/ClusterHashesCommandsTest.java @@ -1,7 +1,7 @@ package redis.clients.jedis.commands.unified.cluster; -import io.redis.test.utils.EnabledOnCommandRule; -import io.redis.test.utils.RedisVersionRule; +import redis.clients.jedis.util.EnabledOnCommandRule; +import redis.clients.jedis.util.RedisVersionRule; import org.junit.After; import org.junit.Before; import org.junit.Rule; diff --git a/src/test/java/redis/clients/jedis/commands/unified/cluster/ClusterListCommandsTest.java b/src/test/java/redis/clients/jedis/commands/unified/cluster/ClusterListCommandsTest.java index ef24a93e3b..e1c9b3eb97 100644 --- a/src/test/java/redis/clients/jedis/commands/unified/cluster/ClusterListCommandsTest.java +++ b/src/test/java/redis/clients/jedis/commands/unified/cluster/ClusterListCommandsTest.java @@ -11,8 +11,8 @@ import java.util.List; import io.redis.test.annotations.SinceRedisVersion; -import io.redis.test.utils.EnabledOnCommandRule; -import io.redis.test.utils.RedisVersionRule; +import redis.clients.jedis.util.EnabledOnCommandRule; +import redis.clients.jedis.util.RedisVersionRule; import org.junit.After; import org.junit.Before; import org.junit.Rule; diff --git a/src/test/java/redis/clients/jedis/commands/unified/cluster/ClusterSetCommandsTest.java b/src/test/java/redis/clients/jedis/commands/unified/cluster/ClusterSetCommandsTest.java index b71a7fe663..d1b620a8c6 100644 --- a/src/test/java/redis/clients/jedis/commands/unified/cluster/ClusterSetCommandsTest.java +++ b/src/test/java/redis/clients/jedis/commands/unified/cluster/ClusterSetCommandsTest.java @@ -6,8 +6,8 @@ import java.util.Set; import io.redis.test.annotations.SinceRedisVersion; -import io.redis.test.utils.EnabledOnCommandRule; -import io.redis.test.utils.RedisVersionRule; +import redis.clients.jedis.util.EnabledOnCommandRule; +import redis.clients.jedis.util.RedisVersionRule; import org.junit.After; import org.junit.Before; import org.junit.Rule; diff --git a/src/test/java/redis/clients/jedis/commands/unified/cluster/ClusterSortedSetCommandsTest.java b/src/test/java/redis/clients/jedis/commands/unified/cluster/ClusterSortedSetCommandsTest.java index 095f4a24c7..600237571d 100644 --- a/src/test/java/redis/clients/jedis/commands/unified/cluster/ClusterSortedSetCommandsTest.java +++ b/src/test/java/redis/clients/jedis/commands/unified/cluster/ClusterSortedSetCommandsTest.java @@ -11,8 +11,8 @@ import java.util.List; import io.redis.test.annotations.SinceRedisVersion; -import io.redis.test.utils.EnabledOnCommandRule; -import io.redis.test.utils.RedisVersionRule; +import redis.clients.jedis.util.EnabledOnCommandRule; +import redis.clients.jedis.util.RedisVersionRule; import org.junit.After; import org.junit.Before; import org.junit.Rule; diff --git a/src/test/java/redis/clients/jedis/commands/unified/cluster/ClusterStringValuesCommandsTest.java b/src/test/java/redis/clients/jedis/commands/unified/cluster/ClusterStringValuesCommandsTest.java index 8b2d62f05c..a940e59d97 100644 --- a/src/test/java/redis/clients/jedis/commands/unified/cluster/ClusterStringValuesCommandsTest.java +++ b/src/test/java/redis/clients/jedis/commands/unified/cluster/ClusterStringValuesCommandsTest.java @@ -6,8 +6,8 @@ import java.util.List; import io.redis.test.annotations.SinceRedisVersion; -import io.redis.test.utils.EnabledOnCommandRule; -import io.redis.test.utils.RedisVersionRule; +import redis.clients.jedis.util.EnabledOnCommandRule; +import redis.clients.jedis.util.RedisVersionRule; import org.junit.After; import org.junit.Before; import org.junit.Rule; diff --git a/src/test/java/redis/clients/jedis/commands/unified/pipeline/PipelineCommandsTestBase.java b/src/test/java/redis/clients/jedis/commands/unified/pipeline/PipelineCommandsTestBase.java index ecef988fa7..9744244616 100644 --- a/src/test/java/redis/clients/jedis/commands/unified/pipeline/PipelineCommandsTestBase.java +++ b/src/test/java/redis/clients/jedis/commands/unified/pipeline/PipelineCommandsTestBase.java @@ -2,8 +2,8 @@ import java.util.Collection; -import io.redis.test.utils.EnabledOnCommandRule; -import io.redis.test.utils.RedisVersionRule; +import redis.clients.jedis.util.EnabledOnCommandRule; +import redis.clients.jedis.util.RedisVersionRule; import org.junit.After; import org.junit.Before; import org.junit.Rule; @@ -31,13 +31,9 @@ public static Collection data() { protected final RedisProtocol protocol; @Rule - public RedisVersionRule versionRule = new RedisVersionRule( - PooledCommandsTestHelper.nodeInfo.getHostAndPort(), - PooledCommandsTestHelper.nodeInfo.getClientConfigBuilder().build()); + public RedisVersionRule versionRule = new RedisVersionRule(PooledCommandsTestHelper.nodeInfo); @Rule - public EnabledOnCommandRule enabledOnCommandRule = new EnabledOnCommandRule( - HostAndPorts.getStableClusterServers().get(0), - DefaultJedisClientConfig.builder().password("cluster").build()); + public EnabledOnCommandRule enabledOnCommandRule = new EnabledOnCommandRule(PooledCommandsTestHelper.nodeInfo); /** * The RESP protocol is to be injected by the subclasses, usually via JUnit * parameterized tests, because most of the subclassed tests are meant to be diff --git a/src/test/java/redis/clients/jedis/commands/unified/pipeline/StreamsPipelineCommandsTest.java b/src/test/java/redis/clients/jedis/commands/unified/pipeline/StreamsPipelineCommandsTest.java index 78627e1cf3..6d52e88b1f 100644 --- a/src/test/java/redis/clients/jedis/commands/unified/pipeline/StreamsPipelineCommandsTest.java +++ b/src/test/java/redis/clients/jedis/commands/unified/pipeline/StreamsPipelineCommandsTest.java @@ -29,7 +29,7 @@ import io.redis.test.annotations.SinceRedisVersion; import io.redis.test.utils.RedisVersion; -import io.redis.test.utils.RedisVersionUtil; +import redis.clients.jedis.util.RedisVersionUtil; import org.hamcrest.Matchers; import org.junit.Test; import org.junit.runner.RunWith; @@ -254,13 +254,14 @@ public void xaddWithParamsMinId() { } @Test + @SinceRedisVersion(value = "7.0.0", message = "Added support for XADD ID auto sequence is introduced in 7.0.0") public void xaddParamsId() { String key = "kk"; Map map = singletonMap("ff", "vv"); pipe.xadd(key, XAddParams.xAddParams().id(new StreamEntryID(0, 1)), map); pipe.xadd(key, XAddParams.xAddParams().id(2, 3), map); - pipe.xadd(key, XAddParams.xAddParams().id("4-0"), map); + pipe.xadd(key, XAddParams.xAddParams().id(4), map); pipe.xadd(key, XAddParams.xAddParams().id("5-6"), map); pipe.xadd(key, XAddParams.xAddParams().id("7-8".getBytes()), map); pipe.xadd(key, XAddParams.xAddParams(), map); @@ -280,31 +281,6 @@ public void xaddParamsId() { greaterThan((StreamEntryID) results.get(4))); } - @Test - @SinceRedisVersion(value = "7.2.0", message = "Starting with Redis version 7.0.0: Added support for the -* explicit ID form.") - public void xaddParamsExplicitId() { - String key = "kk"; - Map map = singletonMap("ff", "vv"); - - pipe.xadd(key, XAddParams.xAddParams().id(new StreamEntryID(0, 1)), map); - pipe.xadd(key, XAddParams.xAddParams().id(2), map); - pipe.xadd(key, XAddParams.xAddParams().id(2), map); - pipe.xadd(key, XAddParams.xAddParams(), map); - - List results = pipe.syncAndReturnAll(); - - assertThat(results, contains( - equalTo(new StreamEntryID(0, 1)), - equalTo(new StreamEntryID(2, 0)), - equalTo(new StreamEntryID(2, 1)), - instanceOf(StreamEntryID.class) - )); - - assertThat((StreamEntryID) results.get(2), - greaterThan((StreamEntryID) results.get(1))); - } - - @Test public void xdel() { Map map1 = new HashMap<>(); diff --git a/src/test/java/redis/clients/jedis/commands/unified/pooled/PooledAllKindOfValuesCommandsTest.java b/src/test/java/redis/clients/jedis/commands/unified/pooled/PooledAllKindOfValuesCommandsTest.java index 1e2fc5d94d..c43a2b3667 100644 --- a/src/test/java/redis/clients/jedis/commands/unified/pooled/PooledAllKindOfValuesCommandsTest.java +++ b/src/test/java/redis/clients/jedis/commands/unified/pooled/PooledAllKindOfValuesCommandsTest.java @@ -1,28 +1,23 @@ package redis.clients.jedis.commands.unified.pooled; -import io.redis.test.utils.EnabledOnCommandRule; -import io.redis.test.utils.RedisVersionRule; +import redis.clients.jedis.HostAndPorts; +import redis.clients.jedis.util.EnabledOnCommandRule; +import redis.clients.jedis.util.RedisVersionRule; import org.junit.After; import org.junit.Before; import org.junit.Rule; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -import redis.clients.jedis.DefaultJedisClientConfig; -import redis.clients.jedis.HostAndPorts; import redis.clients.jedis.RedisProtocol; import redis.clients.jedis.commands.unified.AllKindOfValuesCommandsTestBase; @RunWith(Parameterized.class) public class PooledAllKindOfValuesCommandsTest extends AllKindOfValuesCommandsTestBase { @Rule - public RedisVersionRule versionRule = new RedisVersionRule( - PooledCommandsTestHelper.nodeInfo.getHostAndPort(), - PooledCommandsTestHelper.nodeInfo.getClientConfigBuilder().build()); + public RedisVersionRule versionRule = new RedisVersionRule(PooledCommandsTestHelper.nodeInfo); @Rule - public EnabledOnCommandRule enabledOnCommandRule = new EnabledOnCommandRule( - PooledCommandsTestHelper.nodeInfo.getHostAndPort(), - PooledCommandsTestHelper.nodeInfo.getClientConfigBuilder().build()); + public EnabledOnCommandRule enabledOnCommandRule = new EnabledOnCommandRule(PooledCommandsTestHelper.nodeInfo); public PooledAllKindOfValuesCommandsTest(RedisProtocol protocol) { super(protocol); diff --git a/src/test/java/redis/clients/jedis/commands/unified/pooled/PooledBitCommandsTest.java b/src/test/java/redis/clients/jedis/commands/unified/pooled/PooledBitCommandsTest.java index b1428d46ca..e91b0ece06 100644 --- a/src/test/java/redis/clients/jedis/commands/unified/pooled/PooledBitCommandsTest.java +++ b/src/test/java/redis/clients/jedis/commands/unified/pooled/PooledBitCommandsTest.java @@ -1,7 +1,7 @@ package redis.clients.jedis.commands.unified.pooled; -import io.redis.test.utils.EnabledOnCommandRule; -import io.redis.test.utils.RedisVersionRule; +import redis.clients.jedis.util.EnabledOnCommandRule; +import redis.clients.jedis.util.RedisVersionRule; import org.junit.After; import org.junit.Before; import org.junit.Rule; @@ -15,13 +15,9 @@ public class PooledBitCommandsTest extends BitCommandsTestBase { @Rule - public RedisVersionRule versionRule = new RedisVersionRule( - PooledCommandsTestHelper.nodeInfo.getHostAndPort() - ,PooledCommandsTestHelper.nodeInfo.getClientConfigBuilder().build()); + public RedisVersionRule versionRule = new RedisVersionRule(PooledCommandsTestHelper.nodeInfo); @Rule - public EnabledOnCommandRule enabledOnCommandRule = new EnabledOnCommandRule( - PooledCommandsTestHelper.nodeInfo.getHostAndPort(), - PooledCommandsTestHelper.nodeInfo.getClientConfigBuilder().build()); + public EnabledOnCommandRule enabledOnCommandRule = new EnabledOnCommandRule(PooledCommandsTestHelper.nodeInfo); public PooledBitCommandsTest(RedisProtocol protocol) { super(protocol); diff --git a/src/test/java/redis/clients/jedis/commands/unified/pooled/PooledHashesCommandsTest.java b/src/test/java/redis/clients/jedis/commands/unified/pooled/PooledHashesCommandsTest.java index 95f4020549..34e88a6a81 100644 --- a/src/test/java/redis/clients/jedis/commands/unified/pooled/PooledHashesCommandsTest.java +++ b/src/test/java/redis/clients/jedis/commands/unified/pooled/PooledHashesCommandsTest.java @@ -1,7 +1,7 @@ package redis.clients.jedis.commands.unified.pooled; -import io.redis.test.utils.EnabledOnCommandRule; -import io.redis.test.utils.RedisVersionRule; +import redis.clients.jedis.util.EnabledOnCommandRule; +import redis.clients.jedis.util.RedisVersionRule; import org.junit.After; import org.junit.Before; import org.junit.Rule; @@ -15,13 +15,9 @@ public class PooledHashesCommandsTest extends HashesCommandsTestBase { @Rule - public RedisVersionRule versionRule = new RedisVersionRule( - PooledCommandsTestHelper.nodeInfo.getHostAndPort(), - PooledCommandsTestHelper.nodeInfo.getClientConfigBuilder().build()); + public RedisVersionRule versionRule = new RedisVersionRule(PooledCommandsTestHelper.nodeInfo); @Rule - public EnabledOnCommandRule enabledOnCommandRule = new EnabledOnCommandRule( - PooledCommandsTestHelper.nodeInfo.getHostAndPort(), - PooledCommandsTestHelper.nodeInfo.getClientConfigBuilder().build()); + public EnabledOnCommandRule enabledOnCommandRule = new EnabledOnCommandRule(PooledCommandsTestHelper.nodeInfo); public PooledHashesCommandsTest(RedisProtocol protocol) { super(protocol); diff --git a/src/test/java/redis/clients/jedis/commands/unified/pooled/PooledListCommandsTest.java b/src/test/java/redis/clients/jedis/commands/unified/pooled/PooledListCommandsTest.java index 606e91bcc3..6626896095 100644 --- a/src/test/java/redis/clients/jedis/commands/unified/pooled/PooledListCommandsTest.java +++ b/src/test/java/redis/clients/jedis/commands/unified/pooled/PooledListCommandsTest.java @@ -1,14 +1,13 @@ package redis.clients.jedis.commands.unified.pooled; -import io.redis.test.utils.EnabledOnCommandRule; -import io.redis.test.utils.RedisVersionRule; +import redis.clients.jedis.util.EnabledOnCommandRule; +import redis.clients.jedis.util.RedisVersionRule; import org.junit.After; import org.junit.Before; import org.junit.Rule; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -import redis.clients.jedis.HostAndPorts; import redis.clients.jedis.RedisProtocol; import redis.clients.jedis.commands.unified.ListCommandsTestBase; @@ -16,13 +15,9 @@ public class PooledListCommandsTest extends ListCommandsTestBase { @Rule - public RedisVersionRule versionRule = new RedisVersionRule( - PooledCommandsTestHelper.nodeInfo.getHostAndPort() - ,PooledCommandsTestHelper.nodeInfo.getClientConfigBuilder().build()); + public RedisVersionRule versionRule = new RedisVersionRule(PooledCommandsTestHelper.nodeInfo); @Rule - public EnabledOnCommandRule enabledOnCommandRule = new EnabledOnCommandRule( - PooledCommandsTestHelper.nodeInfo.getHostAndPort(), - PooledCommandsTestHelper.nodeInfo.getClientConfigBuilder().build()); + public EnabledOnCommandRule enabledOnCommandRule = new EnabledOnCommandRule(PooledCommandsTestHelper.nodeInfo); public PooledListCommandsTest(RedisProtocol protocol) { super(protocol); diff --git a/src/test/java/redis/clients/jedis/commands/unified/pooled/PooledMiscellaneousTest.java b/src/test/java/redis/clients/jedis/commands/unified/pooled/PooledMiscellaneousTest.java index 4ef5361caa..3da81a8e52 100644 --- a/src/test/java/redis/clients/jedis/commands/unified/pooled/PooledMiscellaneousTest.java +++ b/src/test/java/redis/clients/jedis/commands/unified/pooled/PooledMiscellaneousTest.java @@ -9,8 +9,8 @@ import java.util.List; import io.redis.test.annotations.SinceRedisVersion; -import io.redis.test.utils.EnabledOnCommandRule; -import io.redis.test.utils.RedisVersionRule; +import redis.clients.jedis.util.EnabledOnCommandRule; +import redis.clients.jedis.util.RedisVersionRule; import org.junit.After; import org.junit.Before; import org.junit.Rule; @@ -26,13 +26,9 @@ public class PooledMiscellaneousTest extends UnifiedJedisCommandsTestBase { @Rule - public RedisVersionRule versionRule = new RedisVersionRule( - PooledCommandsTestHelper.nodeInfo.getHostAndPort() - ,PooledCommandsTestHelper.nodeInfo.getClientConfigBuilder().build()); + public RedisVersionRule versionRule = new RedisVersionRule(PooledCommandsTestHelper.nodeInfo); @Rule - public EnabledOnCommandRule enabledOnCommandRule = new EnabledOnCommandRule( - PooledCommandsTestHelper.nodeInfo.getHostAndPort(), - PooledCommandsTestHelper.nodeInfo.getClientConfigBuilder().build()); + public EnabledOnCommandRule enabledOnCommandRule = new EnabledOnCommandRule(PooledCommandsTestHelper.nodeInfo); public PooledMiscellaneousTest(RedisProtocol protocol) { super(protocol); diff --git a/src/test/java/redis/clients/jedis/commands/unified/pooled/PooledSetCommandsTest.java b/src/test/java/redis/clients/jedis/commands/unified/pooled/PooledSetCommandsTest.java index f8a2aa05e6..d8ae1ffb92 100644 --- a/src/test/java/redis/clients/jedis/commands/unified/pooled/PooledSetCommandsTest.java +++ b/src/test/java/redis/clients/jedis/commands/unified/pooled/PooledSetCommandsTest.java @@ -1,7 +1,7 @@ package redis.clients.jedis.commands.unified.pooled; -import io.redis.test.utils.EnabledOnCommandRule; -import io.redis.test.utils.RedisVersionRule; +import redis.clients.jedis.util.EnabledOnCommandRule; +import redis.clients.jedis.util.RedisVersionRule; import org.junit.After; import org.junit.Before; import org.junit.Rule; @@ -15,13 +15,9 @@ public class PooledSetCommandsTest extends SetCommandsTestBase { @Rule - public RedisVersionRule versionRule = new RedisVersionRule( - PooledCommandsTestHelper.nodeInfo.getHostAndPort(), - PooledCommandsTestHelper.nodeInfo.getClientConfigBuilder().build()); + public RedisVersionRule versionRule = new RedisVersionRule(PooledCommandsTestHelper.nodeInfo); @Rule - public EnabledOnCommandRule enabledOnCommandRule = new EnabledOnCommandRule( - PooledCommandsTestHelper.nodeInfo.getHostAndPort(), - PooledCommandsTestHelper.nodeInfo.getClientConfigBuilder().build()); + public EnabledOnCommandRule enabledOnCommandRule = new EnabledOnCommandRule(PooledCommandsTestHelper.nodeInfo); public PooledSetCommandsTest(RedisProtocol protocol) { super(protocol); diff --git a/src/test/java/redis/clients/jedis/commands/unified/pooled/PooledSortedSetCommandsTest.java b/src/test/java/redis/clients/jedis/commands/unified/pooled/PooledSortedSetCommandsTest.java index 5499b0495f..584a8913b1 100644 --- a/src/test/java/redis/clients/jedis/commands/unified/pooled/PooledSortedSetCommandsTest.java +++ b/src/test/java/redis/clients/jedis/commands/unified/pooled/PooledSortedSetCommandsTest.java @@ -1,7 +1,7 @@ package redis.clients.jedis.commands.unified.pooled; -import io.redis.test.utils.EnabledOnCommandRule; -import io.redis.test.utils.RedisVersionRule; +import redis.clients.jedis.util.EnabledOnCommandRule; +import redis.clients.jedis.util.RedisVersionRule; import org.junit.After; import org.junit.Before; import org.junit.Rule; @@ -15,13 +15,9 @@ public class PooledSortedSetCommandsTest extends SortedSetCommandsTestBase { @Rule - public RedisVersionRule versionRule = new RedisVersionRule( - PooledCommandsTestHelper.nodeInfo.getHostAndPort(), - PooledCommandsTestHelper.nodeInfo.getClientConfigBuilder().build()); + public RedisVersionRule versionRule = new RedisVersionRule(PooledCommandsTestHelper.nodeInfo); @Rule - public EnabledOnCommandRule enabledOnCommandRule = new EnabledOnCommandRule( - PooledCommandsTestHelper.nodeInfo.getHostAndPort(), - PooledCommandsTestHelper.nodeInfo.getClientConfigBuilder().build()); + public EnabledOnCommandRule enabledOnCommandRule = new EnabledOnCommandRule(PooledCommandsTestHelper.nodeInfo); public PooledSortedSetCommandsTest(RedisProtocol protocol) { super(protocol); diff --git a/src/test/java/redis/clients/jedis/commands/unified/pooled/PooledStringValuesCommandsTest.java b/src/test/java/redis/clients/jedis/commands/unified/pooled/PooledStringValuesCommandsTest.java index ab8da3db7a..eea8c7c3a4 100644 --- a/src/test/java/redis/clients/jedis/commands/unified/pooled/PooledStringValuesCommandsTest.java +++ b/src/test/java/redis/clients/jedis/commands/unified/pooled/PooledStringValuesCommandsTest.java @@ -1,7 +1,7 @@ package redis.clients.jedis.commands.unified.pooled; -import io.redis.test.utils.EnabledOnCommandRule; -import io.redis.test.utils.RedisVersionRule; +import redis.clients.jedis.util.EnabledOnCommandRule; +import redis.clients.jedis.util.RedisVersionRule; import org.junit.After; import org.junit.Before; import org.junit.Rule; @@ -14,13 +14,9 @@ @RunWith(Parameterized.class) public class PooledStringValuesCommandsTest extends StringValuesCommandsTestBase { @Rule - public RedisVersionRule versionRule = new RedisVersionRule( - PooledCommandsTestHelper.nodeInfo.getHostAndPort(), - PooledCommandsTestHelper.nodeInfo.getClientConfigBuilder().build()); + public RedisVersionRule versionRule = new RedisVersionRule(PooledCommandsTestHelper.nodeInfo); @Rule - public EnabledOnCommandRule enabledOnCommandRule = new EnabledOnCommandRule( - PooledCommandsTestHelper.nodeInfo.getHostAndPort(), - PooledCommandsTestHelper.nodeInfo.getClientConfigBuilder().build()); + public EnabledOnCommandRule enabledOnCommandRule = new EnabledOnCommandRule(PooledCommandsTestHelper.nodeInfo); public PooledStringValuesCommandsTest(RedisProtocol protocol) { super(protocol); diff --git a/src/test/java/redis/clients/jedis/csc/ClientSideCacheTestBase.java b/src/test/java/redis/clients/jedis/csc/ClientSideCacheTestBase.java index 4fdf76679b..614d5495b4 100644 --- a/src/test/java/redis/clients/jedis/csc/ClientSideCacheTestBase.java +++ b/src/test/java/redis/clients/jedis/csc/ClientSideCacheTestBase.java @@ -3,8 +3,8 @@ import java.util.function.Supplier; import io.redis.test.annotations.SinceRedisVersion; -import io.redis.test.utils.EnabledOnCommandRule; -import io.redis.test.utils.RedisVersionRule; +import redis.clients.jedis.util.EnabledOnCommandRule; +import redis.clients.jedis.util.RedisVersionRule; import org.apache.commons.pool2.impl.GenericObjectPoolConfig; import org.junit.After; import org.junit.Before; diff --git a/src/test/java/redis/clients/jedis/csc/JedisClusterClientSideCacheTest.java b/src/test/java/redis/clients/jedis/csc/JedisClusterClientSideCacheTest.java index 41d163e202..6d4c53a30b 100644 --- a/src/test/java/redis/clients/jedis/csc/JedisClusterClientSideCacheTest.java +++ b/src/test/java/redis/clients/jedis/csc/JedisClusterClientSideCacheTest.java @@ -5,11 +5,17 @@ import java.util.function.Supplier; import io.redis.test.annotations.SinceRedisVersion; -import io.redis.test.utils.RedisVersionRule; +import org.junit.ClassRule; +import redis.clients.jedis.util.RedisVersionRule; import org.apache.commons.pool2.impl.GenericObjectPoolConfig; -import org.junit.ClassRule; -import redis.clients.jedis.*; +import redis.clients.jedis.Connection; +import redis.clients.jedis.ConnectionPoolConfig; +import redis.clients.jedis.DefaultJedisClientConfig; +import redis.clients.jedis.HostAndPort; +import redis.clients.jedis.HostAndPorts; +import redis.clients.jedis.JedisClientConfig; +import redis.clients.jedis.JedisCluster; @SinceRedisVersion(value = "7.4.0", message = "Jedis client-side caching is only supported with Redis 7.4 or later.") public class JedisClusterClientSideCacheTest extends UnifiedJedisClientSideCacheTestBase { @@ -26,16 +32,17 @@ public class JedisClusterClientSideCacheTest extends UnifiedJedisClientSideCache return poolConfig; }; - @ClassRule - public static RedisVersionRule versionRule = new RedisVersionRule(hnp.iterator().next(), clientConfig.get()); + @ClassRule + public static RedisVersionRule versionRule = new RedisVersionRule(hnp.iterator().next(), clientConfig.get()); - @Override - protected JedisCluster createRegularJedis() { + @Override + protected JedisCluster createRegularJedis() { return new JedisCluster(hnp, clientConfig.get()); - } + } + + @Override + protected JedisCluster createCachedJedis(CacheConfig cacheConfig) { + return new JedisCluster(hnp, clientConfig.get(), cacheConfig); + } - @Override - protected JedisCluster createCachedJedis(CacheConfig cacheConfig) { - return new JedisCluster(hnp, clientConfig.get(), cacheConfig); - } } diff --git a/src/test/java/redis/clients/jedis/csc/JedisPooledClientSideCacheTest.java b/src/test/java/redis/clients/jedis/csc/JedisPooledClientSideCacheTest.java index ed1eaf1b93..65b7efab57 100644 --- a/src/test/java/redis/clients/jedis/csc/JedisPooledClientSideCacheTest.java +++ b/src/test/java/redis/clients/jedis/csc/JedisPooledClientSideCacheTest.java @@ -1,7 +1,7 @@ package redis.clients.jedis.csc; import io.redis.test.annotations.SinceRedisVersion; -import io.redis.test.utils.RedisVersionRule; +import redis.clients.jedis.util.RedisVersionRule; import org.junit.BeforeClass; import org.junit.ClassRule; import redis.clients.jedis.HostAndPorts; diff --git a/src/test/java/redis/clients/jedis/csc/JedisPooledClientSideCacheTestBase.java b/src/test/java/redis/clients/jedis/csc/JedisPooledClientSideCacheTestBase.java index d30ba58ba0..133efcb3fc 100644 --- a/src/test/java/redis/clients/jedis/csc/JedisPooledClientSideCacheTestBase.java +++ b/src/test/java/redis/clients/jedis/csc/JedisPooledClientSideCacheTestBase.java @@ -2,8 +2,6 @@ import static org.junit.Assert.assertEquals; -import io.redis.test.utils.RedisVersionRule; -import org.junit.ClassRule; import org.junit.Test; import redis.clients.jedis.EndpointConfig; diff --git a/src/test/java/redis/clients/jedis/csc/JedisSentineledClientSideCacheTest.java b/src/test/java/redis/clients/jedis/csc/JedisSentineledClientSideCacheTest.java index 136448a73c..7a12394603 100644 --- a/src/test/java/redis/clients/jedis/csc/JedisSentineledClientSideCacheTest.java +++ b/src/test/java/redis/clients/jedis/csc/JedisSentineledClientSideCacheTest.java @@ -9,30 +9,30 @@ import io.redis.test.utils.RedisVersion; import static org.junit.Assume.assumeTrue; -import static io.redis.test.utils.RedisVersionUtil.getRedisVersion; +import static redis.clients.jedis.util.RedisVersionUtil.getRedisVersion; public class JedisSentineledClientSideCacheTest extends UnifiedJedisClientSideCacheTestBase { - private static final String MASTER_NAME = "mymaster"; + private static final String MASTER_NAME = "mymaster"; - protected static final HostAndPort sentinel1 = HostAndPorts.getSentinelServers().get(1); - protected static final HostAndPort sentinel2 = HostAndPorts.getSentinelServers().get(3); + protected static final HostAndPort sentinel1 = HostAndPorts.getSentinelServers().get(1); + protected static final HostAndPort sentinel2 = HostAndPorts.getSentinelServers().get(3); - private static final Set sentinels = new HashSet<>(Arrays.asList(sentinel1, sentinel2)); + private static final Set sentinels = new HashSet<>(Arrays.asList(sentinel1, sentinel2)); - private static final JedisClientConfig masterClientConfig = DefaultJedisClientConfig.builder().resp3().password("foobared").build(); + private static final JedisClientConfig masterClientConfig = DefaultJedisClientConfig.builder().resp3().password("foobared").build(); - private static final JedisClientConfig sentinelClientConfig = DefaultJedisClientConfig.builder().resp3().build(); + private static final JedisClientConfig sentinelClientConfig = DefaultJedisClientConfig.builder().resp3().build(); - @Override - protected JedisSentineled createRegularJedis() { - return new JedisSentineled(MASTER_NAME, masterClientConfig, sentinels, sentinelClientConfig); - } + @Override + protected JedisSentineled createRegularJedis() { + return new JedisSentineled(MASTER_NAME, masterClientConfig, sentinels, sentinelClientConfig); + } - @Override - protected JedisSentineled createCachedJedis(CacheConfig cacheConfig) { - return new JedisSentineled(MASTER_NAME, masterClientConfig, cacheConfig, sentinels, sentinelClientConfig); - } + @Override + protected JedisSentineled createCachedJedis(CacheConfig cacheConfig) { + return new JedisSentineled(MASTER_NAME, masterClientConfig, cacheConfig, sentinels, sentinelClientConfig); + } @BeforeClass public static void prepare() { diff --git a/src/test/java/redis/clients/jedis/csc/SSLJedisPooledClientSideCacheTest.java b/src/test/java/redis/clients/jedis/csc/SSLJedisPooledClientSideCacheTest.java index 8458e0ffdb..bf89e21b01 100644 --- a/src/test/java/redis/clients/jedis/csc/SSLJedisPooledClientSideCacheTest.java +++ b/src/test/java/redis/clients/jedis/csc/SSLJedisPooledClientSideCacheTest.java @@ -11,7 +11,7 @@ import java.nio.file.Path; import static org.junit.Assume.assumeTrue; -import static io.redis.test.utils.RedisVersionUtil.getRedisVersion; +import static redis.clients.jedis.util.RedisVersionUtil.getRedisVersion; public class SSLJedisPooledClientSideCacheTest extends JedisPooledClientSideCacheTestBase { diff --git a/src/test/java/io/redis/test/utils/EnabledOnCommandRule.java b/src/test/java/redis/clients/jedis/util/EnabledOnCommandRule.java similarity index 99% rename from src/test/java/io/redis/test/utils/EnabledOnCommandRule.java rename to src/test/java/redis/clients/jedis/util/EnabledOnCommandRule.java index aa1d540188..b7bde2e51f 100644 --- a/src/test/java/io/redis/test/utils/EnabledOnCommandRule.java +++ b/src/test/java/redis/clients/jedis/util/EnabledOnCommandRule.java @@ -1,4 +1,4 @@ -package io.redis.test.utils; +package redis.clients.jedis.util; import io.redis.test.annotations.EnabledOnCommand; import org.junit.Assume; diff --git a/src/test/java/io/redis/test/utils/RedisVersionRule.java b/src/test/java/redis/clients/jedis/util/RedisVersionRule.java similarity index 93% rename from src/test/java/io/redis/test/utils/RedisVersionRule.java rename to src/test/java/redis/clients/jedis/util/RedisVersionRule.java index abafa6d520..7034710372 100644 --- a/src/test/java/io/redis/test/utils/RedisVersionRule.java +++ b/src/test/java/redis/clients/jedis/util/RedisVersionRule.java @@ -1,6 +1,8 @@ -package io.redis.test.utils; +package redis.clients.jedis.util; import io.redis.test.annotations.SinceRedisVersion; +import io.redis.test.utils.RedisInfo; +import io.redis.test.utils.RedisVersion; import org.junit.Assume; import org.junit.rules.TestRule; import org.junit.runner.Description; @@ -14,16 +16,14 @@ import java.lang.reflect.Method; -import static io.redis.test.utils.RedisVersionUtil.FORCE_REDIS_SERVER_VERSION_ENV; +import static redis.clients.jedis.util.RedisVersionUtil.FORCE_REDIS_SERVER_VERSION_ENV; +import static redis.clients.jedis.util.RedisVersionUtil.forcedVersion; public class RedisVersionRule implements TestRule { private static final Logger logger = LoggerFactory.getLogger(RedisVersionRule.class); private final HostAndPort hostPort; private final JedisClientConfig config; - private static final RedisVersion forcedVersion = System.getenv(FORCE_REDIS_SERVER_VERSION_ENV) != null - ? RedisVersion.of(System.getenv(FORCE_REDIS_SERVER_VERSION_ENV)) - : null; public RedisVersionRule(EndpointConfig endpoint) { diff --git a/src/test/java/io/redis/test/utils/RedisVersionUtil.java b/src/test/java/redis/clients/jedis/util/RedisVersionUtil.java similarity index 89% rename from src/test/java/io/redis/test/utils/RedisVersionUtil.java rename to src/test/java/redis/clients/jedis/util/RedisVersionUtil.java index faeec309ec..fe7de68b5a 100644 --- a/src/test/java/io/redis/test/utils/RedisVersionUtil.java +++ b/src/test/java/redis/clients/jedis/util/RedisVersionUtil.java @@ -1,16 +1,16 @@ -package io.redis.test.utils; +package redis.clients.jedis.util; +import io.redis.test.utils.RedisInfo; +import io.redis.test.utils.RedisVersion; import redis.clients.jedis.*; -import redis.clients.jedis.util.SafeEncoder; - -import java.util.Map; import static redis.clients.jedis.util.TlsUtil.createTrustAllSslSocketFactory; public class RedisVersionUtil { static final String FORCE_REDIS_SERVER_VERSION_ENV = "forceRedisServerVersion"; - private static final RedisVersion forcedVersion = System.getenv(FORCE_REDIS_SERVER_VERSION_ENV) != null + + static final RedisVersion forcedVersion = System.getenv(FORCE_REDIS_SERVER_VERSION_ENV) != null ? RedisVersion.of(System.getenv(FORCE_REDIS_SERVER_VERSION_ENV)) : null;