From a2cd7fcd483927554988199086f252f31d80ce03 Mon Sep 17 00:00:00 2001 From: Mateusz Rzeszutek Date: Mon, 30 Oct 2023 11:32:28 +0100 Subject: [PATCH] fix testS --- ...rverAttributesExtractorStableSemconvTest.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/instrumentation-api-semconv/src/testStableHttpSemconv/java/io/opentelemetry/instrumentation/api/instrumenter/http/HttpServerAttributesExtractorStableSemconvTest.java b/instrumentation-api-semconv/src/testStableHttpSemconv/java/io/opentelemetry/instrumentation/api/instrumenter/http/HttpServerAttributesExtractorStableSemconvTest.java index 916f38b9be3a..4cba765d7157 100644 --- a/instrumentation-api-semconv/src/testStableHttpSemconv/java/io/opentelemetry/instrumentation/api/instrumenter/http/HttpServerAttributesExtractorStableSemconvTest.java +++ b/instrumentation-api-semconv/src/testStableHttpSemconv/java/io/opentelemetry/instrumentation/api/instrumenter/http/HttpServerAttributesExtractorStableSemconvTest.java @@ -454,10 +454,10 @@ void shouldExtractServerAddressAndPortFromForwardedHostHeader() { } @Test - void shouldExtractServerAddressAndPortFromHostHeader() { + void shouldExtractServerAddressAndPortFromAuthorityPseudoHeader() { Map request = new HashMap<>(); - request.put("header.host", "github.com:123"); request.put("header.:authority", "opentelemetry.io:42"); + request.put("header.host", "github.com:123"); Map response = new HashMap<>(); response.put("statusCode", "200"); @@ -470,8 +470,8 @@ void shouldExtractServerAddressAndPortFromHostHeader() { assertThat(startAttributes.build()) .containsOnly( - entry(SemanticAttributes.SERVER_ADDRESS, "github.com"), - entry(SemanticAttributes.SERVER_PORT, 123L)); + entry(SemanticAttributes.SERVER_ADDRESS, "opentelemetry.io"), + entry(SemanticAttributes.SERVER_PORT, 42L)); AttributesBuilder endAttributes = Attributes.builder(); extractor.onEnd(endAttributes, Context.root(), request, response, null); @@ -480,9 +480,9 @@ void shouldExtractServerAddressAndPortFromHostHeader() { } @Test - void shouldExtractServerAddressAndPortFromAuthorityPseudoHeader() { + void shouldExtractServerAddressAndPortFromHostHeader() { Map request = new HashMap<>(); - request.put("header.:authority", "opentelemetry.io:42"); + request.put("header.host", "github.com:123"); Map response = new HashMap<>(); response.put("statusCode", "200"); @@ -495,8 +495,8 @@ void shouldExtractServerAddressAndPortFromAuthorityPseudoHeader() { assertThat(startAttributes.build()) .containsOnly( - entry(SemanticAttributes.SERVER_ADDRESS, "opentelemetry.io"), - entry(SemanticAttributes.SERVER_PORT, 42L)); + entry(SemanticAttributes.SERVER_ADDRESS, "github.com"), + entry(SemanticAttributes.SERVER_PORT, 123L)); AttributesBuilder endAttributes = Attributes.builder(); extractor.onEnd(endAttributes, Context.root(), request, response, null);