From 76d63ce44d20ddb57100d67e0246aceca7bda24f Mon Sep 17 00:00:00 2001 From: Marcin Grzejszczak Date: Wed, 14 Jul 2021 16:55:50 +0200 Subject: [PATCH] Fixed broken build --- pom.xml | 2 +- .../instrument/web/SkipPatternConfiguration.java | 8 ++++---- .../instrument/web/SkipPatternProviderConfigTest.java | 10 +++++----- .../instrument/web/TraceFilterIntegrationTests.java | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/pom.xml b/pom.xml index 709f42cc0..f62989f37 100644 --- a/pom.xml +++ b/pom.xml @@ -88,7 +88,7 @@ 1.7 10.0.6 2.8.0 - 1.5.10 + 1.5.20 true diff --git a/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/web/SkipPatternConfiguration.java b/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/web/SkipPatternConfiguration.java index f635072ab..280229121 100644 --- a/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/web/SkipPatternConfiguration.java +++ b/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/web/SkipPatternConfiguration.java @@ -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 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 { diff --git a/spring-cloud-sleuth-autoconfigure/src/test/java/org/springframework/cloud/sleuth/autoconfig/instrument/web/SkipPatternProviderConfigTest.java b/spring-cloud-sleuth-autoconfigure/src/test/java/org/springframework/cloud/sleuth/autoconfig/instrument/web/SkipPatternProviderConfigTest.java index aca9c1387..107638006 100644 --- a/spring-cloud-sleuth-autoconfigure/src/test/java/org/springframework/cloud/sleuth/autoconfig/instrument/web/SkipPatternProviderConfigTest.java +++ b/spring-cloud-sleuth-autoconfigure/src/test/java/org/springframework/cloud/sleuth/autoconfig/instrument/web/SkipPatternProviderConfigTest.java @@ -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); }); } diff --git a/tests/brave/spring-cloud-sleuth-instrumentation-mvc-tests/src/test/java/org/springframework/cloud/sleuth/brave/instrument/web/TraceFilterIntegrationTests.java b/tests/brave/spring-cloud-sleuth-instrumentation-mvc-tests/src/test/java/org/springframework/cloud/sleuth/brave/instrument/web/TraceFilterIntegrationTests.java index 6ed1f1983..4edb0ff0e 100644 --- a/tests/brave/spring-cloud-sleuth-instrumentation-mvc-tests/src/test/java/org/springframework/cloud/sleuth/brave/instrument/web/TraceFilterIntegrationTests.java +++ b/tests/brave/spring-cloud-sleuth-instrumentation-mvc-tests/src/test/java/org/springframework/cloud/sleuth/brave/instrument/web/TraceFilterIntegrationTests.java @@ -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; }