Commit f0f999a2 authored by Phillip Webb's avatar Phillip Webb

Merge branch '2.0.x'

parents 31b0fc23 5d219bcd
...@@ -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.EndpointId;
import org.springframework.boot.actuate.endpoint.web.PathMapper; 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 * A {@link PathMapper} implementation that uses a simple {@link Map} to determine the
...@@ -40,7 +41,9 @@ class MappingWebEndpointPathMapper implements PathMapper { ...@@ -40,7 +41,9 @@ class MappingWebEndpointPathMapper implements PathMapper {
@Override @Override
public String getRootPath(EndpointId endpointId) { 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);
} }
} }
...@@ -55,12 +55,7 @@ public class CouchbaseHealthIndicator extends AbstractHealthIndicator { ...@@ -55,12 +55,7 @@ public class CouchbaseHealthIndicator extends AbstractHealthIndicator {
@Override @Override
protected void doHealthCheck(Health.Builder builder) throws Exception { protected void doHealthCheck(Health.Builder builder) throws Exception {
DiagnosticsReport diagnostics = this.cluster.diagnostics(); DiagnosticsReport diagnostics = this.cluster.diagnostics();
if (isCouchbaseUp(diagnostics)) { builder = isCouchbaseUp(diagnostics) ? builder.up() : builder.down();
builder.up();
}
else {
builder.down();
}
builder.withDetail("sdk", diagnostics.sdk()); builder.withDetail("sdk", diagnostics.sdk());
builder.withDetail("endpoints", diagnostics.endpoints().stream() builder.withDetail("endpoints", diagnostics.endpoints().stream()
.map(this::describe).collect(Collectors.toList())); .map(this::describe).collect(Collectors.toList()));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment