byte[] serializedValue = redisTemplate.dump(key1);
assertNotNull(serializedValue);
redisTemplate.delete(key1);
redisTemplate.restore(key1, serializedValue, 200, TimeUnit.MILLISECONDS);
assertThat(redisTemplate.boundValueOps(key1).get(), isEqual(value1));
waitFor(new TestCondition() {
public boolean passes() {
return (!redisTemplate.hasKey(key1));
}
}, 400);
}