Pipeline commands should not throw an exception when a key is unset
This commit is contained in:
@@ -1,21 +1,17 @@
|
||||
package redis.clients.jedis.tests;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import redis.clients.jedis.*;
|
||||
import redis.clients.jedis.exceptions.JedisDataException;
|
||||
import redis.clients.jedis.tests.HostAndPortUtil.HostAndPort;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import redis.clients.jedis.Jedis;
|
||||
import redis.clients.jedis.Pipeline;
|
||||
import redis.clients.jedis.PipelineBlock;
|
||||
import redis.clients.jedis.Response;
|
||||
import redis.clients.jedis.Tuple;
|
||||
import redis.clients.jedis.exceptions.JedisDataException;
|
||||
import redis.clients.jedis.tests.HostAndPortUtil.HostAndPort;
|
||||
import java.util.UUID;
|
||||
|
||||
public class PipeliningTest extends Assert {
|
||||
private static HostAndPort hnp = HostAndPortUtil.getRedisServers().get(0);
|
||||
@@ -114,4 +110,12 @@ public class PipeliningTest extends Assert {
|
||||
assertEquals(0, p1.get().longValue());
|
||||
assertEquals(0, p2.get().longValue());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void canRetrieveUnsetKey() {
|
||||
Pipeline p = jedis.pipelined();
|
||||
Response<String> shouldNotExist = p.get(UUID.randomUUID().toString());
|
||||
p.sync();
|
||||
assertNull(shouldNotExist.get());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user