Browse Source

Polish

pull/14914/head
Phillip Webb 7 years ago
parent
commit
5d219bcd19
  1. 5
      spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/MappingWebEndpointPathMapper.java
  2. 7
      spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/couchbase/CouchbaseHealthIndicator.java

5
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/MappingWebEndpointPathMapper.java

@ -21,6 +21,7 @@ import java.util.Map; @@ -21,6 +21,7 @@ import java.util.Map;
import org.springframework.boot.actuate.endpoint.EndpointId;
import org.springframework.boot.actuate.endpoint.web.PathMapper;
import org.springframework.util.StringUtils;
/**
* A {@link PathMapper} implementation that uses a simple {@link Map} to determine the
@ -46,7 +47,9 @@ class MappingWebEndpointPathMapper implements PathMapper { @@ -46,7 +47,9 @@ class MappingWebEndpointPathMapper implements PathMapper {
@Override
public String getRootPath(EndpointId endpointId) {
return this.pathMapping.getOrDefault(endpointId, endpointId.toString());
String path = this.pathMapping.get(endpointId);
return StringUtils.hasText(path) ? path
: PathMapper.useEndpointId().getRootPath(endpointId);
}
}

7
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/couchbase/CouchbaseHealthIndicator.java

@ -147,12 +147,7 @@ public class CouchbaseHealthIndicator extends AbstractHealthIndicator { @@ -147,12 +147,7 @@ public class CouchbaseHealthIndicator extends AbstractHealthIndicator {
@Override
public void checkHealth(Builder builder) throws Exception {
DiagnosticsReport diagnostics = this.cluster.diagnostics();
if (isCouchbaseUp(diagnostics)) {
builder.up();
}
else {
builder.down();
}
builder = isCouchbaseUp(diagnostics) ? builder.up() : builder.down();
builder.withDetail("sdk", diagnostics.sdk());
builder.withDetail("endpoints", diagnostics.endpoints().stream()
.map(this::describe).collect(Collectors.toList()));

Loading…
Cancel
Save