Skip to content

Commit 74499e3

Browse files
committed
address review comments
1 parent 7a91081 commit 74499e3

File tree

15 files changed

+61
-325
lines changed

15 files changed

+61
-325
lines changed

instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-common/testing/src/main/java/io/opentelemetry/instrumentation/jaxrs/v2_0/test/JaxRsInterfaceClassTestResourceSuper.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,11 @@
55

66
package io.opentelemetry.instrumentation.jaxrs.v2_0.test;
77

8+
import static io.opentelemetry.instrumentation.testing.junit.http.AbstractHttpServerTest.controller;
89
import static io.opentelemetry.instrumentation.testing.junit.http.ServerEndpoint.SUCCESS;
910

10-
import io.opentelemetry.instrumentation.testing.junit.http.AbstractHttpServerTest;
11-
1211
public class JaxRsInterfaceClassTestResourceSuper {
1312
public Object call() {
14-
return AbstractHttpServerTest.controller(SUCCESS, SUCCESS::getBody);
13+
return controller(SUCCESS, SUCCESS::getBody);
1514
}
1615
}

instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-common/testing/src/main/java/io/opentelemetry/instrumentation/jaxrs/v2_0/test/JaxRsSubResourceLocatorTestResource.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55

66
package io.opentelemetry.instrumentation.jaxrs.v2_0.test;
77

8+
import static io.opentelemetry.instrumentation.testing.junit.http.AbstractHttpServerTest.controller;
89
import static io.opentelemetry.instrumentation.testing.junit.http.ServerEndpoint.SUCCESS;
910

10-
import io.opentelemetry.instrumentation.testing.junit.http.AbstractHttpServerTest;
1111
import javax.ws.rs.Path;
1212

1313
@Path("test-sub-resource-locator")
1414
public class JaxRsSubResourceLocatorTestResource {
1515
@Path("call")
1616
public Object call() {
17-
return AbstractHttpServerTest.controller(SUCCESS, SubResource::new);
17+
return controller(SUCCESS, SubResource::new);
1818
}
1919
}

instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-common/testing/src/main/java/io/opentelemetry/instrumentation/jaxrs/v2_0/test/JaxRsSuperClassTestResourceSuper.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55

66
package io.opentelemetry.instrumentation.jaxrs.v2_0.test;
77

8+
import static io.opentelemetry.instrumentation.testing.junit.http.AbstractHttpServerTest.controller;
89
import static io.opentelemetry.instrumentation.testing.junit.http.ServerEndpoint.SUCCESS;
910

10-
import io.opentelemetry.instrumentation.testing.junit.http.AbstractHttpServerTest;
1111
import javax.ws.rs.GET;
1212

1313
public class JaxRsSuperClassTestResourceSuper {
1414
@GET
1515
public Object call() {
16-
return AbstractHttpServerTest.controller(SUCCESS, SUCCESS::getBody);
16+
return controller(SUCCESS, SUCCESS::getBody);
1717
}
1818
}

instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-common/testing/src/main/java/io/opentelemetry/instrumentation/jaxrs/v2_0/test/JaxRsTestResource.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
package io.opentelemetry.instrumentation.jaxrs.v2_0.test;
77

8+
import static io.opentelemetry.instrumentation.testing.junit.http.AbstractHttpServerTest.controller;
89
import static io.opentelemetry.instrumentation.testing.junit.http.ServerEndpoint.CAPTURE_HEADERS;
910
import static io.opentelemetry.instrumentation.testing.junit.http.ServerEndpoint.ERROR;
1011
import static io.opentelemetry.instrumentation.testing.junit.http.ServerEndpoint.EXCEPTION;
@@ -15,7 +16,6 @@
1516
import static io.opentelemetry.instrumentation.testing.junit.http.ServerEndpoint.SUCCESS;
1617
import static java.util.concurrent.TimeUnit.SECONDS;
1718

