Package org.springframework.data.redis.connection

Examples of org.springframework.data.redis.connection.RedisConnection.info()


  @Override
  protected void doHealthCheck(Health.Builder builder) throws Exception {
    RedisConnection connection = RedisConnectionUtils
        .getConnection(this.redisConnectionFactory);
    try {
      Properties info = connection.info();
      builder.up().withDetail("version", info.getProperty("redis_version"));
    }
    finally {
      RedisConnectionUtils.releaseConnection(connection,
          this.redisConnectionFactory);
View Full Code Here


    info.put("redis_version", "2.8.9");

    RedisConnection redisConnection = mock(RedisConnection.class);
    RedisConnectionFactory redisConnectionFactory = mock(RedisConnectionFactory.class);
    given(redisConnectionFactory.getConnection()).willReturn(redisConnection);
    given(redisConnection.info()).willReturn(info);
    RedisHealthIndicator healthIndicator = new RedisHealthIndicator(
        redisConnectionFactory);

    Health health = healthIndicator.health();
    assertEquals(Status.UP, health.getStatus());
View Full Code Here

  @Test
  public void redisIsDown() throws Exception {
    RedisConnection redisConnection = mock(RedisConnection.class);
    RedisConnectionFactory redisConnectionFactory = mock(RedisConnectionFactory.class);
    given(redisConnectionFactory.getConnection()).willReturn(redisConnection);
    given(redisConnection.info()).willThrow(
        new RedisConnectionFailureException("Connection failed"));
    RedisHealthIndicator healthIndicator = new RedisHealthIndicator(
        redisConnectionFactory);

    Health health = healthIndicator.health();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.