From 623ce698c41d9d3a0ac732d4f533c2dacdc369fd Mon Sep 17 00:00:00 2001 From: kellyyangsong <69649063+kellyyangsong@users.noreply.github.com> Date: Tue, 1 Oct 2024 18:12:55 -0700 Subject: [PATCH] =?UTF-8?q?Fix=20ValidateJsonWebTokenClaimMapping=20Flaky?= =?UTF-8?q?=20Test=20=F0=9F=90=9E=20(#2859)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix text flakiness by updating offending test and adding both tests to a collection * rm offending test as it was causing flakiness and had unclear value --- .../JwtTokenUtilitiesTests.cs | 22 ------------------- 1 file changed, 22 deletions(-) diff --git a/test/Microsoft.IdentityModel.JsonWebTokens.Tests/JwtTokenUtilitiesTests.cs b/test/Microsoft.IdentityModel.JsonWebTokens.Tests/JwtTokenUtilitiesTests.cs index 16509cbea4..f3a137687e 100644 --- a/test/Microsoft.IdentityModel.JsonWebTokens.Tests/JwtTokenUtilitiesTests.cs +++ b/test/Microsoft.IdentityModel.JsonWebTokens.Tests/JwtTokenUtilitiesTests.cs @@ -4,9 +4,7 @@ using System; using System.Collections.Generic; using System.Diagnostics.Tracing; -using System.IdentityModel.Tokens.Jwt; using System.Linq; -using System.Security.Claims; using Microsoft.IdentityModel.Logging; using Microsoft.IdentityModel.Protocols.OpenIdConnect; using Microsoft.IdentityModel.TestUtils; @@ -122,26 +120,6 @@ public void LogSecurityArtifactTest() listener.TraceBuffer = string.Empty; } - [Fact] - public void ClaimTypeMappingIsIndependent() - { - // Each handler should have its own instance of the ClaimTypeMap - var jwtClaimsMapping = JwtSecurityTokenHandler.DefaultInboundClaimTypeMap; - var jsonClaimsMapping = JsonWebTokenHandler.DefaultInboundClaimTypeMap; - - Assert.NotEmpty(jwtClaimsMapping); - Assert.NotEmpty(jsonClaimsMapping); - - Assert.Equal(jwtClaimsMapping, jsonClaimsMapping); - - // Clearing one should not affect the other - jwtClaimsMapping.Clear(); - - Assert.Empty(jwtClaimsMapping); - Assert.NotEmpty(jsonClaimsMapping); - - } - [Fact] public void ResolveTokenSigningKey() {