Skip to content

Commit 2482ddf

Browse files
committed
Fix
1 parent 4fa154c commit 2482ddf

File tree

3 files changed

+4
-20
lines changed

3 files changed

+4
-20
lines changed

instrumentation/play/play-mvc/play-mvc-2.6/javaagent/src/latestDepTest/java/io/opentelemetry/javaagent/instrumentation/play/v2_6/PlayAsyncServerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class PlayAsyncServerTest extends PlayServerTest {
2929
private static final ExecutorService executor = Executors.newCachedThreadPool();
3030

3131
@Override
32-
protected Server setupServer(int port) {
32+
protected Server setupServer() {
3333
ExecutionContextExecutor executionContextExecutor = HttpExecution.fromThread(executor);
3434
return Server.forRouter(
3535
Mode.TEST,

instrumentation/play/play-mvc/play-mvc-2.6/javaagent/src/latestDepTest/java/io/opentelemetry/javaagent/instrumentation/play/v2_6/PlayServerTest.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,6 @@ protected Server setupServer() {
9494
.build());
9595
}
9696

97-
protected abstract Server setupServer(int port);
98-
9997
@Override
10098
protected void stopServer(Server server) {
10199
server.stop();
@@ -112,7 +110,7 @@ protected void configure(HttpServerTestOptions options) {
112110
}
113111

114112
@Override
115-
public SpanDataAssert assertHandlerSpan(
113+
protected SpanDataAssert assertHandlerSpan(
116114
SpanDataAssert span, String method, ServerEndpoint endpoint) {
117115
span.hasName("play.request").hasKind(INTERNAL);
118116
if (endpoint == EXCEPTION) {

instrumentation/play/play-mvc/play-mvc-2.6/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/play/v2_6/PlayServerTest.java

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,15 @@
1313
import static io.opentelemetry.instrumentation.testing.junit.http.ServerEndpoint.QUERY_PARAM;
1414
import static io.opentelemetry.instrumentation.testing.junit.http.ServerEndpoint.REDIRECT;
1515
import static io.opentelemetry.instrumentation.testing.junit.http.ServerEndpoint.SUCCESS;
16+
import static java.util.Collections.emptySet;
1617

17-
import io.opentelemetry.api.common.AttributeKey;
1818
import io.opentelemetry.instrumentation.testing.junit.InstrumentationExtension;
1919
import io.opentelemetry.instrumentation.testing.junit.http.AbstractHttpServerTest;
2020
import io.opentelemetry.instrumentation.testing.junit.http.HttpServerInstrumentationExtension;
2121
import io.opentelemetry.instrumentation.testing.junit.http.HttpServerTestOptions;
2222
import io.opentelemetry.instrumentation.testing.junit.http.ServerEndpoint;
2323
import io.opentelemetry.sdk.testing.assertj.SpanDataAssert;
2424
import io.opentelemetry.sdk.trace.data.StatusData;
25-
import io.opentelemetry.semconv.HttpAttributes;
26-
import java.util.HashSet;
27-
import java.util.Set;
2825
import org.junit.jupiter.api.extension.RegisterExtension;
2926
import play.Mode;
3027
import play.mvc.Controller;
@@ -106,18 +103,7 @@ protected void stopServer(Server server) throws Exception {
106103
@Override
107104
protected void configure(HttpServerTestOptions options) {
108105
options.setHasHandlerSpan(unused -> true);
109-
options.setTestHttpPipelining(false);
110-
options.setResponseCodeOnNonStandardHttpMethod(404);
111-
// server spans are ended inside of the controller spans
112-
options.setVerifyServerSpanEndTime(false);
113-
options.setHttpAttributes(
114-
serverEndpoint -> {
115-
Set<AttributeKey<?>> attributes =
116-
new HashSet<>(HttpServerTestOptions.DEFAULT_HTTP_ATTRIBUTES);
117-
attributes.remove(HttpAttributes.HTTP_ROUTE);
118-
return attributes;
119-
});
120-
106+
options.setHttpAttributes(endpoint -> emptySet());
121107
options.setExpectedException(new IllegalArgumentException(EXCEPTION.getBody()));
122108
options.disableTestNonStandardHttpMethod();
123109
}

0 commit comments

Comments
 (0)