From 518df9f2fa563b9e6bb083a9d7c9735d0075c099 Mon Sep 17 00:00:00 2001 From: Westin Musser <127992899+westin-m@users.noreply.github.com> Date: Thu, 12 Dec 2024 15:51:53 -0800 Subject: [PATCH] fix tests --- .../JsonWebTokenHandlerTelemetryTests.cs | 4 +++- .../JwtSecurityTokenHandlerTelemetryTests.cs | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/test/Microsoft.IdentityModel.JsonWebTokens.Tests/JsonWebTokenHandlerTelemetryTests.cs b/test/Microsoft.IdentityModel.JsonWebTokens.Tests/JsonWebTokenHandlerTelemetryTests.cs index fdea100b51..d884664434 100644 --- a/test/Microsoft.IdentityModel.JsonWebTokens.Tests/JsonWebTokenHandlerTelemetryTests.cs +++ b/test/Microsoft.IdentityModel.JsonWebTokens.Tests/JsonWebTokenHandlerTelemetryTests.cs @@ -19,7 +19,7 @@ namespace Microsoft.IdentityModel.JsonWebTokens.Tests public class JsonWebTokenHandlerTelemetryTests { [Fact] - public async Task ValidateJWSWithConfigAsync() + public async Task ValidateJWSWithConfigAsync_ExpectedTagsExist() { var invalidIssuerConfig = new OpenIdConnectConfiguration() { @@ -57,7 +57,9 @@ public async Task ValidateJWSWithConfigAsync() var expectedCounterTagList = new Dictionary { + // metadata address is null because the configuration manager is made using an invalid config to trigger an exception { TelemetryConstants.IdentityModelVersionTag, IdentityModelTelemetryUtil.ClientVer }, + { TelemetryConstants.MetadataAddressTag, null }, { TelemetryConstants.OperationStatusTag, TelemetryConstants.Protocols.LKG } }; diff --git a/test/System.IdentityModel.Tokens.Jwt.Tests/JwtSecurityTokenHandlerTelemetryTests.cs b/test/System.IdentityModel.Tokens.Jwt.Tests/JwtSecurityTokenHandlerTelemetryTests.cs index 4652243d3d..c144d6a924 100644 --- a/test/System.IdentityModel.Tokens.Jwt.Tests/JwtSecurityTokenHandlerTelemetryTests.cs +++ b/test/System.IdentityModel.Tokens.Jwt.Tests/JwtSecurityTokenHandlerTelemetryTests.cs @@ -53,7 +53,9 @@ public void ValidateToken_ExpectedTagsExist() var expectedCounterTagList = new Dictionary { + // metadata address is null because the configuration manager is made using an invalid config to trigger an exception { TelemetryConstants.IdentityModelVersionTag, IdentityModelTelemetryUtil.ClientVer }, + { TelemetryConstants.MetadataAddressTag, null }, { TelemetryConstants.OperationStatusTag, TelemetryConstants.Protocols.LKG }, };