@Test void up() throws Exception { doReturn(setFuture).when(client).set("__com.netflix.evcache.server.healthcheck", 300, "Greed is good!"); doReturn(true).when(setFuture).get(5, TimeUnit.SECONDS); doReturn(getFuture).when(client).asyncGet("__com.netflix.evcache.server.healthcheck"); doReturn("Greed is good!").when(getFuture).get(5, TimeUnit.SECONDS); StepVerifier.create(indicator.doHealthCheck(builder)) .expectNext(new Health.Builder().up().build()) .verifyComplete(); }
@Override protected Mono<Health> doHealthCheck(final Health.Builder builder) { return trySetOperation().zipWith(tryGetOperation(), this::isSuccess) .map(success -> success ? builder.up().build() : builder.outOfService().build()); }
MemcachedReactiveHealthIndicator extends AbstractReactiveHealthIndicator { @Override protected Mono<Health> doHealthCheck(final Health.Builder builder) { return trySetOperation().zipWith(tryGetOperation(), this::isSuccess) .map(success -> success ? builder.up().build() : builder.outOfService().build()); } }
MemcachedReactiveHealthIndicator extends AbstractReactiveHealthIndicator { @Override protected Mono<Health> doHealthCheck(final Health.Builder builder) { return trySetOperation().zipWith(tryGetOperation(), this::isSuccess) .map(success -> success ? builder.up().build() : builder.outOfService().build()); } MemcachedReactiveHealthIndicator(final MemcachedClient client); }
MemcachedReactiveHealthIndicator extends AbstractReactiveHealthIndicator { @Override protected Mono<Health> doHealthCheck(final Health.Builder builder) { return trySetOperation().zipWith(tryGetOperation(), this::isSuccess) .map(success -> success ? builder.up().build() : builder.outOfService().build()); } MemcachedReactiveHealthIndicator(final MemcachedClient client);  }
MemcachedReactiveHealthIndicator extends AbstractReactiveHealthIndicator { @Override protected Mono<Health> doHealthCheck(final Health.Builder builder) { return trySetOperation().zipWith(tryGetOperation(), this::isSuccess) .map(success -> success ? builder.up().build() : builder.outOfService().build()); } MemcachedReactiveHealthIndicator(final MemcachedClient client);   }