[ https://issues.apache.org/jira/browse/GEODE-8864?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17283153#comment-17283153 ]
ASF GitHub Bot commented on GEODE-8864: --------------------------------------- jhutchison commented on a change in pull request #5954: URL: https://github.com/apache/geode/pull/5954#discussion_r574654195 ########## File path: geode-redis/src/test/java/org/apache/geode/redis/internal/data/RedisHashTest.java ########## @@ -161,4 +163,79 @@ public void setExpirationTimestamp_stores_delta_that_is_stable() throws IOExcept o2.fromDelta(in); assertThat(o2).isEqualTo(o1); } + + @Test + public void hscanSnaphots_shouldBeEmpty_givenHscanHasNotBeenCalled() { + RedisHash subject = createRedisHash(100); + assertThat(subject.getHscanSnapShots()).isEmpty(); + } + + @Test + public void hscanSnaphots_shouldContainSnapshot_givenHscanHasBeenCalled() { + + RedisHash subject = createRedisHash(100); + + UUID clientID = UUID.randomUUID(); + + subject.hscan(clientID, null, 10, BigInteger.valueOf(0)); + + HashMap<UUID, List<ByteArrayWrapper>> hscanSnapShotMap = subject.getHscanSnapShots(); + + assertThat(hscanSnapShotMap.containsKey(clientID)).isTrue(); + + List<ByteArrayWrapper> keyList = hscanSnapShotMap.get(clientID); + assertThat(keyList).isNotEmpty(); + + assertThat(hscanSnapShotMap.get(clientID).contains("field_1")); + assertThat(hscanSnapShotMap.get(clientID).contains("value_1")); + assertThat(hscanSnapShotMap.get(clientID).contains("field_8")); + assertThat(hscanSnapShotMap.get(clientID).contains("value_8")); Review comment: chnaged ########## File path: geode-redis/src/test/java/org/apache/geode/redis/internal/data/RedisHashTest.java ########## @@ -161,4 +163,79 @@ public void setExpirationTimestamp_stores_delta_that_is_stable() throws IOExcept o2.fromDelta(in); assertThat(o2).isEqualTo(o1); } + + @Test + public void hscanSnaphots_shouldBeEmpty_givenHscanHasNotBeenCalled() { + RedisHash subject = createRedisHash(100); + assertThat(subject.getHscanSnapShots()).isEmpty(); + } + + @Test + public void hscanSnaphots_shouldContainSnapshot_givenHscanHasBeenCalled() { + + RedisHash subject = createRedisHash(100); + + UUID clientID = UUID.randomUUID(); + + subject.hscan(clientID, null, 10, BigInteger.valueOf(0)); + + HashMap<UUID, List<ByteArrayWrapper>> hscanSnapShotMap = subject.getHscanSnapShots(); + + assertThat(hscanSnapShotMap.containsKey(clientID)).isTrue(); + + List<ByteArrayWrapper> keyList = hscanSnapShotMap.get(clientID); + assertThat(keyList).isNotEmpty(); + + assertThat(hscanSnapShotMap.get(clientID).contains("field_1")); + assertThat(hscanSnapShotMap.get(clientID).contains("value_1")); + assertThat(hscanSnapShotMap.get(clientID).contains("field_8")); + assertThat(hscanSnapShotMap.get(clientID).contains("value_8")); Review comment: changed ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > finish implementation of Redis HScan Command > -------------------------------------------- > > Key: GEODE-8864 > URL: https://issues.apache.org/jira/browse/GEODE-8864 > Project: Geode > Issue Type: New Feature > Components: redis > Reporter: John Hutchison > Priority: Major > Labels: pull-request-available > -- This message was sent by Atlassian Jira (v8.3.4#803005)