Skip to content

Commit

Permalink
fix testS
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateusz Rzeszutek committed Oct 30, 2023
1 parent f90cda3 commit a2cd7fc
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -454,10 +454,10 @@ void shouldExtractServerAddressAndPortFromForwardedHostHeader() {
}

@Test
void shouldExtractServerAddressAndPortFromHostHeader() {
void shouldExtractServerAddressAndPortFromAuthorityPseudoHeader() {
Map<String, String> 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<String, String> response = new HashMap<>();
response.put("statusCode", "200");
Expand All @@ -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);
Expand All @@ -480,9 +480,9 @@ void shouldExtractServerAddressAndPortFromHostHeader() {
}

@Test
void shouldExtractServerAddressAndPortFromAuthorityPseudoHeader() {
void shouldExtractServerAddressAndPortFromHostHeader() {
Map<String, String> request = new HashMap<>();
request.put("header.:authority", "opentelemetry.io:42");
request.put("header.host", "github.com:123");

Map<String, String> response = new HashMap<>();
response.put("statusCode", "200");
Expand All @@ -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);
Expand Down

0 comments on commit a2cd7fc

Please sign in to comment.