Merge pull request #18531 from izeye
* pr/18531: Polish Closes gh-18531
This commit is contained in:
commit
e9892be4ee
|
@ -57,7 +57,7 @@ class HealthContributorRegistryHealthIndicatorRegistryAdapterTests {
|
|||
}
|
||||
|
||||
@Test
|
||||
void unregisterWhenDelegatesToContributorRegistry() {
|
||||
void unregisterDelegatesToContributorRegistry() {
|
||||
HealthIndicator healthIndicator = mock(HealthIndicator.class);
|
||||
this.contributorRegistry.registerContributor("test", healthIndicator);
|
||||
HealthIndicator unregistered = this.adapter.unregister("test");
|
||||
|
@ -89,7 +89,7 @@ class HealthContributorRegistryHealthIndicatorRegistryAdapterTests {
|
|||
}
|
||||
|
||||
@Test
|
||||
void getAllDelegatesContributorRegistry() {
|
||||
void getAllDelegatesToContributorRegistry() {
|
||||
HealthIndicator healthIndicator = mock(HealthIndicator.class);
|
||||
this.contributorRegistry.registerContributor("test", healthIndicator);
|
||||
Map<String, HealthIndicator> all = this.adapter.getAll();
|
||||
|
|
|
@ -16,8 +16,6 @@
|
|||
|
||||
package org.springframework.boot.actuate.autoconfigure.health;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.micrometer.core.instrument.Gauge;
|
||||
import io.micrometer.core.instrument.MeterRegistry;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
@ -27,7 +25,6 @@ import org.springframework.boot.actuate.autoconfigure.metrics.CompositeMeterRegi
|
|||
import org.springframework.boot.actuate.autoconfigure.metrics.MetricsAutoConfiguration;
|
||||
import org.springframework.boot.actuate.health.CompositeHealthIndicator;
|
||||
import org.springframework.boot.actuate.health.HealthAggregator;
|
||||
import org.springframework.boot.actuate.health.HealthIndicator;
|
||||
import org.springframework.boot.actuate.health.HealthIndicatorRegistry;
|
||||
import org.springframework.boot.actuate.health.Status;
|
||||
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
|
||||
|
@ -61,12 +58,9 @@ public class HealthIndicatorRegistryInjectionIntegrationTests {
|
|||
static class Config {
|
||||
|
||||
Config(HealthAggregator healthAggregator, HealthIndicatorRegistry healthIndicatorRegistry,
|
||||
List<HealthIndicator> healthIndicators, MeterRegistry registry) {
|
||||
MeterRegistry registry) {
|
||||
CompositeHealthIndicator healthIndicator = new CompositeHealthIndicator(healthAggregator,
|
||||
healthIndicatorRegistry);
|
||||
for (int i = 0; i < healthIndicators.size(); i++) {
|
||||
healthIndicatorRegistry.register(Integer.toString(i), healthIndicators.get(i));
|
||||
}
|
||||
Gauge.builder("health", healthIndicator, this::getGuageValue)
|
||||
.description("Spring boot health indicator. 3=UP, 2=OUT_OF_SERVICE, 1=DOWN, 0=UNKNOWN")
|
||||
.strongReference(true).register(registry);
|
||||
|
|
|
@ -58,7 +58,7 @@ class ReactiveHealthContributorRegistryReactiveHealthIndicatorRegistryAdapterTes
|
|||
}
|
||||
|
||||
@Test
|
||||
void unregisterWhenDelegatesToContributorRegistry() {
|
||||
void unregisterDelegatesToContributorRegistry() {
|
||||
ReactiveHealthIndicator healthIndicator = mock(ReactiveHealthIndicator.class);
|
||||
this.contributorRegistry.registerContributor("test", healthIndicator);
|
||||
ReactiveHealthIndicator unregistered = this.adapter.unregister("test");
|
||||
|
@ -90,7 +90,7 @@ class ReactiveHealthContributorRegistryReactiveHealthIndicatorRegistryAdapterTes
|
|||
}
|
||||
|
||||
@Test
|
||||
void getAllDelegatesContributorRegistry() {
|
||||
void getAllDelegatesToContributorRegistry() {
|
||||
ReactiveHealthIndicator healthIndicator = mock(ReactiveHealthIndicator.class);
|
||||
this.contributorRegistry.registerContributor("test", healthIndicator);
|
||||
Map<String, ReactiveHealthIndicator> all = this.adapter.getAll();
|
||||
|
|
Loading…
Reference in New Issue