|
|
@ -32,6 +32,7 @@ import org.springframework.context.annotation.Configuration;
|
|
|
|
import static org.assertj.core.api.Assertions.assertThat;
|
|
|
|
import static org.assertj.core.api.Assertions.assertThat;
|
|
|
|
import static org.mockito.BDDMockito.given;
|
|
|
|
import static org.mockito.BDDMockito.given;
|
|
|
|
import static org.mockito.Mockito.mock;
|
|
|
|
import static org.mockito.Mockito.mock;
|
|
|
|
|
|
|
|
import static org.mockito.Mockito.never;
|
|
|
|
import static org.mockito.Mockito.times;
|
|
|
|
import static org.mockito.Mockito.times;
|
|
|
|
import static org.mockito.Mockito.verify;
|
|
|
|
import static org.mockito.Mockito.verify;
|
|
|
|
|
|
|
|
|
|
|
@ -54,7 +55,7 @@ public class HealthEndpointAutoConfigurationTests {
|
|
|
|
.run((context) -> {
|
|
|
|
.run((context) -> {
|
|
|
|
ReactiveHealthIndicator indicator = context.getBean(
|
|
|
|
ReactiveHealthIndicator indicator = context.getBean(
|
|
|
|
"reactiveHealthIndicator", ReactiveHealthIndicator.class);
|
|
|
|
"reactiveHealthIndicator", ReactiveHealthIndicator.class);
|
|
|
|
verify(indicator, times(0)).health();
|
|
|
|
verify(indicator, never()).health();
|
|
|
|
Health health = context.getBean(HealthEndpoint.class).health();
|
|
|
|
Health health = context.getBean(HealthEndpoint.class).health();
|
|
|
|
assertThat(health.getStatus()).isEqualTo(Status.UP);
|
|
|
|
assertThat(health.getStatus()).isEqualTo(Status.UP);
|
|
|
|
assertThat(health.getDetails()).isNotEmpty();
|
|
|
|
assertThat(health.getDetails()).isNotEmpty();
|
|
|
@ -70,7 +71,7 @@ public class HealthEndpointAutoConfigurationTests {
|
|
|
|
.run((context) -> {
|
|
|
|
.run((context) -> {
|
|
|
|
ReactiveHealthIndicator indicator = context.getBean(
|
|
|
|
ReactiveHealthIndicator indicator = context.getBean(
|
|
|
|
"reactiveHealthIndicator", ReactiveHealthIndicator.class);
|
|
|
|
"reactiveHealthIndicator", ReactiveHealthIndicator.class);
|
|
|
|
verify(indicator, times(0)).health();
|
|
|
|
verify(indicator, never()).health();
|
|
|
|
Health health = context.getBean(HealthEndpoint.class).health();
|
|
|
|
Health health = context.getBean(HealthEndpoint.class).health();
|
|
|
|
assertThat(health.getStatus()).isEqualTo(Status.UP);
|
|
|
|
assertThat(health.getStatus()).isEqualTo(Status.UP);
|
|
|
|
assertThat(health.getDetails()).containsOnlyKeys("reactive");
|
|
|
|
assertThat(health.getDetails()).containsOnlyKeys("reactive");
|
|
|
@ -89,8 +90,8 @@ public class HealthEndpointAutoConfigurationTests {
|
|
|
|
HealthIndicator.class);
|
|
|
|
HealthIndicator.class);
|
|
|
|
ReactiveHealthIndicator reactiveHealthIndicator = context.getBean(
|
|
|
|
ReactiveHealthIndicator reactiveHealthIndicator = context.getBean(
|
|
|
|
"reactiveHealthIndicator", ReactiveHealthIndicator.class);
|
|
|
|
"reactiveHealthIndicator", ReactiveHealthIndicator.class);
|
|
|
|
verify(indicator, times(0)).health();
|
|
|
|
verify(indicator, never()).health();
|
|
|
|
verify(reactiveHealthIndicator, times(0)).health();
|
|
|
|
verify(reactiveHealthIndicator, never()).health();
|
|
|
|
Health health = context.getBean(HealthEndpoint.class).health();
|
|
|
|
Health health = context.getBean(HealthEndpoint.class).health();
|
|
|
|
assertThat(health.getStatus()).isEqualTo(Status.UP);
|
|
|
|
assertThat(health.getStatus()).isEqualTo(Status.UP);
|
|
|
|
assertThat(health.getDetails()).containsOnlyKeys("simple",
|
|
|
|
assertThat(health.getDetails()).containsOnlyKeys("simple",
|
|
|
|