From 30201335e526b802dea3de8d48188499c15a9ee4 Mon Sep 17 00:00:00 2001 From: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com> Date: Thu, 8 Jul 2021 17:05:16 +0600 Subject: [PATCH] Adjust ZRANDMEMBER test (#2578) --- .../jedis/tests/commands/SortedSetCommandsTest.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/test/java/redis/clients/jedis/tests/commands/SortedSetCommandsTest.java b/src/test/java/redis/clients/jedis/tests/commands/SortedSetCommandsTest.java index 0ff1a8258d..fb7949fe3a 100644 --- a/src/test/java/redis/clients/jedis/tests/commands/SortedSetCommandsTest.java +++ b/src/test/java/redis/clients/jedis/tests/commands/SortedSetCommandsTest.java @@ -1568,8 +1568,8 @@ public void zdiffStore() { @Test public void zrandmember() { assertNull(jedis.zrandmember("foo")); - assertNull(jedis.zrandmember("foo", 1)); - assertNull(jedis.zrandmemberWithScores("foo", 1)); + assertEquals(Collections.emptySet(), jedis.zrandmember("foo", 1)); + assertEquals(Collections.emptySet(), jedis.zrandmemberWithScores("foo", 1)); Map hash = new HashMap<>(); hash.put("bar1", 1d); @@ -1587,6 +1587,10 @@ public void zrandmember() { assertEquals(hash.get(tuple.getElement()), Double.valueOf(tuple.getScore())); // Binary + assertNull(jedis.zrandmember(bfoo)); + assertEquals(Collections.emptySet(), jedis.zrandmember(bfoo, 1)); + assertEquals(Collections.emptySet(), jedis.zrandmemberWithScores(bfoo, 1)); + Map bhash = new HashMap<>(); bhash.put(bbar1, 1d); bhash.put(bbar2, 10d);