@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();
  }
示例#3
0
 @Bean
 public JedisConnectionFactory connectionFactory() throws IOException {
   redisServer = new RedisServer(Protocol.DEFAULT_PORT);
   redisServer.start();
   return new JedisConnectionFactory();
 }