Misc fixes.

This commit is contained in:
Tyler Benson 2019-05-29 13:54:11 -07:00
parent 71101ac8d0
commit fc9f1d120c
8 changed files with 14 additions and 14 deletions

View File

@ -11,7 +11,6 @@ import io.opentracing.tag.Tags
import spock.lang.Shared
class AkkaHttpClientInstrumentationTest extends HttpClientTest<AkkaHttpClientDecorator> {
private static final long TIMEOUT = 10000L
@Shared
ActorSystem system = ActorSystem.create()

View File

@ -14,7 +14,6 @@ import scala.util.Try
import spock.lang.Shared
class AkkaHttpClientPoolInstrumentationTest extends HttpClientTest<AkkaHttpClientDecorator> {
private static final long TIMEOUT = 10000L
@Shared
ActorSystem system = ActorSystem.create()

View File

@ -32,6 +32,8 @@ dependencies {
implementation deps.autoservice
testCompile project(':dd-java-agent:testing')
testCompile project(':dd-java-agent:instrumentation:java-concurrent')
testCompile group: 'org.apache.httpcomponents', name: 'httpasyncclient', version: '4.0'
latestDepTestCompile group: 'org.apache.httpcomponents', name: 'httpasyncclient', version: '+'

View File

@ -2,15 +2,15 @@ import org.apache.http.client.methods.HttpRequestBase
class HttpUriRequest extends HttpRequestBase {
private final String methodName;
private final String methodName
HttpUriRequest(final String methodName, final URI uri) {
this.methodName = methodName;
setURI(uri);
this.methodName = methodName
setURI(uri)
}
@Override
String getMethod() {
return methodName;
return methodName
}
}

View File

@ -2,15 +2,15 @@ import org.apache.http.client.methods.HttpRequestBase
class HttpUriRequest extends HttpRequestBase {
private final String methodName;
private final String methodName
HttpUriRequest(final String methodName, final URI uri) {
this.methodName = methodName;
setURI(uri);
this.methodName = methodName
setURI(uri)
}
@Override
String getMethod() {
return methodName;
return methodName
}
}

View File

@ -16,7 +16,7 @@ class SpringRestTemplateTest extends HttpClientTest<HttpUrlConnectionDecorator>
int doRequest(String method, URI uri, Map<String, String> headers, Closure callback) {
def httpHeaders = new HttpHeaders()
headers.each { httpHeaders.put(it.key, [it.value]) }
def request = new HttpEntity<String>(httpHeaders);
def request = new HttpEntity<String>(httpHeaders)
ResponseEntity<String> response = restTemplate.exchange(uri, HttpMethod.resolve(method), request, String)
callback?.call()
return response.statusCode.value()

View File

@ -60,7 +60,7 @@ class TraceUtils {
}
@SneakyThrows
static <T extends Object> Object withConfigOverride(final String name, final String value, final Callable<T> r) {
synchronized static <T extends Object> Object withConfigOverride(final String name, final String value, final Callable<T> r) {
def existingConfig = Config.get() // We can't reference INSTANCE directly or the reflection below will fail.
Properties properties = new Properties()
properties.put(name, value)

View File

@ -100,8 +100,8 @@ public class Config {
parseIntegerRangeSet("500-599", "default");
private static final Set<Integer> DEFAULT_HTTP_CLIENT_ERROR_STATUSES =
parseIntegerRangeSet("400-499", "default");
private static final boolean DEFAULT_HTTP_SERVER_TAG_QUERY_STRING = true;
private static final boolean DEFAULT_HTTP_CLIENT_TAG_QUERY_STRING = true;
private static final boolean DEFAULT_HTTP_SERVER_TAG_QUERY_STRING = false;
private static final boolean DEFAULT_HTTP_CLIENT_TAG_QUERY_STRING = false;
private static final boolean DEFAULT_HTTP_CLIENT_SPLIT_BY_DOMAIN = false;
private static final int DEFAULT_PARTIAL_FLUSH_MIN_SPANS = 1000;
private static final String DEFAULT_PROPAGATION_STYLE_EXTRACT = PropagationStyle.DATADOG.name();