|
5 | 5 |
|
6 | 6 | package io.opentelemetry.instrumentation.testing.junit.http; |
7 | 7 |
|
| 8 | +import static io.opentelemetry.api.common.AttributeKey.stringArrayKey; |
8 | 9 | import static io.opentelemetry.instrumentation.testing.junit.http.ServerEndpoint.CAPTURE_HEADERS; |
9 | 10 | import static io.opentelemetry.instrumentation.testing.junit.http.ServerEndpoint.CAPTURE_PARAMETERS; |
10 | 11 | import static io.opentelemetry.instrumentation.testing.junit.http.ServerEndpoint.ERROR; |
|
16 | 17 | import static io.opentelemetry.instrumentation.testing.junit.http.ServerEndpoint.SUCCESS; |
17 | 18 | import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.assertThat; |
18 | 19 | import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.equalTo; |
| 20 | +import static java.util.Collections.singletonList; |
19 | 21 | import static org.junit.jupiter.api.Assumptions.assumeFalse; |
20 | 22 | import static org.junit.jupiter.api.Assumptions.assumeTrue; |
21 | 23 |
|
@@ -899,14 +901,17 @@ protected SpanDataAssert assertServerSpan( |
899 | 901 |
|
900 | 902 | if (endpoint == CAPTURE_HEADERS) { |
901 | 903 | 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")); |
903 | 906 | 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")); |
905 | 909 | } |
906 | 910 | if (endpoint == CAPTURE_PARAMETERS) { |
907 | 911 | assertThat(attrs) |
908 | 912 | .containsEntry( |
909 | | - "servlet.request.parameter.test-parameter", new String[] {"test value õäöü"}); |
| 913 | + stringArrayKey("servlet.request.parameter.test-parameter"), |
| 914 | + singletonList("test value õäöü")); |
910 | 915 | } |
911 | 916 | }); |
912 | 917 |
|
|
0 commit comments