Merge branch '2.1.x'
This commit is contained in:
5
pom.xml
5
pom.xml
@@ -256,6 +256,11 @@
|
||||
<spring-security-boot-autoconfigure.version>2.1.7.RELEASE
|
||||
</spring-security-boot-autoconfigure.version>
|
||||
<disable.nohttp.checks>false</disable.nohttp.checks>
|
||||
|
||||
<okhttp.version>3.10.0</okhttp.version>
|
||||
<mockwebserver.version>3.10.0</mockwebserver.version>
|
||||
<guava.version>20.0</guava.version>
|
||||
<javax.resource-api.version>1.7.1</javax.resource-api.version>
|
||||
</properties>
|
||||
|
||||
<profiles>
|
||||
|
||||
@@ -153,6 +153,11 @@
|
||||
<artifactId>feign-core</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.github.openfeign.form</groupId>
|
||||
<artifactId>feign-form-spring</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.netflix.zuul</groupId>
|
||||
<artifactId>zuul-core</artifactId>
|
||||
@@ -172,6 +177,7 @@
|
||||
<dependency>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>okhttp</artifactId>
|
||||
<version>${okhttp.version}</version>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@@ -307,7 +313,7 @@
|
||||
<dependency>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>mockwebserver</artifactId>
|
||||
<version>3.5.0</version>
|
||||
<version>${mockwebserver.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
||||
@@ -42,7 +42,7 @@ import org.springframework.lang.Nullable;
|
||||
* @since 2.0.0
|
||||
*/
|
||||
@Configuration
|
||||
@ConditionalOnBean(Tracing.class)
|
||||
@ConditionalOnBean(TraceWebAutoConfiguration.class)
|
||||
@ConditionalOnProperty(name = "spring.sleuth.http.enabled", havingValue = "true",
|
||||
matchIfMissing = true)
|
||||
@AutoConfigureAfter(TraceWebAutoConfiguration.class)
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Copyright 2013-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.cloud.sleuth.instrument.web;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
/**
|
||||
* @author Marcin Grzejszczak
|
||||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = { TraceWebClientDisabledTests.Config.class }, properties = {
|
||||
"spring.sleuth.web.enabled=true", "spring.sleuth.web.client.enabled=false" })
|
||||
public class TraceWebClientDisabledTests {
|
||||
|
||||
@Test
|
||||
public void should_load_context() {
|
||||
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@EnableAutoConfiguration
|
||||
public static class Config {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package org.springframework.cloud.sleuth.instrument.web.client.integration;
|
||||
|
||||
import java.time.Duration;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
@@ -53,7 +52,6 @@ import org.awaitility.Awaitility;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.ClassRule;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
@@ -394,32 +392,6 @@ public class WebClientTests {
|
||||
then(this.tracer.currentSpan()).isNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore("Flakey on CI")
|
||||
public void shouldReportTraceForCancelledRequestViaWebClient() {
|
||||
Span span = this.tracer.nextSpan().name("foo").start();
|
||||
|
||||
try (Tracer.SpanInScope ws = this.tracer.withSpanInScope(span)) {
|
||||
this.webClient.get().uri("http://localhost:" + this.port + "/noresponse")
|
||||
.retrieve().bodyToMono(String.class).timeout(Duration.ofMillis(0))
|
||||
.block();
|
||||
}
|
||||
catch (Exception e) {
|
||||
|
||||
}
|
||||
finally {
|
||||
span.finish();
|
||||
}
|
||||
|
||||
Awaitility.await().untilAsserted(() -> {
|
||||
System.out.println("Found spans " + this.reporter.getSpans());
|
||||
final Optional<zipkin2.Span> clientSpan = this.reporter.getSpans().stream()
|
||||
.filter(s -> s.kind() == zipkin2.Span.Kind.CLIENT).findFirst();
|
||||
then(clientSpan).isPresent();
|
||||
then(clientSpan.get().tags()).containsEntry("error", "CANCELLED");
|
||||
});
|
||||
}
|
||||
|
||||
Object[] parametersForShouldAttachTraceIdWhenCallingAnotherService() {
|
||||
return new Object[] {
|
||||
(ResponseEntityProvider) (tests) -> tests.testFeignInterface.headers(),
|
||||
|
||||
@@ -86,6 +86,11 @@
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.github.openfeign.form</groupId>
|
||||
<artifactId>feign-form-spring</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
|
||||
@@ -28,8 +28,8 @@ import org.springframework.test.context.junit4.SpringRunner;
|
||||
* @author Marcin Grzejszczak
|
||||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = { TraceWebDisabledTests.Config.class }, properties = {
|
||||
"spring.sleuth.web.enabled=true", "spring.sleuth.web.client.enabled=false" })
|
||||
@SpringBootTest(classes = { TraceWebDisabledTests.Config.class },
|
||||
properties = { "spring.sleuth.web.enabled=false" })
|
||||
public class TraceWebDisabledTests {
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user