ProducerTest.java :
@before
public void setUp() throws IOException {
Jedis jedis = new Jedis("localhost");
jedis.flushAll();
jedis.disconnect();
}
I don't know why do this , I think change @before to @after maybe more appropriate.
so , I use this:
@Before
public void setUp() throws IOException {
jedis = new Jedis(redisHost, port, 1000);
jedis.auth(auth);//set redis password
}
@After
public void flush() throws IOException {
jedis.flushAll();
jedis.disconnect();
}