Skip to content

Commit

Permalink
Fix ValidateJsonWebTokenClaimMapping Flaky Test 🐞 (#2859)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
kellyyangsong authored Oct 2, 2024
1 parent 8b4eea6 commit 623ce69
Showing 1 changed file with 0 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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()
{
Expand Down

0 comments on commit 623ce69

Please sign in to comment.