Feature - allow to specify username and password in redis connection url. #4271

pull/4308/head
Nikita Koksharov 3 years ago
parent 722453390a
commit aa63d50f2d

@ -802,6 +802,26 @@ public class RedissonTest extends BaseTest {
Assertions.assertTrue(r.isShutdown());
}
@Test
public void testURIPassword() throws InterruptedException, IOException {
RedisProcess runner = new RedisRunner()
.nosave()
.randomDir()
.randomPort()
.requirepass("1234")
.run();
Config config = new Config();
config.useSingleServer()
.setAddress("redis://:1234@" + runner.getRedisServerBindAddress() + ":" + runner.getRedisServerPort());
RedissonClient redisson = Redisson.create(config);
RBucket<String> b = redisson.getBucket("test");
b.set("123");
redisson.shutdown();
runner.stop();
}
@Test
public void testSentinelStartupWithPassword() throws Exception {
RedisRunner.RedisProcess master = new RedisRunner()

Loading…
Cancel
Save