jdeppe-pivotal commented on a change in pull request #6738:
URL: https://github.com/apache/geode/pull/6738#discussion_r690760894
##########
File path:
geode-apis-compatible-with-redis/src/test/java/org/apache/geode/redis/internal/data/RedisSortedSetTest.java
##########
@@ -473,6 +473,70 @@ public void
memberDummyOrderedSetEntryCompareTo_withEqualMemberNamesAndInclusive
assertThat(inclusiveMax.compareTo(realEntry)).isEqualTo(1);
}
+ @Test
+ public void zpopminRemovesMemberWithLowestScore() {
+ int originalSize = rangeSortedSet.getSortedSetSize();
+ RedisSortedSet sortedSet = spy(rangeSortedSet);
+ Region<RedisKey, RedisData> region = uncheckedCast(mock(Region.class));
+ RedisKey key = new RedisKey();
+ int count = 1;
+
+ List<byte[]> result = sortedSet.zpopmin(region, key, count);
+ assertThat(result).containsExactly("member1".getBytes(), "1".getBytes());
+
+ ArgumentCaptor<RemsDeltaInfo> argumentCaptor =
ArgumentCaptor.forClass(RemsDeltaInfo.class);
+ verify(sortedSet).storeChanges(eq(region), eq(key),
argumentCaptor.capture());
+
assertThat(argumentCaptor.getValue().getRemoves()).containsExactly("member1".getBytes());
+ assertThat(rangeSortedSet.getSortedSetSize()).isEqualTo(originalSize -
count);
+ }
+
+ @Test
+ public void
zpopminRemovesMembersWithHighestScores_whenCountIsGreaterThanOne() {
Review comment:
Done.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]