Merge branch '2.1.x'
This commit is contained in:
@@ -72,7 +72,8 @@ public class AsyncDefaultAutoConfiguration {
|
||||
*/
|
||||
@Configuration
|
||||
@ConditionalOnMissingBean(AsyncConfigurer.class)
|
||||
@ConditionalOnProperty(value = "spring.sleuth.async.configurer.enabled", matchIfMissing = true)
|
||||
@ConditionalOnProperty(value = "spring.sleuth.async.configurer.enabled",
|
||||
matchIfMissing = true)
|
||||
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
|
||||
static class DefaultAsyncConfigurerSupport extends AsyncConfigurerSupport {
|
||||
|
||||
|
||||
@@ -41,7 +41,8 @@ import org.springframework.context.annotation.Configuration;
|
||||
@AutoConfigureAfter(TraceAutoConfiguration.class)
|
||||
@ConditionalOnClass(HystrixCommand.class)
|
||||
@ConditionalOnBean(Tracing.class)
|
||||
@ConditionalOnProperty(value = "spring.sleuth.hystrix.strategy.enabled", matchIfMissing = true)
|
||||
@ConditionalOnProperty(value = "spring.sleuth.hystrix.strategy.enabled",
|
||||
matchIfMissing = true)
|
||||
public class SleuthHystrixAutoConfiguration {
|
||||
|
||||
@Bean
|
||||
|
||||
@@ -80,7 +80,8 @@ import org.springframework.util.ReflectionUtils;
|
||||
public class TraceMessagingAutoConfiguration {
|
||||
|
||||
@Configuration
|
||||
@ConditionalOnProperty(value = "spring.sleuth.messaging.rabbit.enabled", matchIfMissing = true)
|
||||
@ConditionalOnProperty(value = "spring.sleuth.messaging.rabbit.enabled",
|
||||
matchIfMissing = true)
|
||||
@ConditionalOnClass(RabbitTemplate.class)
|
||||
protected static class SleuthRabbitConfiguration {
|
||||
|
||||
@@ -105,7 +106,8 @@ public class TraceMessagingAutoConfiguration {
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@ConditionalOnProperty(value = "spring.sleuth.messaging.kafka.enabled", matchIfMissing = true)
|
||||
@ConditionalOnProperty(value = "spring.sleuth.messaging.kafka.enabled",
|
||||
matchIfMissing = true)
|
||||
@ConditionalOnClass(ProducerFactory.class)
|
||||
protected static class SleuthKafkaConfiguration {
|
||||
|
||||
@@ -128,7 +130,8 @@ public class TraceMessagingAutoConfiguration {
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@ConditionalOnProperty(value = "spring.sleuth.messaging.jms.enabled", matchIfMissing = true)
|
||||
@ConditionalOnProperty(value = "spring.sleuth.messaging.jms.enabled",
|
||||
matchIfMissing = true)
|
||||
@ConditionalOnClass(JmsListenerConfigurer.class)
|
||||
@ConditionalOnBean(JmsListenerEndpointRegistry.class)
|
||||
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
|
||||
|
||||
@@ -41,7 +41,8 @@ import org.springframework.web.socket.config.annotation.StompEndpointRegistry;
|
||||
@Configuration
|
||||
@ConditionalOnClass(DelegatingWebSocketMessageBrokerConfiguration.class)
|
||||
@ConditionalOnBean(Tracing.class)
|
||||
@ConditionalOnProperty(value = "spring.sleuth.integration.websockets.enabled", matchIfMissing = true)
|
||||
@ConditionalOnProperty(value = "spring.sleuth.integration.websockets.enabled",
|
||||
matchIfMissing = true)
|
||||
public class TraceWebSocketAutoConfiguration
|
||||
extends AbstractWebSocketMessageBrokerConfigurer {
|
||||
|
||||
|
||||
@@ -42,7 +42,8 @@ import org.springframework.context.annotation.Configuration;
|
||||
@AutoConfigureAfter(TraceAutoConfiguration.class)
|
||||
@ConditionalOnBean(Tracing.class)
|
||||
@ConditionalOnClass(RxJavaSchedulersHook.class)
|
||||
@ConditionalOnProperty(value = "spring.sleuth.rxjava.schedulers.hook.enabled", matchIfMissing = true)
|
||||
@ConditionalOnProperty(value = "spring.sleuth.rxjava.schedulers.hook.enabled",
|
||||
matchIfMissing = true)
|
||||
@EnableConfigurationProperties(SleuthRxJavaSchedulersProperties.class)
|
||||
public class RxJavaAutoConfiguration {
|
||||
|
||||
|
||||
@@ -43,7 +43,8 @@ import org.springframework.lang.Nullable;
|
||||
*/
|
||||
@Configuration
|
||||
@ConditionalOnBean(Tracing.class)
|
||||
@ConditionalOnProperty(name = "spring.sleuth.http.enabled", havingValue = "true", matchIfMissing = true)
|
||||
@ConditionalOnProperty(name = "spring.sleuth.http.enabled", havingValue = "true",
|
||||
matchIfMissing = true)
|
||||
@AutoConfigureAfter(TraceWebAutoConfiguration.class)
|
||||
@EnableConfigurationProperties({ TraceKeys.class, SleuthHttpLegacyProperties.class })
|
||||
public class TraceHttpAutoConfiguration {
|
||||
@@ -74,13 +75,15 @@ public class TraceHttpAutoConfiguration {
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnProperty(name = "spring.sleuth.http.legacy.enabled", havingValue = "true")
|
||||
@ConditionalOnProperty(name = "spring.sleuth.http.legacy.enabled",
|
||||
havingValue = "true")
|
||||
HttpClientParser sleuthHttpClientParser(TraceKeys traceKeys) {
|
||||
return new SleuthHttpClientParser(traceKeys);
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnProperty(name = "spring.sleuth.http.legacy.enabled", havingValue = "false", matchIfMissing = true)
|
||||
@ConditionalOnProperty(name = "spring.sleuth.http.legacy.enabled",
|
||||
havingValue = "false", matchIfMissing = true)
|
||||
@ConditionalOnMissingBean
|
||||
HttpClientParser httpClientParser(ErrorParser errorParser) {
|
||||
return new HttpClientParser() {
|
||||
@@ -92,14 +95,16 @@ public class TraceHttpAutoConfiguration {
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnProperty(name = "spring.sleuth.http.legacy.enabled", havingValue = "true")
|
||||
@ConditionalOnProperty(name = "spring.sleuth.http.legacy.enabled",
|
||||
havingValue = "true")
|
||||
HttpServerParser sleuthHttpServerParser(TraceKeys traceKeys,
|
||||
ErrorParser errorParser) {
|
||||
return new SleuthHttpServerParser(traceKeys, errorParser);
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnProperty(name = "spring.sleuth.http.legacy.enabled", havingValue = "false", matchIfMissing = true)
|
||||
@ConditionalOnProperty(name = "spring.sleuth.http.legacy.enabled",
|
||||
havingValue = "false", matchIfMissing = true)
|
||||
@ConditionalOnMissingBean
|
||||
HttpServerParser defaultHttpServerParser() {
|
||||
return new HttpServerParser();
|
||||
|
||||
@@ -51,6 +51,7 @@ import org.springframework.util.StringUtils;
|
||||
* based web application.
|
||||
*
|
||||
* @author Marcin Grzejszczak
|
||||
* @author Tim Ysewyn
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Configuration
|
||||
@@ -74,7 +75,8 @@ public class TraceWebAutoConfiguration {
|
||||
|
||||
@Configuration
|
||||
@ConditionalOnClass(ManagementServerProperties.class)
|
||||
@ConditionalOnProperty(value = "spring.sleuth.web.ignoreAutoConfiguredSkipPatterns", havingValue = "false", matchIfMissing = true)
|
||||
@ConditionalOnProperty(value = "spring.sleuth.web.ignoreAutoConfiguredSkipPatterns",
|
||||
havingValue = "false", matchIfMissing = true)
|
||||
protected static class ManagementSkipPatternProviderConfig {
|
||||
|
||||
/**
|
||||
@@ -106,7 +108,8 @@ public class TraceWebAutoConfiguration {
|
||||
@ConditionalOnClass({ ServerProperties.class, EndpointsSupplier.class,
|
||||
ExposableWebEndpoint.class })
|
||||
@ConditionalOnBean(ServerProperties.class)
|
||||
@ConditionalOnProperty(value = "spring.sleuth.web.ignoreAutoConfiguredSkipPatterns", havingValue = "false", matchIfMissing = true)
|
||||
@ConditionalOnProperty(value = "spring.sleuth.web.ignoreAutoConfiguredSkipPatterns",
|
||||
havingValue = "false", matchIfMissing = true)
|
||||
protected static class ActuatorSkipPatternProviderConfig {
|
||||
|
||||
static Optional<Pattern> getEndpointsPatterns(String contextPath,
|
||||
@@ -118,12 +121,11 @@ public class TraceWebAutoConfiguration {
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
String basePath = webEndpointProperties.getBasePath();
|
||||
String pattern = endpoints.stream().map(PathMappedEndpoint::getRootPath)
|
||||
.map(path -> path + "|" + path + "/.*").collect(
|
||||
Collectors.joining("|",
|
||||
getPathPrefix(contextPath,
|
||||
webEndpointProperties.getBasePath()) + "/(",
|
||||
")"));
|
||||
.map(path -> path + "|" + path + "/.*")
|
||||
.collect(Collectors.joining("|", getPathPrefix(contextPath, basePath),
|
||||
getPathSuffix(contextPath, basePath)));
|
||||
if (StringUtils.hasText(pattern)) {
|
||||
return Optional.of(Pattern.compile(pattern));
|
||||
}
|
||||
@@ -138,6 +140,20 @@ public class TraceWebAutoConfiguration {
|
||||
if (!actuatorBasePath.equals("/")) {
|
||||
result += actuatorBasePath;
|
||||
}
|
||||
boolean ignoreBase = StringUtils.hasText(result) && !result.equals("/");
|
||||
String suffix = "/(";
|
||||
if (ignoreBase) {
|
||||
suffix = "(/|" + suffix;
|
||||
}
|
||||
return result + suffix;
|
||||
}
|
||||
|
||||
private static String getPathSuffix(String contextPath, String actuatorBasePath) {
|
||||
String result = ")";
|
||||
if (StringUtils.hasText(contextPath) || (StringUtils.hasText(actuatorBasePath)
|
||||
&& !"/".equals(actuatorBasePath))) {
|
||||
result += ")?";
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -154,7 +170,8 @@ public class TraceWebAutoConfiguration {
|
||||
|
||||
@Bean
|
||||
@ConditionalOnManagementPort(ManagementPortType.DIFFERENT)
|
||||
@ConditionalOnProperty(name = "management.server.servlet.context-path", havingValue = "/", matchIfMissing = true)
|
||||
@ConditionalOnProperty(name = "management.server.servlet.context-path",
|
||||
havingValue = "/", matchIfMissing = true)
|
||||
public SingleSkipPattern skipPatternForActuatorEndpointsDifferentPort(
|
||||
final ServerProperties serverProperties,
|
||||
final WebEndpointProperties webEndpointProperties,
|
||||
|
||||
@@ -76,7 +76,8 @@ public class TraceWebServletAutoConfiguration {
|
||||
|
||||
// TODO: Rename to exception-logging-filter for 3.0
|
||||
@Bean
|
||||
@ConditionalOnProperty(value = "spring.sleuth.web.exception-logging-filter-enabled", matchIfMissing = true)
|
||||
@ConditionalOnProperty(value = "spring.sleuth.web.exception-logging-filter-enabled",
|
||||
matchIfMissing = true)
|
||||
public FilterRegistrationBean exceptionThrowingFilter(
|
||||
SleuthWebProperties webProperties) {
|
||||
FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean(
|
||||
|
||||
@@ -47,7 +47,8 @@ import org.springframework.web.client.AsyncRestTemplate;
|
||||
*/
|
||||
@Configuration
|
||||
@SleuthWebClientEnabled
|
||||
@ConditionalOnProperty(value = "spring.sleuth.web.async.client.enabled", matchIfMissing = true)
|
||||
@ConditionalOnProperty(value = "spring.sleuth.web.async.client.enabled",
|
||||
matchIfMissing = true)
|
||||
@ConditionalOnClass(AsyncRestTemplate.class)
|
||||
@ConditionalOnBean(HttpTracing.class)
|
||||
@AutoConfigureAfter(TraceWebServletAutoConfiguration.class)
|
||||
|
||||
@@ -54,8 +54,8 @@ public class TraceFeignClientAutoConfiguration {
|
||||
|
||||
@Bean
|
||||
@Scope("prototype")
|
||||
@ConditionalOnClass(name = { "com.netflix.hystrix.HystrixCommand",
|
||||
"feign.hystrix.HystrixFeign" })
|
||||
@ConditionalOnClass(
|
||||
name = { "com.netflix.hystrix.HystrixCommand", "feign.hystrix.HystrixFeign" })
|
||||
@ConditionalOnProperty(name = "feign.hystrix.enabled", havingValue = "true")
|
||||
Feign.Builder feignHystrixBuilder(BeanFactory beanFactory) {
|
||||
return SleuthHystrixFeignBuilder.builder(beanFactory);
|
||||
@@ -64,7 +64,8 @@ public class TraceFeignClientAutoConfiguration {
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
@Scope("prototype")
|
||||
@ConditionalOnProperty(name = "feign.hystrix.enabled", havingValue = "false", matchIfMissing = true)
|
||||
@ConditionalOnProperty(name = "feign.hystrix.enabled", havingValue = "false",
|
||||
matchIfMissing = true)
|
||||
Feign.Builder feignBuilder(BeanFactory beanFactory) {
|
||||
return SleuthFeignBuilder.builder(beanFactory);
|
||||
}
|
||||
@@ -80,7 +81,8 @@ public class TraceFeignClientAutoConfiguration {
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@ConditionalOnProperty(name = "spring.sleuth.feign.processor.enabled", matchIfMissing = true)
|
||||
@ConditionalOnProperty(name = "spring.sleuth.feign.processor.enabled",
|
||||
matchIfMissing = true)
|
||||
protected static class FeignBeanPostProcessorConfiguration {
|
||||
|
||||
@Bean
|
||||
|
||||
@@ -52,7 +52,8 @@ public class SleuthLogAutoConfiguration {
|
||||
protected static class Slf4jConfiguration {
|
||||
|
||||
@Bean
|
||||
@ConditionalOnProperty(value = "spring.sleuth.log.slf4j.enabled", matchIfMissing = true)
|
||||
@ConditionalOnProperty(value = "spring.sleuth.log.slf4j.enabled",
|
||||
matchIfMissing = true)
|
||||
public CurrentTraceContext.ScopeDecorator slf4jSpanDecorator(
|
||||
SleuthProperties sleuthProperties,
|
||||
SleuthSlf4jProperties sleuthSlf4jProperties) {
|
||||
|
||||
@@ -36,7 +36,8 @@ import org.springframework.context.annotation.Configuration;
|
||||
public class SleuthTagPropagationAutoConfiguration {
|
||||
|
||||
@Configuration
|
||||
@ConditionalOnProperty(value = "spring.sleuth.propagation.tag.enabled", matchIfMissing = true)
|
||||
@ConditionalOnProperty(value = "spring.sleuth.propagation.tag.enabled",
|
||||
matchIfMissing = true)
|
||||
@EnableConfigurationProperties(SleuthTagPropagationProperties.class)
|
||||
protected static class TagPropagationConfiguration {
|
||||
|
||||
|
||||
@@ -46,7 +46,8 @@ public class SamplerAutoConfiguration {
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@ConditionalOnBean(type = "org.springframework.cloud.context.scope.refresh.RefreshScope")
|
||||
@ConditionalOnBean(
|
||||
type = "org.springframework.cloud.context.scope.refresh.RefreshScope")
|
||||
protected static class RefreshScopedSamplerConfiguration {
|
||||
|
||||
@Bean
|
||||
@@ -59,7 +60,8 @@ public class SamplerAutoConfiguration {
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@ConditionalOnMissingBean(type = "org.springframework.cloud.context.scope.refresh.RefreshScope")
|
||||
@ConditionalOnMissingBean(
|
||||
type = "org.springframework.cloud.context.scope.refresh.RefreshScope")
|
||||
protected static class NonRefreshScopeSamplerConfiguration {
|
||||
|
||||
@Bean
|
||||
|
||||
@@ -42,7 +42,9 @@ import static org.springframework.boot.test.context.SpringBootTest.WebEnvironmen
|
||||
* @author Marcin Grzejszczak
|
||||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = FinishedSpanHandlerTests.FinishedSpanHandlerAspectTestsConfig.class, webEnvironment = NONE)
|
||||
@SpringBootTest(
|
||||
classes = FinishedSpanHandlerTests.FinishedSpanHandlerAspectTestsConfig.class,
|
||||
webEnvironment = NONE)
|
||||
public class FinishedSpanHandlerTests {
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -37,7 +37,8 @@ import org.springframework.test.context.junit4.SpringRunner;
|
||||
* @author Marcin Grzejszczak
|
||||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = SpanAdjusterTests.SpanAdjusterAspectTestsConfig.class, webEnvironment = SpringBootTest.WebEnvironment.NONE)
|
||||
@SpringBootTest(classes = SpanAdjusterTests.SpanAdjusterAspectTestsConfig.class,
|
||||
webEnvironment = SpringBootTest.WebEnvironment.NONE)
|
||||
public class SpanAdjusterTests {
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -26,7 +26,8 @@ import org.springframework.test.context.junit4.SpringRunner;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = SleuthAnnotationAutoConfiguration.class, properties = "spring.sleuth.annotation.enabled=false")
|
||||
@SpringBootTest(classes = SleuthAnnotationAutoConfiguration.class,
|
||||
properties = "spring.sleuth.annotation.enabled=false")
|
||||
public class SleuthNewSpanParserAnnotationDisableTests {
|
||||
|
||||
@Autowired(required = false)
|
||||
|
||||
@@ -27,7 +27,8 @@ import org.springframework.test.context.junit4.SpringRunner;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = SleuthAnnotationAutoConfiguration.class, properties = "spring.sleuth.enabled=false")
|
||||
@SpringBootTest(classes = SleuthAnnotationAutoConfiguration.class,
|
||||
properties = "spring.sleuth.enabled=false")
|
||||
public class SleuthNewSpanParserAnnotationNoSleuthTests {
|
||||
|
||||
@Autowired(required = false)
|
||||
|
||||
@@ -29,7 +29,8 @@ import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
@SpringBootTest(classes = SleuthSpanCreatorCircularDependencyTests.TestConfiguration.class)
|
||||
@SpringBootTest(
|
||||
classes = SleuthSpanCreatorCircularDependencyTests.TestConfiguration.class)
|
||||
@RunWith(SpringRunner.class)
|
||||
public class SleuthSpanCreatorCircularDependencyTests {
|
||||
|
||||
|
||||
@@ -129,8 +129,8 @@ public class SpanTagAnnotationHandlerTests {
|
||||
|
||||
// tag::spel[]
|
||||
@NewSpan
|
||||
public void getAnnotationForTagValueExpression(
|
||||
@SpanTag(key = "test", expression = "'hello' + ' characters'") String test) {
|
||||
public void getAnnotationForTagValueExpression(@SpanTag(key = "test",
|
||||
expression = "'hello' + ' characters'") String test) {
|
||||
}
|
||||
// end::spel[]
|
||||
|
||||
|
||||
@@ -37,7 +37,9 @@ import org.springframework.test.context.ActiveProfiles;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SpringBootTest(classes = TraceAutoConfigurationWithDisabledSleuthTests.Config.class, properties = "spring.sleuth.enabled=false", webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
||||
@SpringBootTest(classes = TraceAutoConfigurationWithDisabledSleuthTests.Config.class,
|
||||
properties = "spring.sleuth.enabled=false",
|
||||
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
||||
@ActiveProfiles("disabled")
|
||||
public class TraceAutoConfigurationWithDisabledSleuthTests {
|
||||
|
||||
|
||||
@@ -28,8 +28,8 @@ import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Target(ElementType.TYPE)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@EnableAutoConfiguration(exclude = { LoadBalancerAutoConfiguration.class,
|
||||
JmxAutoConfiguration.class })
|
||||
@EnableAutoConfiguration(
|
||||
exclude = { LoadBalancerAutoConfiguration.class, JmxAutoConfiguration.class })
|
||||
// ,TraceSpringIntegrationAutoConfiguration.class,
|
||||
// TraceWebSocketAutoConfiguration.class })
|
||||
@Configuration
|
||||
|
||||
@@ -44,8 +44,8 @@ import static java.util.concurrent.TimeUnit.SECONDS;
|
||||
import static org.assertj.core.api.BDDAssertions.then;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = {
|
||||
TraceAsyncIntegrationTests.TraceAsyncITestConfiguration.class })
|
||||
@SpringBootTest(
|
||||
classes = { TraceAsyncIntegrationTests.TraceAsyncITestConfiguration.class })
|
||||
public class TraceAsyncIntegrationTests {
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -59,8 +59,8 @@ import static org.assertj.core.api.BDDAssertions.then;
|
||||
* @author Marcin Grzejszczak
|
||||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = Application.class, webEnvironment = WebEnvironment.RANDOM_PORT, properties = {
|
||||
"ribbon.eureka.enabled=false", "feign.hystrix.enabled=false" })
|
||||
@SpringBootTest(classes = Application.class, webEnvironment = WebEnvironment.RANDOM_PORT,
|
||||
properties = { "ribbon.eureka.enabled=false", "feign.hystrix.enabled=false" })
|
||||
public class Issue410Tests {
|
||||
|
||||
private static final Log log = LogFactory
|
||||
|
||||
@@ -43,9 +43,10 @@ import static org.assertj.core.api.BDDAssertions.then;
|
||||
* @author Marcin Grzejszczak
|
||||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = Issue546TestsApp.class, properties = {
|
||||
"ribbon.eureka.enabled=false", "feign.hystrix.enabled=false",
|
||||
"server.port=0" }, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
||||
@SpringBootTest(classes = Issue546TestsApp.class,
|
||||
properties = { "ribbon.eureka.enabled=false", "feign.hystrix.enabled=false",
|
||||
"server.port=0" },
|
||||
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
||||
public class Issue546Tests {
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -63,8 +63,9 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
* @author Tyler Van Gorder
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SpringBootTest(classes = GrpcTracingIntegrationTests.TestConfiguration.class, webEnvironment = SpringBootTest.WebEnvironment.NONE, properties = {
|
||||
"grpc.enabled=false", "grpc.inProcessServerName=testServer" })
|
||||
@SpringBootTest(classes = GrpcTracingIntegrationTests.TestConfiguration.class,
|
||||
webEnvironment = SpringBootTest.WebEnvironment.NONE,
|
||||
properties = { "grpc.enabled=false", "grpc.inProcessServerName=testServer" })
|
||||
@DirtiesContext
|
||||
public class GrpcTracingIntegrationTests {
|
||||
|
||||
|
||||
@@ -28,7 +28,8 @@ import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall;
|
||||
* The Hello service definition.
|
||||
* </pre>
|
||||
*/
|
||||
@javax.annotation.Generated(value = "by gRPC proto compiler (version 1.15.1)", comments = "Source: HelloService.proto")
|
||||
@javax.annotation.Generated(value = "by gRPC proto compiler (version 1.15.1)",
|
||||
comments = "Source: HelloService.proto")
|
||||
public final class HelloServiceGrpc {
|
||||
|
||||
public static final String SERVICE_NAME = "HelloService";
|
||||
@@ -43,8 +44,9 @@ public final class HelloServiceGrpc {
|
||||
private HelloServiceGrpc() {
|
||||
}
|
||||
|
||||
@io.grpc.stub.annotations.RpcMethod(fullMethodName = SERVICE_NAME + '/'
|
||||
+ "SayHello", requestType = HelloRequest.class, responseType = HelloReply.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||
@io.grpc.stub.annotations.RpcMethod(fullMethodName = SERVICE_NAME + '/' + "SayHello",
|
||||
requestType = HelloRequest.class, responseType = HelloReply.class,
|
||||
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||
public static io.grpc.MethodDescriptor<HelloRequest, HelloReply> getSayHelloMethod() {
|
||||
io.grpc.MethodDescriptor<HelloRequest, HelloReply> getSayHelloMethod;
|
||||
if ((getSayHelloMethod = HelloServiceGrpc.getSayHelloMethod) == null) {
|
||||
|
||||
@@ -59,7 +59,8 @@ import static org.springframework.boot.test.context.SpringBootTest.WebEnvironmen
|
||||
*
|
||||
* @author Marcin Grzejszczak
|
||||
*/
|
||||
@SpringBootTest(classes = ITTracingChannelInterceptorTests.App.class, webEnvironment = WebEnvironment.NONE)
|
||||
@SpringBootTest(classes = ITTracingChannelInterceptorTests.App.class,
|
||||
webEnvironment = WebEnvironment.NONE)
|
||||
@RunWith(SpringRunner.class)
|
||||
@DirtiesContext
|
||||
public class ITTracingChannelInterceptorTests implements MessageHandler {
|
||||
|
||||
@@ -49,7 +49,8 @@ import static org.assertj.core.api.BDDAssertions.then;
|
||||
* @author Marcin Grzejszczak
|
||||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = TraceMessagingAutoConfigurationTests.Config.class, webEnvironment = SpringBootTest.WebEnvironment.NONE)
|
||||
@SpringBootTest(classes = TraceMessagingAutoConfigurationTests.Config.class,
|
||||
webEnvironment = SpringBootTest.WebEnvironment.NONE)
|
||||
public class TraceMessagingAutoConfigurationTests {
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -41,7 +41,8 @@ public class HelloWorldRestController {
|
||||
@Autowired
|
||||
private ApplicationContext applicationContext;
|
||||
|
||||
@RequestMapping(path = "getHelloWorldMessage", method = RequestMethod.GET, produces = MediaType.TEXT_PLAIN_VALUE)
|
||||
@RequestMapping(path = "getHelloWorldMessage", method = RequestMethod.GET,
|
||||
produces = MediaType.TEXT_PLAIN_VALUE)
|
||||
public ResponseEntity<String> getHelloWorld() throws Exception {
|
||||
|
||||
LOG.info("Inside getHelloWorldMessage");
|
||||
|
||||
@@ -56,7 +56,8 @@ import static org.springframework.boot.test.context.SpringBootTest.WebEnvironmen
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@TestPropertySource(properties = { "spring.application.name=multiplehopsintegrationtests",
|
||||
"spring.sleuth.http.legacy.enabled=true" })
|
||||
@SpringBootTest(classes = MultipleHopsIntegrationTests.Config.class, webEnvironment = RANDOM_PORT)
|
||||
@SpringBootTest(classes = MultipleHopsIntegrationTests.Config.class,
|
||||
webEnvironment = RANDOM_PORT)
|
||||
@ActiveProfiles("baggage")
|
||||
public class MultipleHopsIntegrationTests {
|
||||
|
||||
|
||||
@@ -58,7 +58,8 @@ import static org.springframework.boot.test.context.SpringBootTest.WebEnvironmen
|
||||
* @author Marcin Grzejszczak
|
||||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(webEnvironment = NONE, properties = "spring.sleuth.baggage-keys=country-code,user-id")
|
||||
@SpringBootTest(webEnvironment = NONE,
|
||||
properties = "spring.sleuth.baggage-keys=country-code,user-id")
|
||||
public class BraveTracerTest {
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -47,7 +47,8 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.BDDAssertions.then;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = SpanSubscriberTests.Config.class, webEnvironment = SpringBootTest.WebEnvironment.NONE)
|
||||
@SpringBootTest(classes = SpanSubscriberTests.Config.class,
|
||||
webEnvironment = SpringBootTest.WebEnvironment.NONE)
|
||||
public class SpanSubscriberTests {
|
||||
|
||||
private static final Log log = LogFactory.getLog(SpanSubscriberTests.class);
|
||||
|
||||
@@ -35,7 +35,8 @@ import static org.assertj.core.api.BDDAssertions.then;
|
||||
* @author Chao Chang
|
||||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = TraceRedisAutoConfigurationTests.Config.class, webEnvironment = SpringBootTest.WebEnvironment.NONE)
|
||||
@SpringBootTest(classes = TraceRedisAutoConfigurationTests.Config.class,
|
||||
webEnvironment = SpringBootTest.WebEnvironment.NONE)
|
||||
public class TraceRedisAutoConfigurationTests {
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -40,11 +40,12 @@ import org.springframework.web.client.RestTemplate;
|
||||
import static org.assertj.core.api.BDDAssertions.then;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = IgnoreAutoConfiguredSkipPatternsIntegrationTests.Config.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, properties = {
|
||||
"management.endpoints.web.exposure.include:*",
|
||||
"server.servlet.context-path:/context-path",
|
||||
"spring.sleuth.http.legacy.enabled:true",
|
||||
"spring.sleuth.web.ignoreAutoConfiguredSkipPatterns:true" })
|
||||
@SpringBootTest(classes = IgnoreAutoConfiguredSkipPatternsIntegrationTests.Config.class,
|
||||
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
|
||||
properties = { "management.endpoints.web.exposure.include:*",
|
||||
"server.servlet.context-path:/context-path",
|
||||
"spring.sleuth.http.legacy.enabled:true",
|
||||
"spring.sleuth.web.ignoreAutoConfiguredSkipPatterns:true" })
|
||||
public class IgnoreAutoConfiguredSkipPatternsIntegrationTests {
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -40,10 +40,12 @@ import org.springframework.web.client.RestTemplate;
|
||||
import static org.assertj.core.api.BDDAssertions.then;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = SkipEndPointsIntegrationTestsWithContextPathWithBasePath.Config.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, properties = {
|
||||
"management.endpoints.web.exposure.include:*",
|
||||
"server.servlet.context-path:/context-path",
|
||||
"spring.sleuth.http.legacy.enabled:true" })
|
||||
@SpringBootTest(
|
||||
classes = SkipEndPointsIntegrationTestsWithContextPathWithBasePath.Config.class,
|
||||
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
|
||||
properties = { "management.endpoints.web.exposure.include:*",
|
||||
"server.servlet.context-path:/context-path",
|
||||
"spring.sleuth.http.legacy.enabled:true" })
|
||||
public class SkipEndPointsIntegrationTestsWithContextPathWithBasePath {
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -40,11 +40,13 @@ import org.springframework.web.client.RestTemplate;
|
||||
import static org.assertj.core.api.BDDAssertions.then;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = SkipEndPointsIntegrationTestsWithContextPathWithoutBasePath.Config.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, properties = {
|
||||
"management.endpoints.web.exposure.include:*",
|
||||
"server.servlet.context-path:/context-path",
|
||||
"spring.sleuth.http.legacy.enabled:true",
|
||||
"management.endpoints.web.base-path:/" })
|
||||
@SpringBootTest(
|
||||
classes = SkipEndPointsIntegrationTestsWithContextPathWithoutBasePath.Config.class,
|
||||
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
|
||||
properties = { "management.endpoints.web.exposure.include:*",
|
||||
"server.servlet.context-path:/context-path",
|
||||
"spring.sleuth.http.legacy.enabled:true",
|
||||
"management.endpoints.web.base-path:/" })
|
||||
public class SkipEndPointsIntegrationTestsWithContextPathWithoutBasePath {
|
||||
|
||||
@LocalServerPort
|
||||
|
||||
@@ -40,9 +40,11 @@ import org.springframework.web.client.RestTemplate;
|
||||
import static org.assertj.core.api.BDDAssertions.then;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = SkipEndPointsIntegrationTestsWithoutContextPathWithBasePath.Config.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, properties = {
|
||||
"management.endpoints.web.exposure.include:*",
|
||||
"spring.sleuth.http.legacy.enabled:true" })
|
||||
@SpringBootTest(
|
||||
classes = SkipEndPointsIntegrationTestsWithoutContextPathWithBasePath.Config.class,
|
||||
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
|
||||
properties = { "management.endpoints.web.exposure.include:*",
|
||||
"spring.sleuth.http.legacy.enabled:true" })
|
||||
public class SkipEndPointsIntegrationTestsWithoutContextPathWithBasePath {
|
||||
|
||||
@LocalServerPort
|
||||
|
||||
@@ -40,10 +40,12 @@ import org.springframework.web.client.RestTemplate;
|
||||
import static org.assertj.core.api.BDDAssertions.then;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = SkipEndPointsIntegrationTestsWithoutContextPathWithoutBasePath.Config.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, properties = {
|
||||
"management.endpoints.web.exposure.include:*",
|
||||
"spring.sleuth.http.legacy.enabled:true",
|
||||
"management.endpoints.web.base-path:/" })
|
||||
@SpringBootTest(
|
||||
classes = SkipEndPointsIntegrationTestsWithoutContextPathWithoutBasePath.Config.class,
|
||||
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
|
||||
properties = { "management.endpoints.web.exposure.include:*",
|
||||
"spring.sleuth.http.legacy.enabled:true",
|
||||
"management.endpoints.web.base-path:/" })
|
||||
public class SkipEndPointsIntegrationTestsWithoutContextPathWithoutBasePath {
|
||||
|
||||
@LocalServerPort
|
||||
|
||||
@@ -101,7 +101,7 @@ public class SkipPatternProviderConfigTest {
|
||||
.withPropertyValues("management.server.servlet.context-path=foo")
|
||||
.run(context -> {
|
||||
then(extractAllPatterns(context)).containsExactlyInAnyOrder(
|
||||
"/actuator/(health|health/.*|info|info/.*)", "foo.*",
|
||||
"/actuator(/|/(health|health/.*|info|info/.*))?", "foo.*",
|
||||
SleuthWebProperties.DEFAULT_SKIP_PATTERN);
|
||||
});
|
||||
}
|
||||
@@ -123,7 +123,7 @@ public class SkipPatternProviderConfigTest {
|
||||
.withConfiguration(UserConfigurations.of(ServerPropertiesConfig.class))
|
||||
.run(context -> {
|
||||
then(extractAllPatterns(context)).containsExactlyInAnyOrder(
|
||||
"/actuator/(health|health/.*|info|info/.*)",
|
||||
"/actuator(/|/(health|health/.*|info|info/.*))?",
|
||||
SleuthWebProperties.DEFAULT_SKIP_PATTERN);
|
||||
});
|
||||
}
|
||||
@@ -134,7 +134,7 @@ public class SkipPatternProviderConfigTest {
|
||||
.withConfiguration(UserConfigurations.of(ServerPropertiesConfig.class))
|
||||
.withPropertyValues("server.servlet.context-path=foo").run(context -> {
|
||||
then(extractAllPatterns(context)).containsExactlyInAnyOrder(
|
||||
"foo/actuator/(health|health/.*|info|info/.*)",
|
||||
"foo/actuator(/|/(health|health/.*|info|info/.*))?",
|
||||
SleuthWebProperties.DEFAULT_SKIP_PATTERN);
|
||||
});
|
||||
}
|
||||
@@ -159,7 +159,7 @@ public class SkipPatternProviderConfigTest {
|
||||
"server.servlet.context-path=foo")
|
||||
.run(context -> {
|
||||
then(extractAllPatterns(context)).containsExactlyInAnyOrder(
|
||||
"foo/(health|health/.*|info|info/.*)",
|
||||
"foo(/|/(health|health/.*|info|info/.*))?",
|
||||
SleuthWebProperties.DEFAULT_SKIP_PATTERN);
|
||||
});
|
||||
}
|
||||
@@ -185,7 +185,7 @@ public class SkipPatternProviderConfigTest {
|
||||
"server.servlet.context-path=foo")
|
||||
.run(context -> {
|
||||
then(extractAllPatterns(context)).containsExactlyInAnyOrder(
|
||||
"foo/mgt/(health|health/.*|info|info/.*)",
|
||||
"foo/mgt(/|/(health|health/.*|info|info/.*))?",
|
||||
SleuthWebProperties.DEFAULT_SKIP_PATTERN);
|
||||
});
|
||||
}
|
||||
@@ -198,7 +198,7 @@ public class SkipPatternProviderConfigTest {
|
||||
"server.servlet.context-path=foo")
|
||||
.run(context -> {
|
||||
then(extractAllPatterns(context)).containsExactlyInAnyOrder(
|
||||
"/actuator/(health|health/.*|info|info/.*)",
|
||||
"/actuator(/|/(health|health/.*|info|info/.*))?",
|
||||
SleuthWebProperties.DEFAULT_SKIP_PATTERN);
|
||||
});
|
||||
}
|
||||
@@ -211,7 +211,7 @@ public class SkipPatternProviderConfigTest {
|
||||
"management.server.port=0", "server.servlet.context-path=foo")
|
||||
.run(context -> {
|
||||
then(extractAllPatterns(context)).containsExactlyInAnyOrder(
|
||||
"/mgt/(health|health/.*|info|info/.*)",
|
||||
"/mgt(/|/(health|health/.*|info|info/.*))?",
|
||||
SleuthWebProperties.DEFAULT_SKIP_PATTERN);
|
||||
});
|
||||
}
|
||||
@@ -224,7 +224,7 @@ public class SkipPatternProviderConfigTest {
|
||||
"server.servlet.context-path=foo")
|
||||
.run(context -> {
|
||||
then(extractAllPatterns(context)).containsExactlyInAnyOrder(
|
||||
"/actuator/(health|health/.*|info|info/.*)",
|
||||
"/actuator(/|/(health|health/.*|info|info/.*))?",
|
||||
SleuthWebProperties.DEFAULT_SKIP_PATTERN);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -44,8 +44,9 @@ import static java.util.concurrent.TimeUnit.SECONDS;
|
||||
import static org.assertj.core.api.BDDAssertions.then;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = {
|
||||
TraceAsyncIntegrationTests.TraceAsyncITestConfiguration.class }, properties = "spring.sleuth.http.legacy.enabled=true")
|
||||
@SpringBootTest(
|
||||
classes = { TraceAsyncIntegrationTests.TraceAsyncITestConfiguration.class },
|
||||
properties = "spring.sleuth.http.legacy.enabled=true")
|
||||
public class TraceAsyncIntegrationTests {
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -55,7 +55,8 @@ import static org.assertj.core.api.BDDAssertions.then;
|
||||
import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT;
|
||||
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SpringBootTest(classes = TraceCustomFilterResponseInjectorTests.Config.class, webEnvironment = RANDOM_PORT)
|
||||
@SpringBootTest(classes = TraceCustomFilterResponseInjectorTests.Config.class,
|
||||
webEnvironment = RANDOM_PORT)
|
||||
@DirtiesContext
|
||||
public class TraceCustomFilterResponseInjectorTests {
|
||||
|
||||
|
||||
@@ -69,7 +69,8 @@ import static org.springframework.test.web.servlet.request.MockMvcRequestBuilder
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = TraceFilterIntegrationTests.Config.class, properties = "spring.sleuth.http.legacy.enabled=true")
|
||||
@SpringBootTest(classes = TraceFilterIntegrationTests.Config.class,
|
||||
properties = "spring.sleuth.http.legacy.enabled=true")
|
||||
public class TraceFilterIntegrationTests extends AbstractMvcIntegrationTest {
|
||||
|
||||
static final String TRACE_ID_NAME = "X-B3-TraceId";
|
||||
|
||||
@@ -55,8 +55,9 @@ import static org.assertj.core.api.BDDAssertions.then;
|
||||
* @author Marcin Grzejszczak
|
||||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = {
|
||||
TraceFilterWebIntegrationMultipleFiltersTests.Config.class }, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, properties = "spring.sleuth.http.legacy.enabled=true")
|
||||
@SpringBootTest(classes = { TraceFilterWebIntegrationMultipleFiltersTests.Config.class },
|
||||
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
|
||||
properties = "spring.sleuth.http.legacy.enabled=true")
|
||||
public class TraceFilterWebIntegrationMultipleFiltersTests {
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -59,7 +59,9 @@ import static org.assertj.core.api.BDDAssertions.then;
|
||||
* @author Marcin Grzejszczak
|
||||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = TraceFilterWebIntegrationTests.Config.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, properties = "spring.sleuth.http.legacy.enabled=true")
|
||||
@SpringBootTest(classes = TraceFilterWebIntegrationTests.Config.class,
|
||||
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
|
||||
properties = "spring.sleuth.http.legacy.enabled=true")
|
||||
public class TraceFilterWebIntegrationTests {
|
||||
|
||||
@Rule
|
||||
|
||||
@@ -66,9 +66,11 @@ import static org.assertj.core.api.BDDAssertions.then;
|
||||
* @author Marcin Grzejszczak
|
||||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = { MultipleAsyncRestTemplateTests.Config.class,
|
||||
MultipleAsyncRestTemplateTests.CustomExecutorConfig.class,
|
||||
MultipleAsyncRestTemplateTests.ControllerConfig.class }, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
||||
@SpringBootTest(
|
||||
classes = { MultipleAsyncRestTemplateTests.Config.class,
|
||||
MultipleAsyncRestTemplateTests.CustomExecutorConfig.class,
|
||||
MultipleAsyncRestTemplateTests.ControllerConfig.class },
|
||||
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
||||
@DirtiesContext
|
||||
public class MultipleAsyncRestTemplateTests {
|
||||
|
||||
|
||||
@@ -62,7 +62,9 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
||||
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SpringBootTest(classes = RestTemplateTraceAspectIntegrationTests.Config.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, properties = "spring.sleuth.web.client.skipPattern=/issue.*")
|
||||
@SpringBootTest(classes = RestTemplateTraceAspectIntegrationTests.Config.class,
|
||||
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
|
||||
properties = "spring.sleuth.web.client.skipPattern=/issue.*")
|
||||
@DirtiesContext
|
||||
public class RestTemplateTraceAspectIntegrationTests {
|
||||
|
||||
@@ -229,42 +231,49 @@ public class RestTemplateTraceAspectIntegrationTests {
|
||||
this.traceId = null;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/issue1047_end", method = RequestMethod.GET, produces = MediaType.TEXT_PLAIN_VALUE)
|
||||
@RequestMapping(value = "/issue1047_end", method = RequestMethod.GET,
|
||||
produces = MediaType.TEXT_PLAIN_VALUE)
|
||||
public String issue1047() {
|
||||
return "should_filter_out_this_endpoint";
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/issue1047_start", method = RequestMethod.GET, produces = MediaType.TEXT_PLAIN_VALUE)
|
||||
@RequestMapping(value = "/issue1047_start", method = RequestMethod.GET,
|
||||
produces = MediaType.TEXT_PLAIN_VALUE)
|
||||
public String issue1047Start() {
|
||||
return callAndReturnIssue1047();
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/", method = RequestMethod.GET, produces = MediaType.TEXT_PLAIN_VALUE)
|
||||
@RequestMapping(value = "/", method = RequestMethod.GET,
|
||||
produces = MediaType.TEXT_PLAIN_VALUE)
|
||||
public String home(
|
||||
@RequestHeader(value = "X-B3-SpanId", required = false) String traceId) {
|
||||
this.traceId = traceId == null ? "UNKNOWN" : traceId;
|
||||
return "trace=" + this.getTraceId();
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/customTag", method = RequestMethod.GET, produces = MediaType.TEXT_PLAIN_VALUE)
|
||||
@RequestMapping(value = "/customTag", method = RequestMethod.GET,
|
||||
produces = MediaType.TEXT_PLAIN_VALUE)
|
||||
public String customTag(
|
||||
@RequestHeader(value = "X-B3-TraceId", required = false) String traceId) {
|
||||
this.traceId = traceId == null ? "UNKNOWN" : traceId;
|
||||
return "trace=" + this.getTraceId();
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/asyncRestTemplate", method = RequestMethod.GET, produces = MediaType.TEXT_PLAIN_VALUE)
|
||||
@RequestMapping(value = "/asyncRestTemplate", method = RequestMethod.GET,
|
||||
produces = MediaType.TEXT_PLAIN_VALUE)
|
||||
public String asyncRestTemplate()
|
||||
throws ExecutionException, InterruptedException {
|
||||
return callViaAsyncRestTemplateAndReturnOk();
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/syncPing", method = RequestMethod.GET, produces = MediaType.TEXT_PLAIN_VALUE)
|
||||
@RequestMapping(value = "/syncPing", method = RequestMethod.GET,
|
||||
produces = MediaType.TEXT_PLAIN_VALUE)
|
||||
public String syncPing() {
|
||||
return callAndReturnOk();
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/callablePing", method = RequestMethod.GET, produces = MediaType.TEXT_PLAIN_VALUE)
|
||||
@RequestMapping(value = "/callablePing", method = RequestMethod.GET,
|
||||
produces = MediaType.TEXT_PLAIN_VALUE)
|
||||
public Callable<String> asyncPing() {
|
||||
return new Callable<String>() {
|
||||
@Override
|
||||
@@ -274,7 +283,8 @@ public class RestTemplateTraceAspectIntegrationTests {
|
||||
};
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/webAsyncTaskPing", method = RequestMethod.GET, produces = MediaType.TEXT_PLAIN_VALUE)
|
||||
@RequestMapping(value = "/webAsyncTaskPing", method = RequestMethod.GET,
|
||||
produces = MediaType.TEXT_PLAIN_VALUE)
|
||||
public WebAsyncTask<String> webAsyncTaskPing() {
|
||||
return new WebAsyncTask<>(new Callable<String>() {
|
||||
@Override
|
||||
|
||||
@@ -52,8 +52,9 @@ import static org.springframework.boot.test.context.SpringBootTest.WebEnvironmen
|
||||
* @author Marcin Grzejszczak
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SpringBootTest(classes = {
|
||||
TraceWebAsyncClientAutoConfigurationTests.TestConfiguration.class }, webEnvironment = RANDOM_PORT)
|
||||
@SpringBootTest(
|
||||
classes = { TraceWebAsyncClientAutoConfigurationTests.TestConfiguration.class },
|
||||
webEnvironment = RANDOM_PORT)
|
||||
public class TraceWebAsyncClientAutoConfigurationTests {
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -54,8 +54,8 @@ import static org.assertj.core.api.BDDAssertions.then;
|
||||
import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT;
|
||||
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SpringBootTest(classes = {
|
||||
WebClientDiscoveryExceptionTests.TestConfiguration.class }, webEnvironment = RANDOM_PORT)
|
||||
@SpringBootTest(classes = { WebClientDiscoveryExceptionTests.TestConfiguration.class },
|
||||
webEnvironment = RANDOM_PORT)
|
||||
@TestPropertySource(properties = { "spring.application.name=exceptionservice",
|
||||
"spring.sleuth.http.legacy.enabled=true" })
|
||||
@DirtiesContext
|
||||
|
||||
@@ -60,10 +60,10 @@ import static org.assertj.core.api.Assertions.fail;
|
||||
import static org.assertj.core.api.BDDAssertions.then;
|
||||
|
||||
@RunWith(JUnitParamsRunner.class)
|
||||
@SpringBootTest(classes = {
|
||||
WebClientExceptionTests.TestConfiguration.class }, properties = {
|
||||
"ribbon.ConnectTimeout=30000",
|
||||
"spring.application.name=exceptionservice" }, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
||||
@SpringBootTest(classes = { WebClientExceptionTests.TestConfiguration.class },
|
||||
properties = { "ribbon.ConnectTimeout=30000",
|
||||
"spring.application.name=exceptionservice" },
|
||||
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
||||
public class WebClientExceptionTests {
|
||||
|
||||
@ClassRule
|
||||
@@ -145,7 +145,8 @@ public class WebClientExceptionTests {
|
||||
@Configuration
|
||||
@EnableAutoConfiguration
|
||||
@EnableFeignClients
|
||||
@RibbonClient(value = "exceptionservice", configuration = ExceptionServiceRibbonClientConfiguration.class)
|
||||
@RibbonClient(value = "exceptionservice",
|
||||
configuration = ExceptionServiceRibbonClientConfiguration.class)
|
||||
public static class TestConfiguration {
|
||||
|
||||
@LoadBalanced
|
||||
|
||||
@@ -50,7 +50,8 @@ import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExcep
|
||||
import static org.assertj.core.api.BDDAssertions.then;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = TestConfig.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
||||
@SpringBootTest(classes = TestConfig.class,
|
||||
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
||||
public class Issue585Tests {
|
||||
|
||||
TestRestTemplate testRestTemplate = new TestRestTemplate();
|
||||
|
||||
@@ -62,7 +62,8 @@ interface MyFeignClient {
|
||||
* @author Marcin Grzejszczak
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SpringBootTest(classes = Application.class, webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
|
||||
@SpringBootTest(classes = Application.class,
|
||||
webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
|
||||
@TestPropertySource(properties = { "ribbon.eureka.enabled=false",
|
||||
"feign.hystrix.enabled=false", "server.port=9988" })
|
||||
public class Issue350Tests {
|
||||
|
||||
@@ -60,7 +60,8 @@ import org.springframework.web.client.RestTemplate;
|
||||
import static org.assertj.core.api.Assertions.fail;
|
||||
import static org.assertj.core.api.BDDAssertions.then;
|
||||
|
||||
@FeignClient(value = "myFeignClient", url = "http://localhost:9998", configuration = CustomConfig.class)
|
||||
@FeignClient(value = "myFeignClient", url = "http://localhost:9998",
|
||||
configuration = CustomConfig.class)
|
||||
interface MyFeignClient {
|
||||
|
||||
@RequestMapping("/service/ok")
|
||||
@@ -75,7 +76,8 @@ interface MyFeignClient {
|
||||
* @author Marcin Grzejszczak
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SpringBootTest(classes = Application.class, webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
|
||||
@SpringBootTest(classes = Application.class,
|
||||
webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
|
||||
@TestPropertySource(properties = { "ribbon.eureka.enabled=false",
|
||||
"feign.hystrix.enabled=false", "server.port=9998" })
|
||||
public class Issue362Tests {
|
||||
|
||||
@@ -61,7 +61,8 @@ interface MyNameRemote {
|
||||
* @author Marcin Grzejszczak
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SpringBootTest(classes = Application.class, webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
|
||||
@SpringBootTest(classes = Application.class,
|
||||
webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
|
||||
@TestPropertySource(properties = { "spring.application.name=demo-feign-uri",
|
||||
"server.port=9978", "eureka.client.enabled=true", "ribbon.eureka.enabled=true" })
|
||||
public class Issue393Tests {
|
||||
|
||||
@@ -58,8 +58,9 @@ interface MyNameRemote {
|
||||
* @author Marcin Grzejszczak
|
||||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = Application.class, webEnvironment = SpringBootTest.WebEnvironment.NONE, properties = {
|
||||
"feign.hystrix.enabled=false" })
|
||||
@SpringBootTest(classes = Application.class,
|
||||
webEnvironment = SpringBootTest.WebEnvironment.NONE,
|
||||
properties = { "feign.hystrix.enabled=false" })
|
||||
public class Issue502Tests {
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -100,7 +100,8 @@ import static org.assertj.core.api.Assertions.fail;
|
||||
import static org.assertj.core.api.BDDAssertions.then;
|
||||
|
||||
@RunWith(JUnitParamsRunner.class)
|
||||
@SpringBootTest(classes = WebClientTests.TestConfiguration.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
||||
@SpringBootTest(classes = WebClientTests.TestConfiguration.class,
|
||||
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
||||
@TestPropertySource(properties = { "spring.sleuth.http.legacy.enabled=true",
|
||||
"spring.application.name=fooservice", "feign.hystrix.enabled=false" })
|
||||
@DirtiesContext
|
||||
@@ -543,7 +544,8 @@ public class WebClientTests {
|
||||
GatewayClassPathWarningAutoConfiguration.class,
|
||||
GatewayAutoConfiguration.class })
|
||||
@EnableFeignClients
|
||||
@RibbonClient(value = "fooservice", configuration = SimpleRibbonClientConfiguration.class)
|
||||
@RibbonClient(value = "fooservice",
|
||||
configuration = SimpleRibbonClientConfiguration.class)
|
||||
public static class TestConfiguration {
|
||||
|
||||
@Bean
|
||||
|
||||
@@ -30,7 +30,8 @@ import org.springframework.web.client.RestTemplate;
|
||||
import static org.assertj.core.api.BDDAssertions.then;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = Issue469.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
||||
@SpringBootTest(classes = Issue469.class,
|
||||
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
||||
@TestPropertySource(properties = { "spring.mvc.view.prefix=/WEB-INF/jsp/",
|
||||
"spring.mvc.view.suffix=.jsp" })
|
||||
public class Issue469Tests {
|
||||
|
||||
@@ -69,8 +69,9 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.BDDAssertions.then;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = SampleZuulProxyApplication.class, properties = {
|
||||
"zuul.routes.simple: /simple/**" }, webEnvironment = WebEnvironment.RANDOM_PORT)
|
||||
@SpringBootTest(classes = SampleZuulProxyApplication.class,
|
||||
properties = { "zuul.routes.simple: /simple/**" },
|
||||
webEnvironment = WebEnvironment.RANDOM_PORT)
|
||||
@DirtiesContext
|
||||
public class TraceZuulIntegrationTests {
|
||||
|
||||
|
||||
@@ -43,9 +43,9 @@ import static org.assertj.core.api.BDDAssertions.then;
|
||||
import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = TestZuulApplication.class, webEnvironment = RANDOM_PORT, properties = {
|
||||
"feign.hystrix.enabled=false", "zuul.routes.dp.path:/display/**",
|
||||
"zuul.routes.dp.path.url: http://localhost:9987/unknown" })
|
||||
@SpringBootTest(classes = TestZuulApplication.class, webEnvironment = RANDOM_PORT,
|
||||
properties = { "feign.hystrix.enabled=false", "zuul.routes.dp.path:/display/**",
|
||||
"zuul.routes.dp.path.url: http://localhost:9987/unknown" })
|
||||
@DirtiesContext
|
||||
public class Issue634Tests {
|
||||
|
||||
|
||||
@@ -45,7 +45,8 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE, properties = {
|
||||
"spring.sleuth.baggage-keys=my-baggage",
|
||||
"spring.sleuth.propagation-keys=my-propagation,others-propagation",
|
||||
"spring.sleuth.propagation.tag.whitelisted-keys=my-baggage,my-propagation" }, classes = TagPropagationFinishedSpanHandlerTest.TestConfiguration.class)
|
||||
"spring.sleuth.propagation.tag.whitelisted-keys=my-baggage,my-propagation" },
|
||||
classes = TagPropagationFinishedSpanHandlerTest.TestConfiguration.class)
|
||||
public class TagPropagationFinishedSpanHandlerTest {
|
||||
|
||||
private static final String BAGGAGE_KEY = "my-baggage";
|
||||
|
||||
@@ -44,8 +44,10 @@ import static java.util.concurrent.TimeUnit.SECONDS;
|
||||
import static org.assertj.core.api.BDDAssertions.then;
|
||||
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SpringBootTest(classes = { IntegrationSpanCollectorConfig.class,
|
||||
SampleMessagingApplication.class }, webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
|
||||
@SpringBootTest(
|
||||
classes = { IntegrationSpanCollectorConfig.class,
|
||||
SampleMessagingApplication.class },
|
||||
webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
|
||||
@TestPropertySource(properties = { "sample.zipkin.enabled=true",
|
||||
"spring.sleuth.http.legacy.enabled=true" })
|
||||
@DirtiesContext
|
||||
|
||||
@@ -62,10 +62,11 @@ import org.springframework.web.client.RestTemplate;
|
||||
*/
|
||||
@Configuration
|
||||
@EnableConfigurationProperties(ZipkinProperties.class)
|
||||
@ConditionalOnProperty(value = { "spring.sleuth.enabled",
|
||||
"spring.zipkin.enabled" }, matchIfMissing = true)
|
||||
@ConditionalOnProperty(value = { "spring.sleuth.enabled", "spring.zipkin.enabled" },
|
||||
matchIfMissing = true)
|
||||
@AutoConfigureBefore(TraceAutoConfiguration.class)
|
||||
@AutoConfigureAfter(name = "org.springframework.cloud.autoconfigure.RefreshAutoConfiguration")
|
||||
@AutoConfigureAfter(
|
||||
name = "org.springframework.cloud.autoconfigure.RefreshAutoConfiguration")
|
||||
@Import({ ZipkinSenderConfigurationImportSelector.class, SamplerAutoConfiguration.class })
|
||||
public class ZipkinAutoConfiguration {
|
||||
|
||||
@@ -100,7 +101,8 @@ public class ZipkinAutoConfiguration {
|
||||
|
||||
@Configuration
|
||||
@ConditionalOnMissingBean(EndpointLocator.class)
|
||||
@ConditionalOnProperty(value = "spring.zipkin.locator.discovery.enabled", havingValue = "false", matchIfMissing = true)
|
||||
@ConditionalOnProperty(value = "spring.zipkin.locator.discovery.enabled",
|
||||
havingValue = "false", matchIfMissing = true)
|
||||
protected static class DefaultEndpointLocatorConfiguration {
|
||||
|
||||
@Autowired(required = false)
|
||||
@@ -126,7 +128,8 @@ public class ZipkinAutoConfiguration {
|
||||
@Configuration
|
||||
@ConditionalOnClass(Registration.class)
|
||||
@ConditionalOnMissingBean(EndpointLocator.class)
|
||||
@ConditionalOnProperty(value = "spring.zipkin.locator.discovery.enabled", havingValue = "true")
|
||||
@ConditionalOnProperty(value = "spring.zipkin.locator.discovery.enabled",
|
||||
havingValue = "true")
|
||||
protected static class RegistrationEndpointLocatorConfiguration {
|
||||
|
||||
@Autowired(required = false)
|
||||
|
||||
@@ -58,8 +58,8 @@ import org.springframework.util.Assert;
|
||||
* @deprecated left for backward compatibility
|
||||
*/
|
||||
@Configuration
|
||||
@ConditionalOnProperty(value = { "spring.sleuth.enabled",
|
||||
"spring.zipkin.enabled" }, matchIfMissing = true)
|
||||
@ConditionalOnProperty(value = { "spring.sleuth.enabled", "spring.zipkin.enabled" },
|
||||
matchIfMissing = true)
|
||||
@AutoConfigureBefore(ZipkinAutoConfiguration.class)
|
||||
@Deprecated
|
||||
public class ZipkinBackwardsCompatibilityAutoConfiguration {
|
||||
|
||||
@@ -91,7 +91,8 @@ class ZipkinRestTemplateSenderConfiguration {
|
||||
static class DiscoveryClientZipkinUrlExtractorConfiguration {
|
||||
|
||||
@Configuration
|
||||
@ConditionalOnProperty(value = "spring.zipkin.discoveryClientEnabled", havingValue = "true", matchIfMissing = true)
|
||||
@ConditionalOnProperty(value = "spring.zipkin.discoveryClientEnabled",
|
||||
havingValue = "true", matchIfMissing = true)
|
||||
static class ZipkinClientLoadBalancedConfiguration {
|
||||
|
||||
@Autowired(required = false)
|
||||
@@ -108,7 +109,8 @@ class ZipkinRestTemplateSenderConfiguration {
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@ConditionalOnProperty(value = "spring.zipkin.discoveryClientEnabled", havingValue = "false")
|
||||
@ConditionalOnProperty(value = "spring.zipkin.discoveryClientEnabled",
|
||||
havingValue = "false")
|
||||
static class ZipkinClientNoOpConfiguration {
|
||||
|
||||
@Bean
|
||||
|
||||
Reference in New Issue
Block a user