Skip to content

Commit 73cd147

Browse files
committed
fix warnings
1 parent 7a1715a commit 73cd147

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

instrumentation/restlet/restlet-2.0/testing/src/main/java/io/opentelemetry/instrumentation/restlet/v2_0/spring/AbstractSpringServerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public abstract class AbstractSpringServerTest extends AbstractRestletServerTest
2323
protected void setupServer(Component component) {
2424
ApplicationContext context = new ClassPathXmlApplicationContext(getConfigurationName());
2525
router = (Router) context.getBean("testRouter");
26-
Server server = (Server) context.getBean("testServer", new Object[] {"http", port});
26+
Server server = (Server) context.getBean("testServer", "http", port);
2727
component.getServers().add(server);
2828
}
2929

testing-common/src/main/java/io/opentelemetry/instrumentation/testing/junit/http/AbstractHttpServerTest.java

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

66
package io.opentelemetry.instrumentation.testing.junit.http;
77

8+
import static io.opentelemetry.api.common.AttributeKey.stringArrayKey;
89
import static io.opentelemetry.instrumentation.testing.junit.http.ServerEndpoint.CAPTURE_HEADERS;
910
import static io.opentelemetry.instrumentation.testing.junit.http.ServerEndpoint.CAPTURE_PARAMETERS;
1011
import static io.opentelemetry.instrumentation.testing.junit.http.ServerEndpoint.ERROR;
@@ -16,6 +17,7 @@
1617
import static io.opentelemetry.instrumentation.testing.junit.http.ServerEndpoint.SUCCESS;
1718
import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.assertThat;
1819
import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.equalTo;
20+
import static java.util.Collections.singletonList;
1921
import static org.junit.jupiter.api.Assumptions.assumeFalse;
2022
import static org.junit.jupiter.api.Assumptions.assumeTrue;
2123

@@ -899,14 +901,17 @@ protected SpanDataAssert assertServerSpan(
899901

900902
if (endpoint == CAPTURE_HEADERS) {
901903
assertThat(attrs)
902-
.containsEntry("http.request.header.x-test-request", new String[] {"test"});
904+
.containsEntry(
905+
stringArrayKey("http.request.header.x-test-request"), singletonList("test"));
903906
assertThat(attrs)
904-
.containsEntry("http.response.header.x-test-response", new String[] {"test"});
907+
.containsEntry(
908+
stringArrayKey("http.response.header.x-test-response"), singletonList("test"));
905909
}
906910
if (endpoint == CAPTURE_PARAMETERS) {
907911
assertThat(attrs)
908912
.containsEntry(
909-
"servlet.request.parameter.test-parameter", new String[] {"test value õäöü"});
913+
stringArrayKey("servlet.request.parameter.test-parameter"),
914+
singletonList("test value õäöü"));
910915
}
911916
});
912917

0 commit comments

Comments
 (0)