diff --git a/test/OpenTelemetry.Instrumentation.SqlClient.Tests/SqlClientIntegrationTests.cs b/test/OpenTelemetry.Instrumentation.SqlClient.Tests/SqlClientIntegrationTests.cs index 2185963f9e..bb72593691 100644 --- a/test/OpenTelemetry.Instrumentation.SqlClient.Tests/SqlClientIntegrationTests.cs +++ b/test/OpenTelemetry.Instrumentation.SqlClient.Tests/SqlClientIntegrationTests.cs @@ -24,15 +24,16 @@ public SqlClientIntegrationTests(SqlClientIntegrationTestsFixture fixture) [EnabledOnDockerPlatformTheory(EnabledOnDockerPlatformTheoryAttribute.DockerPlatform.Linux)] [InlineData(CommandType.Text, "select 1/1")] - [InlineData(CommandType.Text, "select 1/1", true)] - [InlineData(CommandType.Text, "select 1/0", false, true)] - [InlineData(CommandType.Text, "select 1/0", false, true, false, false)] - [InlineData(CommandType.Text, "select 1/0", false, true, true, false)] - [InlineData(CommandType.StoredProcedure, "sp_who")] + [InlineData(CommandType.Text, "select 1/1", true, "select ?/?")] + [InlineData(CommandType.Text, "select 1/0", false, null, true)] + [InlineData(CommandType.Text, "select 1/0", false, null, true, false, false)] + [InlineData(CommandType.Text, "select 1/0", false, null, true, true, false)] + [InlineData(CommandType.StoredProcedure, "sp_who", false, "sp_who")] public void SuccessfulCommandTest( CommandType commandType, string commandText, bool captureTextCommandContent = false, + string? sanitizedCommandText = null, bool isFailure = false, bool recordException = false, bool shouldEnrich = true) @@ -84,7 +85,7 @@ public void SuccessfulCommandTest( Assert.Single(activities); var activity = activities[0]; - SqlClientTests.VerifyActivityData(commandType, commandText, captureTextCommandContent, isFailure, recordException, shouldEnrich, activity); + SqlClientTests.VerifyActivityData(commandType, sanitizedCommandText, captureTextCommandContent, isFailure, recordException, shouldEnrich, activity); SqlClientTests.VerifySamplingParameters(sampler.LatestSamplingParameters); if (isFailure) diff --git a/test/OpenTelemetry.Instrumentation.SqlClient.Tests/SqlClientTests.cs b/test/OpenTelemetry.Instrumentation.SqlClient.Tests/SqlClientTests.cs index c31cd18c40..759cf81445 100644 --- a/test/OpenTelemetry.Instrumentation.SqlClient.Tests/SqlClientTests.cs +++ b/test/OpenTelemetry.Instrumentation.SqlClient.Tests/SqlClientTests.cs @@ -408,7 +408,7 @@ public void ShouldNotCollectTelemetryAndShouldNotPropagateExceptionWhenFilterThr internal static void VerifyActivityData( CommandType commandType, - string commandText, + string? commandText, bool captureTextCommandContent, bool isFailure, bool recordException,