From c18a0e4647b971557124f130fdeea08155cf6f8d Mon Sep 17 00:00:00 2001 From: Florian Bernd Date: Thu, 21 Nov 2024 14:07:20 +0100 Subject: [PATCH] Fix tests --- .../ClientConcepts/OpenTelemetry/OpenTelemetryTests.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/Tests/ClientConcepts/OpenTelemetry/OpenTelemetryTests.cs b/tests/Tests/ClientConcepts/OpenTelemetry/OpenTelemetryTests.cs index 7af17774ba..05ae1f13b5 100644 --- a/tests/Tests/ClientConcepts/OpenTelemetry/OpenTelemetryTests.cs +++ b/tests/Tests/ClientConcepts/OpenTelemetry/OpenTelemetryTests.cs @@ -40,9 +40,9 @@ public async Task BasicOpenTelemetryTest() await client.SearchAsync(s => s.Index("test").Query(q => q.MatchAll(m => { }))); - VerifyActivity(oTelActivity, "search", "GET", "http://localhost:9200/test/_search?pretty=true&error_trace=true"); + VerifyActivity(oTelActivity, "search", "POST", "http://localhost:9200/test/_search?pretty=true&error_trace=true"); - static void VerifyActivity(Activity oTelActivity, string operation, string displayName, string url = null) + static void VerifyActivity(Activity oTelActivity, string displayName, string operation, string url = null) { oTelActivity.Should().NotBeNull(); @@ -53,13 +53,13 @@ static void VerifyActivity(Activity oTelActivity, string operation, string displ oTelActivity.Tags.Should().Contain(n => n.Key == "elastic.transport.product.name" && n.Value == "elasticsearch-net"); oTelActivity.Tags.Should().Contain(n => n.Key == "db.system" && n.Value == "elasticsearch"); - oTelActivity.Tags.Should().Contain(n => n.Key == "db.operation" && n.Value == operation); + oTelActivity.Tags.Should().Contain(n => n.Key == "db.operation" && n.Value == displayName); oTelActivity.Tags.Should().Contain(n => n.Key == "db.user" && n.Value == "elastic"); oTelActivity.Tags.Should().Contain(n => n.Key == "url.full" && n.Value == (url ?? "http://localhost:9200/?pretty=true&error_trace=true")); oTelActivity.Tags.Should().Contain(n => n.Key == "server.address" && n.Value == "localhost"); - oTelActivity.Tags.Should().Contain(n => n.Key == "http.request.method" && n.Value == (operation == "ping" ? "HEAD" : "POST")); + oTelActivity.Tags.Should().Contain(n => n.Key == "http.request.method" && n.Value == (displayName == "ping" ? "HEAD" : "POST")); - switch (operation) + switch (displayName) { case "search": oTelActivity.Tags.Should().Contain(n => n.Key == "db.elasticsearch.path_parts.index" && n.Value == "test");