Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Flaky Tests: NameAndRoleClaimDelegates and RoleClaims #2873

Merged
merged 4 commits into from
Oct 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Security.Claims;
using System.Threading.Tasks;
using Microsoft.IdentityModel.JsonWebTokens;
Expand Down Expand Up @@ -1154,8 +1153,12 @@ public void MapInboundClaims()

// Check to make sure that setting MapInboundClaims to true initializes the InboundClaimType map with the default mappings if it was previously empty.
Assert.Equal(73, handler.InboundClaimTypeMap.Count);

// Check to make sure that changing the instance property did not alter the static property.
Assert.True(JwtSecurityTokenHandler.DefaultMapInboundClaims == false);

// re-set DefaultMapInboundClaims to true to avoid causing flakiness for other tests.
JwtSecurityTokenHandler.DefaultMapInboundClaims = true;
}

[Theory, MemberData(nameof(ReadTimesExpressedAsDoublesTheoryData), DisableDiscoveryEnumeration = true)]
Expand Down
Loading