JedisURIHelper.getDBIndex() now returns 0 when db index is not provided
This commit is contained in:
@@ -104,6 +104,13 @@ public class JedisTest extends JedisCommandTestBase {
|
||||
@Test
|
||||
public void allowUrlWithNoDBAndNoPassword() {
|
||||
Jedis jedis = new Jedis("redis://localhost:6380");
|
||||
jedis.auth("foobared");
|
||||
assertEquals(jedis.getClient().getHost(), "localhost");
|
||||
assertEquals(jedis.getClient().getPort(), 6380);
|
||||
assertEquals(jedis.getDB(), (Long) 0L);
|
||||
|
||||
jedis = new Jedis("redis://localhost:6380/");
|
||||
jedis.auth("foobared");
|
||||
assertEquals(jedis.getClient().getHost(), "localhost");
|
||||
assertEquals(jedis.getClient().getPort(), 6380);
|
||||
assertEquals(jedis.getDB(), (Long) 0L);
|
||||
|
||||
Reference in New Issue
Block a user