@Test public void returnsConnectionWhenPingThrows() throws Exception { when(jedis.ping()).thenThrow(new JedisException("boom")); try { healthcheck.check(); assert_().fail("expected a JedisException, got nothing"); } catch (JedisException e) { verify(jedis).close(); } }
@Override protected Result check() throws Exception { try (Jedis jedis = pool.getResource()) { final String pong = jedis.ping(); if ("PONG".equals(pong)) { return Result.healthy(); } } return Result.unhealthy("Could not ping redis"); }
JedisHealthCheck extends HealthCheck { @Override protected Result check() throws Exception { try (Jedis jedis = pool.getResource()) { final String pong = jedis.ping(); if ("PONG".equals(pong)) { return Result.healthy(); } } return Result.unhealthy("Could not ping redis"); } }
JedisHealthCheck extends HealthCheck { @Override protected Result check() throws Exception { try (Jedis jedis = pool.getResource()) { final String pong = jedis.ping(); if ("PONG".equals(pong)) { return Result.healthy(); } } return Result.unhealthy("Could not ping redis"); } JedisHealthCheck(JedisPool pool); }
JedisHealthCheck extends HealthCheck { @Override protected Result check() throws Exception { try (Jedis jedis = pool.getResource()) { final String pong = jedis.ping(); if ("PONG".equals(pong)) { return Result.healthy(); } } return Result.unhealthy("Could not ping redis"); } JedisHealthCheck(JedisPool pool);  }
JedisHealthCheck extends HealthCheck { @Override protected Result check() throws Exception { try (Jedis jedis = pool.getResource()) { final String pong = jedis.ping(); if ("PONG".equals(pong)) { return Result.healthy(); } } return Result.unhealthy("Could not ping redis"); } JedisHealthCheck(JedisPool pool);   }