StartedHealthIndicatorAutoConfiguration { @Bean @ConditionalOnMissingBean(name = "gatewayStartedHealthIndicator") public StartedHealthIndicator gatewayStartedHealthIndicator(SpringGatewayBridge gatewayBridge) { return new StartedHealthIndicator(gatewayBridge::getGatewayStatus); }  @Bean @ConditionalOnMissingBean(name = "gatewayStartedHealthIndicator") StartedHealthIndicator gatewayStartedHealthIndicator(SpringGatewayBridge gatewayBridge);  }
@Test public void shouldCreateHealthIndicatorEvenBeforeGatewayStatusSupplierIsRegistered() { final StartedHealthIndicator actual = sutAutoConfig.gatewayStartedHealthIndicator(helperGatewayBridge); assertThat(actual).isNotNull(); }
@Test public void shouldCreateHealthIndicatorThatReportsHealthBasedOnResultOfRegisteredGatewayStatusSupplier() { final Supplier<Status> statusSupplier = () -> Status.RUNNING; final StartedHealthIndicator healthIndicator = sutAutoConfig.gatewayStartedHealthIndicator(helperGatewayBridge); helperGatewayBridge.registerGatewayStatusSupplier(statusSupplier); final Health actualHealth = healthIndicator.health(); assertThat(actualHealth).isNotNull(); assertThat(actualHealth.getStatus()) .isSameAs(org.springframework.boot.actuate.health.Status.UP); }