refactoring

pull/5457/head
Nikita Koksharov 1 year ago
parent b3c934b548
commit 100ba04342

@ -31,6 +31,8 @@ public class RedisDockerTest {
})
.withExposedPorts(6379);
protected static final Protocol protocol = Protocol.RESP3;
protected static RedissonClient redisson;
protected static RedissonClient redissonCluster;
@ -61,7 +63,7 @@ public class RedisDockerTest {
protected static Config createConfig() {
Config config = new Config();
config.setProtocol(Protocol.RESP2);
config.setProtocol(protocol);
config.useSingleServer()
.setAddress("redis://127.0.0.1:" + REDIS.getFirstMappedPort());
return config;
@ -85,6 +87,7 @@ public class RedisDockerTest {
redis.start();
Config config = new Config();
config.setProtocol(protocol);
config.useSingleServer().setAddress("redis://127.0.0.1:" + redis.getFirstMappedPort());
RedissonClient redisson = Redisson.create(config);
@ -105,7 +108,7 @@ public class RedisDockerTest {
REDIS_CLUSTER.start();
Config config = new Config();
config.setProtocol(Protocol.RESP2);
config.setProtocol(protocol);
config.useClusterServers()
.setNatMapper(new NatMapper() {
@Override

@ -335,10 +335,12 @@ public class RedissonBucketTest extends RedisDockerTest {
redis2.start();
Config config2 = new Config();
config2.setProtocol(protocol);
config2.useSingleServer().setAddress("redis://" + redis.getHost() + ":" + redis.getFirstMappedPort());
RedissonClient r2 = Redisson.create(config2);
Config config = new Config();
config.setProtocol(protocol);
config.useSingleServer().setAddress("redis://" + redis2.getHost() + ":" + redis2.getFirstMappedPort());
RedissonClient r = Redisson.create(config);

@ -82,6 +82,7 @@ public class RedissonLockTest extends BaseConcurrentTest {
@Test
public void testSubscriptionsPerConnection() throws InterruptedException {
Config config = new Config();
config.setProtocol(protocol);
config.useSingleServer()
.setSubscriptionConnectionPoolSize(1)
.setSubscriptionConnectionMinimumIdleSize(1)

@ -94,6 +94,7 @@ public class RedissonTopicTest extends RedisDockerTest {
redisCluster.start();
Config config = new Config();
config.setProtocol(protocol);
config.useClusterServers()
.setNatMapper(new NatMapper() {
@Override
@ -729,6 +730,7 @@ public class RedissonTopicTest extends RedisDockerTest {
redis.start();
Config config = new Config();
config.setProtocol(protocol);
config.useSingleServer()
.setAddress("redis://127.0.0.1:" + redis.getFirstMappedPort());
RedissonClient redisson = Redisson.create(config);
@ -778,6 +780,7 @@ public class RedissonTopicTest extends RedisDockerTest {
redis.start();
Config config = new Config();
config.setProtocol(protocol);
config.useSingleServer()
.setAddress("redis://127.0.0.1:" + redis.getFirstMappedPort());
RedissonClient redisson = Redisson.create(config);
@ -1002,6 +1005,7 @@ public class RedissonTopicTest extends RedisDockerTest {
Thread.sleep(5000);
Config config = new Config();
config.setProtocol(protocol);
config.useSentinelServers()
.setNatMapper(new NatMapper() {
@ -1515,6 +1519,7 @@ public class RedissonTopicTest extends RedisDockerTest {
redisCluster.start();
Config config = new Config();
config.setProtocol(protocol);
config.useClusterServers()
.setNatMapper(new NatMapper() {
@Override

Loading…
Cancel
Save