private void populateData(int count) { JsonEncoder jsonEncoder = new JsonEncoder(); try { for (long i = 0; i < count; i++) { Object value = ImmutableMap.of("id", Long.toString(i), "value", UUID.randomUUID().toString()); try (Jedis jedis = embeddedRedis.getJedisPool().getResource()) { jedis.set(tableName + ":" + i, jsonEncoder.toString(value)); } } } catch (Exception e) { throw Throwables.propagate(e); } }
@AfterClass public void stopRedis() throws Exception { embeddedRedis.close(); }
@BeforeClass public void startRedis() throws Exception { embeddedRedis = EmbeddedRedis.createEmbeddedRedis(); embeddedRedis.start(); }