com.lordofthejars.nosqlunit.demo.custom.PropertiesCustomInsertion Maven / Gradle / Ivy
package com.lordofthejars.nosqlunit.demo.custom;
import java.io.InputStream;
import java.util.Map.Entry;
import java.util.Properties;
import java.util.Set;
import redis.clients.jedis.BinaryJedisCommands;
import com.lordofthejars.nosqlunit.redis.RedisConnectionCallback;
import com.lordofthejars.nosqlunit.redis.RedisInsertionStrategy;
public class PropertiesCustomInsertion implements RedisInsertionStrategy {
@Override
public void insert(RedisConnectionCallback connection, InputStream dataset) throws Throwable {
Properties properties = new Properties();
properties.load(dataset);
BinaryJedisCommands insertionJedis = connection.insertionJedis();
Set> entrySet = properties.entrySet();
for (Entry