Skip to content

Commit

Permalink
Merge branch '2.3.x'
Browse files Browse the repository at this point in the history
Closes gh-24251
  • Loading branch information
snicoll committed Nov 25, 2020
2 parents 8bcc3d1 + 9b992af commit b1678ee
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Expand Up @@ -60,7 +60,7 @@ private void doHealthCheck(Health.Builder builder, RedisConnection connection) {
RedisHealth.up(builder, ((RedisClusterConnection) connection).clusterGetClusterInfo());
}
else {
RedisHealth.up(builder, connection.info());
RedisHealth.up(builder, connection.info("server"));
}
}

Expand Down
Expand Up @@ -67,7 +67,7 @@ private Mono<Health> getHealth(Health.Builder builder, ReactiveRedisConnection c
return ((ReactiveRedisClusterConnection) connection).clusterGetClusterInfo()
.map((info) -> up(builder, info));
}
return connection.serverCommands().info().map((info) -> up(builder, info));
return connection.serverCommands().info("server").map((info) -> up(builder, info));
}

private Health up(Health.Builder builder, Properties info) {
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -51,7 +51,7 @@ void redisIsUp() {
Properties info = new Properties();
info.put("redis_version", "2.8.9");
RedisConnection redisConnection = mock(RedisConnection.class);
given(redisConnection.info()).willReturn(info);
given(redisConnection.info("server")).willReturn(info);
RedisHealthIndicator healthIndicator = createHealthIndicator(redisConnection);
Health health = healthIndicator.health();
assertThat(health.getStatus()).isEqualTo(Status.UP);
Expand All @@ -61,7 +61,7 @@ void redisIsUp() {
@Test
void redisIsDown() {
RedisConnection redisConnection = mock(RedisConnection.class);
given(redisConnection.info()).willThrow(new RedisConnectionFailureException("Connection failed"));
given(redisConnection.info("server")).willThrow(new RedisConnectionFailureException("Connection failed"));
RedisHealthIndicator healthIndicator = createHealthIndicator(redisConnection);
Health health = healthIndicator.health();
assertThat(health.getStatus()).isEqualTo(Status.DOWN);
Expand Down
Expand Up @@ -55,7 +55,7 @@ void redisIsUp() {
ReactiveRedisConnection redisConnection = mock(ReactiveRedisConnection.class);
given(redisConnection.closeLater()).willReturn(Mono.empty());
ReactiveServerCommands commands = mock(ReactiveServerCommands.class);
given(commands.info()).willReturn(Mono.just(info));
given(commands.info("server")).willReturn(Mono.just(info));
RedisReactiveHealthIndicator healthIndicator = createHealthIndicator(redisConnection, commands);
Mono<Health> health = healthIndicator.health();
StepVerifier.create(health).consumeNextWith((h) -> {
Expand Down Expand Up @@ -91,7 +91,7 @@ void redisClusterIsUp() {
@Test
void redisCommandIsDown() {
ReactiveServerCommands commands = mock(ReactiveServerCommands.class);
given(commands.info()).willReturn(Mono.error(new RedisConnectionFailureException("Connection failed")));
given(commands.info("server")).willReturn(Mono.error(new RedisConnectionFailureException("Connection failed")));
ReactiveRedisConnection redisConnection = mock(ReactiveRedisConnection.class);
given(redisConnection.closeLater()).willReturn(Mono.empty());
RedisReactiveHealthIndicator healthIndicator = createHealthIndicator(redisConnection, commands);
Expand Down

0 comments on commit b1678ee

Please sign in to comment.