@Test public void registersJedisInjectableProvider() throws Exception { bundle.run(config, environment); ArgumentCaptor<JedisFactory> captor = ArgumentCaptor.forClass(JedisFactory.class); verify(jerseyEnvironment, atLeastOnce()).register(captor.capture()); assertThat(captor.getValue()).isNotNull(); }
@Override public void run(C configuration, Environment environment) throws Exception { pool = getJedisFactory(configuration).build(environment); environment.healthChecks().register("redis", new JedisHealthCheck(pool)); environment.jersey().register(new JedisPoolBinder(pool)); environment.metrics().register("redis.connection.idle", (Gauge) () -> pool.getNumIdle()); environment.metrics().register("redis.connection.active", (Gauge) () -> pool.getNumActive()); environment.metrics().register("redis.connection.wait", (Gauge) () -> pool.getNumWaiters()); }
JedisBundle implements ConfiguredBundle<C>, JedisConfiguration<C> { @Override public void run(C configuration, Environment environment) throws Exception { pool = getJedisFactory(configuration).build(environment); environment.healthChecks().register("redis", new JedisHealthCheck(pool)); environment.jersey().register(new JedisPoolBinder(pool)); environment.metrics().register("redis.connection.idle", (Gauge) () -> pool.getNumIdle()); environment.metrics().register("redis.connection.active", (Gauge) () -> pool.getNumActive()); environment.metrics().register("redis.connection.wait", (Gauge) () -> pool.getNumWaiters()); } }
JedisBundle implements ConfiguredBundle<C>, JedisConfiguration<C> { @Override public void run(C configuration, Environment environment) throws Exception { pool = getJedisFactory(configuration).build(environment); environment.healthChecks().register("redis", new JedisHealthCheck(pool)); environment.jersey().register(new JedisPoolBinder(pool)); environment.metrics().register("redis.connection.idle", (Gauge) () -> pool.getNumIdle()); environment.metrics().register("redis.connection.active", (Gauge) () -> pool.getNumActive()); environment.metrics().register("redis.connection.wait", (Gauge) () -> pool.getNumWaiters()); }  }
JedisBundle implements ConfiguredBundle<C>, JedisConfiguration<C> { @Override public void run(C configuration, Environment environment) throws Exception { pool = getJedisFactory(configuration).build(environment); environment.healthChecks().register("redis", new JedisHealthCheck(pool)); environment.jersey().register(new JedisPoolBinder(pool)); environment.metrics().register("redis.connection.idle", (Gauge) () -> pool.getNumIdle()); environment.metrics().register("redis.connection.active", (Gauge) () -> pool.getNumActive()); environment.metrics().register("redis.connection.wait", (Gauge) () -> pool.getNumWaiters()); }  JedisPool getPool(); @Override void initialize(Bootstrap<?> bootstrap); @Override void run(C configuration, Environment environment); }
JedisBundle implements ConfiguredBundle<C>, JedisConfiguration<C> { @Override public void run(C configuration, Environment environment) throws Exception { pool = getJedisFactory(configuration).build(environment); environment.healthChecks().register("redis", new JedisHealthCheck(pool)); environment.jersey().register(new JedisPoolBinder(pool)); environment.metrics().register("redis.connection.idle", (Gauge) () -> pool.getNumIdle()); environment.metrics().register("redis.connection.active", (Gauge) () -> pool.getNumActive()); environment.metrics().register("redis.connection.wait", (Gauge) () -> pool.getNumWaiters()); }  JedisPool getPool(); @Override void initialize(Bootstrap<?> bootstrap); @Override void run(C configuration, Environment environment);  }