Fixed broken build

This commit is contained in:
Marcin Grzejszczak
2021-07-14 16:55:50 +02:00
parent c3287d9efb
commit 76d63ce44d
4 changed files with 11 additions and 11 deletions

View File

@@ -88,7 +88,7 @@
<datasource-proxy.version>1.7</datasource-proxy.version>
<tomcat-jdbc.version>10.0.6</tomcat-jdbc.version>
<commons-dbcp2.version>2.8.0</commons-dbcp2.version>
<kotlin.version>1.5.10</kotlin.version>
<kotlin.version>1.5.20</kotlin.version>
<!-- Until we switch it to true in sc-build -->
<javadoc.failOnError>true</javadoc.failOnError>

View File

@@ -111,19 +111,19 @@ class SkipPatternConfiguration {
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass(ManagementServerProperties.class)
@ConditionalOnProperty(value = "spring.sleuth.web.ignoreAutoConfiguredSkipPatterns", havingValue = "false",
@ConditionalOnProperty(value = "spring.sleuth.web.ignore-auto-configured-skip-patterns", havingValue = "false",
matchIfMissing = true)
protected static class ManagementSkipPatternProviderConfig {
/**
* Sets or appends {@link ManagementServerProperties#getServlet()} to the skip
* Sets or appends {@link ManagementServerProperties#getBasePath()} to the skip
* pattern. If neither is available then sets the default one
* @param managementServerProperties properties
* @return optional skip pattern
*/
static Optional<Pattern> getPatternForManagementServerProperties(Environment environment,
ManagementServerProperties managementServerProperties) {
String contextPath = managementServerProperties.getServlet().getContextPath();
String contextPath = managementServerProperties.getBasePath();
if (StringUtils.hasText(contextPath)) {
return Optional.of(Pattern.compile(environment.resolvePlaceholders(contextPath) + ".*"));
}
@@ -142,7 +142,7 @@ class SkipPatternConfiguration {
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass({ ServerProperties.class, EndpointsSupplier.class, ExposableWebEndpoint.class })
@ConditionalOnBean(ServerProperties.class)
@ConditionalOnProperty(value = "spring.sleuth.web.ignoreAutoConfiguredSkipPatterns", havingValue = "false",
@ConditionalOnProperty(value = "spring.sleuth.web.ignore-auto-configured-skip-patterns", havingValue = "false",
matchIfMissing = true)
protected static class ActuatorSkipPatternProviderConfig {

View File

@@ -107,10 +107,10 @@ public class SkipPatternProviderConfigTest {
.withConfiguration(
UserConfigurations.of(ManagementContextAutoConfiguration.class, ServerPropertiesConfig.class))
.withPropertyValues("management.endpoints.web.exposure.include=health,info",
"management.server.servlet.context-path=foo")
"management.server.base-path=foo")
.run(context -> {
BDDAssertions.then(extractAllPatterns(context)).containsExactlyInAnyOrder(
"/actuator(/|/(health|health/.*|info|info/.*))?", "foo.*",
"/actuator(/|/(health|health/.*|info|info/.*))?", "/foo.*",
SleuthWebProperties.DEFAULT_SKIP_PATTERN);
});
}
@@ -121,10 +121,10 @@ public class SkipPatternProviderConfigTest {
.withConfiguration(
UserConfigurations.of(ManagementContextAutoConfiguration.class, ServerPropertiesConfig.class))
.withPropertyValues("management.endpoints.web.exposure.include=health,info",
"management.server.servlet.context-path=${test:value}")
"management.server.base-path=${test:value}")
.run(context -> {
BDDAssertions.then(extractAllPatterns(context)).containsExactlyInAnyOrder(
"/actuator(/|/(health|health/.*|info|info/.*))?", "value.*",
"/actuator(/|/(health|health/.*|info|info/.*))?", "/value.*",
SleuthWebProperties.DEFAULT_SKIP_PATTERN);
});
}
@@ -238,7 +238,7 @@ public class SkipPatternProviderConfigTest {
"management.server.port=0")
.run(context -> {
BDDAssertions.then(extractAllPatterns(context)).containsExactlyInAnyOrder(
"/foo/actuator(/|/(health|health/.*|info|info/.*))?",
"/foo/actuator(/|/(health|health/.*|info|info/.*))?", "/foo.*",
SleuthWebProperties.DEFAULT_SKIP_PATTERN);
});
}

View File

@@ -353,7 +353,7 @@ public class TraceFilterIntegrationTests extends AbstractMvcIntegrationTest {
@Primary
ManagementServerProperties managementServerProperties() {
ManagementServerProperties managementServerProperties = new ManagementServerProperties();
managementServerProperties.getServlet().setContextPath("/additionalContextPath");
managementServerProperties.setBasePath("/additionalContextPath");
return managementServerProperties;
}