|
@@ -30,6 +30,10 @@ import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.NetTr
|
|
|
|
|
|
abstract class JaxRsClientTest extends HttpClientTest<Invocation.Builder> implements AgentTestTrait {
|
|
abstract class JaxRsClientTest extends HttpClientTest<Invocation.Builder> implements AgentTestTrait {
|
|
|
|
|
|
|
|
+ boolean testRedirects() {
|
|
|
|
+ false
|
|
|
|
+ }
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
Invocation.Builder buildRequest(String method, URI uri, Map<String, String> headers) {
|
|
Invocation.Builder buildRequest(String method, URI uri, Map<String, String> headers) {
|
|
return internalBuildRequest(uri, headers)
|
|
return internalBuildRequest(uri, headers)
|
|
@@ -108,7 +112,7 @@ abstract class JaxRsClientTest extends HttpClientTest<Invocation.Builder> implem
|
|
"$SemanticAttributes.HTTP_METHOD" method
|
|
"$SemanticAttributes.HTTP_METHOD" method
|
|
"$SemanticAttributes.HTTP_STATUS_CODE" statusCode
|
|
"$SemanticAttributes.HTTP_STATUS_CODE" statusCode
|
|
"$SemanticAttributes.HTTP_FLAVOR" "1.1"
|
|
"$SemanticAttributes.HTTP_FLAVOR" "1.1"
|
|
- "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" Long
|
|
|
|
|
|
+ "$SemanticAttributes.HTTP_USER_AGENT" { it == null || String }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
serverSpan(it, 1, span(0))
|
|
serverSpan(it, 1, span(0))
|
|
@@ -131,11 +135,6 @@ class JerseyClientTest extends JaxRsClientTest {
|
|
return new JerseyClientBuilder().withConfig(config)
|
|
return new JerseyClientBuilder().withConfig(config)
|
|
}
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
|
- int maxRedirects() {
|
|
|
|
- 20
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
@Override
|
|
@Override
|
|
SingleConnection createSingleConnection(String host, int port) {
|
|
SingleConnection createSingleConnection(String host, int port) {
|
|
// Jersey JAX-RS client uses HttpURLConnection internally, which does not support pipelining nor
|
|
// Jersey JAX-RS client uses HttpURLConnection internally, which does not support pipelining nor
|
|
@@ -154,10 +153,6 @@ class ResteasyClientTest extends JaxRsClientTest {
|
|
.establishConnectionTimeout(CONNECT_TIMEOUT_MS, TimeUnit.MILLISECONDS)
|
|
.establishConnectionTimeout(CONNECT_TIMEOUT_MS, TimeUnit.MILLISECONDS)
|
|
}
|
|
}
|
|
|
|
|
|
- boolean testRedirects() {
|
|
|
|
- false
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
@Override
|
|
@Override
|
|
SingleConnection createSingleConnection(String host, int port) {
|
|
SingleConnection createSingleConnection(String host, int port) {
|
|
return new ResteasySingleConnection(host, port)
|
|
return new ResteasySingleConnection(host, port)
|
|
@@ -166,16 +161,24 @@ class ResteasyClientTest extends JaxRsClientTest {
|
|
|
|
|
|
class CxfClientTest extends JaxRsClientTest {
|
|
class CxfClientTest extends JaxRsClientTest {
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ Throwable clientSpanError(URI uri, Throwable exception) {
|
|
|
|
+ switch (uri.toString()) {
|
|
|
|
+ case "http://localhost:61/": // unopened port
|
|
|
|
+ case "https://192.0.2.1/": // non routable address
|
|
|
|
+ if (exception.getCause() != null) {
|
|
|
|
+ exception = exception.getCause()
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return exception
|
|
|
|
+ }
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
ClientBuilder builder() {
|
|
ClientBuilder builder() {
|
|
return new ClientBuilderImpl()
|
|
return new ClientBuilderImpl()
|
|
.property("http.connection.timeout", (long) CONNECT_TIMEOUT_MS)
|
|
.property("http.connection.timeout", (long) CONNECT_TIMEOUT_MS)
|
|
}
|
|
}
|
|
|
|
|
|
- boolean testRedirects() {
|
|
|
|
- false
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
@Override
|
|
@Override
|
|
SingleConnection createSingleConnection(String host, int port) {
|
|
SingleConnection createSingleConnection(String host, int port) {
|
|
// CXF JAX-RS client uses HttpURLConnection internally, which does not support pipelining nor
|
|
// CXF JAX-RS client uses HttpURLConnection internally, which does not support pipelining nor
|