@PostConstruct
  private void start() throws IOException {
    logger.info("starting redis...");

    redisServer.start();

    logger.info(
        String.format(
            "redis listen ports: %s",
            redisServer
                .ports()
                .stream()
                .map(port -> port.toString())
                .collect(Collectors.joining(","))));
  }
  @Before
  public void setup() throws Exception {

    redisServer = new RedisServer(6379);
    redisServer.start();
  }
 @Bean
 public JedisConnectionFactory connectionFactory() throws IOException {
   redisServer = new RedisServer(Protocol.DEFAULT_PORT);
   redisServer.start();
   return new JedisConnectionFactory();
 }