@Test public void testHealthy() throws Exception { when(registry.runHealthCheck(anyString())).thenReturn(HealthCheck.Result.healthy()); final HealthCheckGauge gauge = new HealthCheckGauge(registry, "foo"); assertThat(gauge.getValue(), equalTo(1)); }
@Override public Integer getValue() { final HealthCheck.Result result = registry.runHealthCheck(name); return result.isHealthy() ? 1 : 0; }
HealthCheckGauge implements Gauge<Integer> { @Override public Integer getValue() { final HealthCheck.Result result = registry.runHealthCheck(name); return result.isHealthy() ? 1 : 0; } }
HealthCheckGauge implements Gauge<Integer> { @Override public Integer getValue() { final HealthCheck.Result result = registry.runHealthCheck(name); return result.isHealthy() ? 1 : 0; } HealthCheckGauge(final HealthCheckRegistry registry, final String name); }
HealthCheckGauge implements Gauge<Integer> { @Override public Integer getValue() { final HealthCheck.Result result = registry.runHealthCheck(name); return result.isHealthy() ? 1 : 0; } HealthCheckGauge(final HealthCheckRegistry registry, final String name); @Override Integer getValue(); }
HealthCheckGauge implements Gauge<Integer> { @Override public Integer getValue() { final HealthCheck.Result result = registry.runHealthCheck(name); return result.isHealthy() ? 1 : 0; } HealthCheckGauge(final HealthCheckRegistry registry, final String name); @Override Integer getValue();  }