Improve test coverage InMemoryKeyValueLoggedStore
Author: Jeyhun Karimov
Reviewers: Matthias J. Sax Damian Guy
Closes from jeyhunkarimov/KAFKA-4658
*/
package org.apache.kafka.streams.state.internals;
+import org.apache.kafka.streams.KeyValue;
import org.apache.kafka.streams.processor.ProcessorContext;
import org.apache.kafka.streams.processor.StateStoreSupplier;
import org.apache.kafka.streams.state.KeyValueStore;
import org.apache.kafka.streams.state.Stores;
+import org.junit.Test;
+import java.util.ArrayList;
import java.util.Collections;
+import java.util.List;
+
+import static org.junit.Assert.assertEquals;
public class InMemoryKeyValueLoggedStoreTest extends AbstractKeyValueStoreTest {
@@ -46,4 +52,14 @@ public class InMemoryKeyValueLoggedStoreTest extends AbstractKeyValueStoreTest {
store.init(context, store);
return store;
}
+
+ @Test
+ public void shouldPutAll() {
+ List<KeyValue<Integer, String>> entries = new ArrayList<>();
+ entries.add(new KeyValue<>(1, "1"));
+ entries.add(new KeyValue<>(2, "2"));
+ store.putAll(entries);
+ assertEquals(store.get(1), "1");
+ assertEquals(store.get(2), "2");
+ }
}
