Skip to content

Commit ba6675f

Browse files
committed
Fix tests
1 parent eaffb81 commit ba6675f

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

Diff for: tests/Tests.Core/Client/FixedResponseClient.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public static ElasticsearchClient Create(
1717
object response,
1818
int statusCode = 200,
1919
Func<ElasticsearchClientSettings, ElasticsearchClientSettings> modifySettings = null,
20-
string contentType = RequestData.DefaultContentType,
20+
string contentType = BoundConfiguration.DefaultContentType,
2121
Exception exception = null
2222
)
2323
{
@@ -29,7 +29,7 @@ public static ElasticsearchClientSettings CreateConnectionSettings(
2929
object response,
3030
int statusCode = 200,
3131
Func<ElasticsearchClientSettings, ElasticsearchClientSettings> modifySettings = null,
32-
string contentType = RequestData.DefaultContentType,
32+
string contentType = BoundConfiguration.DefaultContentType,
3333
Exception exception = null,
3434
Serializer serializer = null
3535
)
@@ -46,7 +46,7 @@ public static ElasticsearchClientSettings CreateConnectionSettings(
4646
break;
4747
default:
4848
{
49-
responseBytes = contentType == RequestData.DefaultContentType
49+
responseBytes = contentType == BoundConfiguration.DefaultContentType
5050
? serializer.SerializeToBytes(response,
5151
TestClient.Default.ElasticsearchClientSettings.MemoryStreamFactory)
5252
: Encoding.UTF8.GetBytes(response.ToString());

Diff for: tests/Tests/ClientConcepts/OpenTelemetry/OpenTelemetryTests.cs

+5-5
Original file line numberDiff line numberDiff line change
@@ -32,24 +32,24 @@ public async Task BasicOpenTelemetryTest()
3232

3333
client.Ping();
3434

35-
VerifyActivity(oTelActivity, "ping");
35+
VerifyActivity(oTelActivity, "ping", "HEAD");
3636

3737
await client.PingAsync();
3838

39-
VerifyActivity(oTelActivity, "ping");
39+
VerifyActivity(oTelActivity, "ping", "HEAD");
4040

4141
await client.SearchAsync<Project>(s => s.Index("test").Query(q => q.MatchAll(m => { })));
4242

43-
VerifyActivity(oTelActivity, "search", "http://localhost:9200/test/_search?pretty=true&error_trace=true");
43+
VerifyActivity(oTelActivity, "search", "GET", "http://localhost:9200/test/_search?pretty=true&error_trace=true");
4444

45-
static void VerifyActivity(Activity oTelActivity, string operation, string url = null)
45+
static void VerifyActivity(Activity oTelActivity, string operation, string displayName, string url = null)
4646
{
4747
oTelActivity.Should().NotBeNull();
4848

4949
oTelActivity.Kind.Should().Be(ActivityKind.Client);
5050

51-
oTelActivity.DisplayName.Should().Be(operation);
5251
oTelActivity.OperationName.Should().Be(operation);
52+
oTelActivity.DisplayName.Should().Be(displayName);
5353

5454
oTelActivity.Tags.Should().Contain(n => n.Key == "elastic.transport.product.name" && n.Value == "elasticsearch-net");
5555
oTelActivity.Tags.Should().Contain(n => n.Key == "db.system" && n.Value == "elasticsearch");

0 commit comments

Comments
 (0)