vamossagar12 commented on a change in pull request #9508:
URL: https://github.com/apache/kafka/pull/9508#discussion_r532213896



##########
File path: 
streams/src/test/java/org/apache/kafka/streams/state/internals/ChangeLoggingKeyValueBytesStoreTest.java
##########
@@ -196,6 +200,26 @@ public void shouldReturnValueOnGetWhenExists() {
         assertThat(store.get(hello), equalTo(world));
     }
 
+    @Test
+    public void shouldGetRecordsWithPrefixKey() {
+        store.put(hi, there);
+        store.put(hello, world);
+        final KeyValueIterator<Bytes, byte[]> keysWithPrefix = 
store.prefixScan("h", new StringSerializer());
+        final List<String> keys = new ArrayList<>();
+        final List<String> values = new ArrayList<>();
+        int numberOfKeysReturned = 0;
+
+        while (keysWithPrefix.hasNext()) {
+            final KeyValue<Bytes, byte[]> next = keysWithPrefix.next();
+            keys.add(next.key.toString());
+            values.add(new String(next.value));
+            numberOfKeysReturned++;
+        }
+        assertThat(numberOfKeysReturned, is(2));
+        assertThat(keys, is(Arrays.asList("hello", "hi")));
+        assertThat(values, is(Arrays.asList("world", "there")));
+    }
+

Review comment:
       Same comment as in `CachingInMemoryKeyValueStoreTest`




----------------------------------------------------------------
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


Reply via email to