18-
import io.opentelemetry.instrumentation.testing.junit.http.AbstractHttpServerTest;
1919
import java.net.URI;
2020
import java.net.URISyntaxException;
2121
import java.util.concurrent.CompletableFuture;
@@ -39,19 +39,19 @@ public class JaxRsTestResource {
3939
@Path("/success")
4040
@GET
4141
public String success() {
42-
return AbstractHttpServerTest.controller(SUCCESS, SUCCESS::getBody);
42+
return controller(SUCCESS, SUCCESS::getBody);
4343
}
4444

4545
@Path("query")
4646
@GET
4747
public String query_param(@QueryParam("some") String param) {
48-
return AbstractHttpServerTest.controller(QUERY_PARAM, () -> "some=" + param);
48+
return controller(QUERY_PARAM, () -> "some=" + param);
4949
}
5050

5151
@Path("redirect")
5252
@GET
5353
public Response redirect(@Context UriInfo uriInfo) throws URISyntaxException {
54-
return AbstractHttpServerTest.controller(
54+
return controller(
5555
SUCCESS,
5656
() ->
5757
Response.status(Response.Status.FOUND)
@@ -62,14 +62,14 @@ public Response redirect(@Context UriInfo uriInfo) throws URISyntaxException {
6262
@Path("error-status")
6363
@GET
6464
public Response error() {
65-
return AbstractHttpServerTest.controller(
65+
return controller(
6666
SUCCESS, () -> Response.status(ERROR.getStatus()).entity(ERROR.getBody()).build());
6767
}
6868

6969
@Path("exception")
7070
@GET
7171
public Object exception() {
72-
return AbstractHttpServerTest.controller(
72+
return controller(
7373
SUCCESS,
7474
() -> {
7575
throw new IllegalStateException(EXCEPTION.getBody());
@@ -79,13 +79,13 @@ public Object exception() {
7979
@Path("path/{id}/param")
8080
@GET
8181
public String path_param(@PathParam("id") int id) {
82-
return AbstractHttpServerTest.controller(PATH_PARAM, () -> String.valueOf(id));
82+
return controller(PATH_PARAM, () -> String.valueOf(id));
8383
}
8484

8585
@GET
8686
@Path("captureHeaders")
8787
public Response capture_headers(@HeaderParam("X-Test-Request") String header) {
88-
return AbstractHttpServerTest.controller(
88+
return controller(
8989
CAPTURE_HEADERS,
9090
() ->
9191
Response.status(CAPTURE_HEADERS.getStatus())
@@ -101,7 +101,7 @@ public void indexed_child(@Context UriInfo uriInfo, @Suspended AsyncResponse res
101101

102102
CompletableFuture.runAsync(
103103
() ->
104-
AbstractHttpServerTest.controller(
104+
controller(
105105
INDEXED_CHILD,
106106
() -> {
107107
INDEXED_CHILD.collectSpanAttributes(parameters::getFirst);

instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-common/testing/src/main/java/io/opentelemetry/instrumentation/jaxrs/v2_0/test/SubResource.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55

66
package io.opentelemetry.instrumentation.jaxrs.v2_0.test;
77

8+
import static io.opentelemetry.instrumentation.testing.junit.http.AbstractHttpServerTest.controller;
89
import static io.opentelemetry.instrumentation.testing.junit.http.ServerEndpoint.SUCCESS;
910

10-
import io.opentelemetry.instrumentation.testing.junit.http.AbstractHttpServerTest;
1111
import javax.ws.rs.GET;
1212
import javax.ws.rs.Path;
1313

1414
public class SubResource {
1515
@Path("sub")
1616
@GET
1717
public String call() {
18-
return AbstractHttpServerTest.controller(SUCCESS, SUCCESS::getBody);
18+
return controller(SUCCESS, SUCCESS::getBody);
1919
}
2020
}

instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-cxf-3.2/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/jaxrs/v2_0/CxfFilterTest.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@
55

66
package io.opentelemetry.javaagent.instrumentation.jaxrs.v2_0;
77

8+
import static java.util.Arrays.asList;
9+
810
import io.opentelemetry.instrumentation.jaxrs.v2_0.JaxRsFilterTest;
911
import io.opentelemetry.instrumentation.jaxrs.v2_0.test.Resource;
1012
import io.opentelemetry.instrumentation.testing.junit.InstrumentationExtension;
1113
import io.opentelemetry.instrumentation.testing.junit.http.HttpServerInstrumentationExtension;
1214
import io.opentelemetry.testing.internal.armeria.common.AggregatedHttpResponse;
13-
import java.util.Arrays;
1415
import org.apache.cxf.endpoint.Server;
1516
import org.apache.cxf.jaxrs.JAXRSServerFactoryBean;
1617
import org.junit.jupiter.api.AfterAll;
@@ -34,9 +35,9 @@ void cleanUp() {
3435
@Override
3536
protected Server setupServer() {
3637
JAXRSServerFactoryBean serverFactory = new JAXRSServerFactoryBean();
37-
serverFactory.setProviders(Arrays.asList(simpleRequestFilter, prematchRequestFilter));
38+
serverFactory.setProviders(asList(simpleRequestFilter, prematchRequestFilter));
3839
serverFactory.setResourceClasses(
39-
Arrays.asList(Resource.Test1.class, Resource.Test2.class, Resource.Test3.class));
40+
asList(Resource.Test1.class, Resource.Test2.class, Resource.Test3.class));
4041
serverFactory.setAddress(buildAddress().toString());
4142

4243
Server server = serverFactory.create();

instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-resteasy-3.1/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/jaxrs/v2_0/ResteasyHttpServerTest.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,4 @@ protected void configure(HttpServerTestOptions options) {
4747
return expectedHttpRoute(endpoint, method);
4848
});
4949
}
50-
51-
// resteasy 3.0.x does not support JAX-RS 2.1
52-
@Override
53-
protected boolean shouldTestCompletableStageAsync() {
54-
return false;
55-
}
5650
}

instrumentation/jaxrs/jaxrs-3.0/jaxrs-3.0-common/testing/src/main/java/io/opentelemetry/instrumentation/jaxrs/v3_0/test/JaxRsInterfaceClassTestResourceSuper.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,11 @@
55

66
package io.opentelemetry.instrumentation.jaxrs.v3_0.test;
77

8+
import static io.opentelemetry.instrumentation.testing.junit.http.AbstractHttpServerTest.controller;
89
import static io.opentelemetry.instrumentation.testing.junit.http.ServerEndpoint.SUCCESS;
910

10-
import io.opentelemetry.instrumentation.testing.junit.http.AbstractHttpServerTest;
11-
1211
public class JaxRsInterfaceClassTestResourceSuper {
1312
public Object call() {
14-
return AbstractHttpServerTest.controller(SUCCESS, SUCCESS::getBody);
13+
return controller(SUCCESS, SUCCESS::getBody);
1514
}
1615
}

instrumentation/jaxrs/jaxrs-3.0/jaxrs-3.0-common/testing/src/main/java/io/opentelemetry/instrumentation/jaxrs/v3_0/test/JaxRsSubResourceLocatorTestResource.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55

66
package io.opentelemetry.instrumentation.jaxrs.v3_0.test;
77

8+
import static io.opentelemetry.instrumentation.testing.junit.http.AbstractHttpServerTest.controller;
89
import static io.opentelemetry.instrumentation.testing.junit.http.ServerEndpoint.SUCCESS;
910

10-
import io.opentelemetry.instrumentation.testing.junit.http.AbstractHttpServerTest;
1111
import jakarta.ws.rs.Path;
1212

1313
@Path("test-sub-resource-locator")
1414
public class JaxRsSubResourceLocatorTestResource {
1515
@Path("call")
1616
public Object call() {
17-
return AbstractHttpServerTest.controller(SUCCESS, SubResource::new);
17+
return controller(SUCCESS, SubResource::new);
1818
}
1919
}

instrumentation/jaxrs/jaxrs-3.0/jaxrs-3.0-common/testing/src/main/java/io/opentelemetry/instrumentation/jaxrs/v3_0/test/JaxRsSuperClassTestResourceSuper.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55

66
package io.opentelemetry.instrumentation.jaxrs.v3_0.test;
77

8+
import static io.opentelemetry.instrumentation.testing.junit.http.AbstractHttpServerTest.controller;
89
import static io.opentelemetry.instrumentation.testing.junit.http.ServerEndpoint.SUCCESS;
910

10-
import io.opentelemetry.instrumentation.testing.junit.http.AbstractHttpServerTest;
1111
import jakarta.ws.rs.GET;
1212

1313
public class JaxRsSuperClassTestResourceSuper {
1414
@GET
1515
public Object call() {
16-
return AbstractHttpServerTest.controller(SUCCESS, SUCCESS::getBody);
16+
return controller(SUCCESS, SUCCESS::getBody);
1717
}
1818
}

0 commit comments

Comments
 (0)