Skip to content

Commit 90dfd31

Browse files
authored
Restore PopKeyResolvingTests.GetPopKeysFromJkuAsync (#2947)
* restore GetPopKeysFromJkuAsync * instantiate theory datas w/ testId via ctor
1 parent c6b3b6a commit 90dfd31

File tree

1 file changed

+19
-29
lines changed

1 file changed

+19
-29
lines changed

test/Microsoft.IdentityModel.Protocols.SignedHttpRequest.Tests/PopKeyResolvingTests.cs

Lines changed: 19 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,7 @@ public static TheoryData<ResolvePopKeyTheoryData> ResolvePopKeyFromJkuKidTheoryD
742742
}
743743
}
744744

745-
[Theory(Skip = "flaky"), MemberData(nameof(GetPopKeysFromJkuAsyncTheoryData), DisableDiscoveryEnumeration = true)]
745+
[Theory, MemberData(nameof(GetPopKeysFromJkuAsyncTheoryData), DisableDiscoveryEnumeration = true)]
746746
public async Task GetPopKeysFromJkuAsync(ResolvePopKeyTheoryData theoryData)
747747
{
748748
var context = TestUtilities.WriteHeader($"{this}.GetPopKeysFromJkuAsync", theoryData);
@@ -771,36 +771,32 @@ public static TheoryData<ResolvePopKeyTheoryData> GetPopKeysFromJkuAsyncTheoryDa
771771
{
772772
return new TheoryData<ResolvePopKeyTheoryData>
773773
{
774-
new ResolvePopKeyTheoryData
774+
new ResolvePopKeyTheoryData("InvalidJkuUrlNull")
775775
{
776776
First = true,
777777
JkuSetUrl = null,
778778
ExpectedException = ExpectedException.ArgumentNullException(),
779-
TestId = "InvalidJkuUrlNull",
780779
},
781-
new ResolvePopKeyTheoryData
780+
new ResolvePopKeyTheoryData("InvalidJkuUrlEmptyString")
782781
{
783782
JkuSetUrl = string.Empty,
784783
ExpectedException = ExpectedException.ArgumentNullException(),
785-
TestId = "InvalidJkuUrlEmptyString",
786784
},
787-
new ResolvePopKeyTheoryData
785+
new ResolvePopKeyTheoryData("InvalidHttpsRequired")
788786
{
789787
JkuSetUrl = "http://www.contoso.com",
790788
ExpectedException = new ExpectedException(typeof(SignedHttpRequestInvalidPopKeyException), "IDX23006"),
791-
TestId = "InvalidHttpsRequired",
792789
},
793-
new ResolvePopKeyTheoryData
790+
new ResolvePopKeyTheoryData("InvalidNoContentReturned")
794791
{
795792
JkuSetUrl = "https://www.contoso.com",
796793
SignedHttpRequestValidationParameters = new SignedHttpRequestValidationParameters()
797794
{
798795
HttpClientProvider = () => HttpResponseMessageUtils.SetupHttpClientThatReturns(string.Empty),
799796
},
800797
ExpectedException = new ExpectedException(typeof(SignedHttpRequestInvalidPopKeyException), "IDX23022", null, true),
801-
TestId = "InvalidNoContentReturned",
802798
},
803-
new ResolvePopKeyTheoryData
799+
new ResolvePopKeyTheoryData("InvalidHttpNoContentReturned")
804800
{
805801
JkuSetUrl = "http://www.contoso.com",
806802
SignedHttpRequestValidationParameters = new SignedHttpRequestValidationParameters()
@@ -809,48 +805,42 @@ public static TheoryData<ResolvePopKeyTheoryData> GetPopKeysFromJkuAsyncTheoryDa
809805
HttpClientProvider = () => HttpResponseMessageUtils.SetupHttpClientThatReturns(string.Empty),
810806
},
811807
ExpectedException = new ExpectedException(typeof(SignedHttpRequestInvalidPopKeyException), "IDX23022", null, true),
812-
TestId = "InvalidHttpNoContentReturned",
813-
},
814-
// TODO - find out why test is timing out in the AzureDevOps build, appears to be unrelated to the caching changes
815-
//new ResolvePopKeyTheoryData
816-
//{
817-
// JkuSetUrl = "http://www.contoso.com",
818-
// SignedHttpRequestValidationParameters = new SignedHttpRequestValidationParameters()
819-
// {
820-
// RequireHttpsForJkuResourceRetrieval = false,
821-
// },
822-
// ExpectedException = new ExpectedException(typeof(SignedHttpRequestInvalidPopKeyException), "IDX23022", typeof(ArgumentException)),
823-
// TestId = "Valid0KeysReturnedLive",
824-
//},
825-
new ResolvePopKeyTheoryData
808+
},
809+
new ResolvePopKeyTheoryData("Valid0KeysReturnedLive")
810+
{
811+
JkuSetUrl = "http://www.contoso.com",
812+
SignedHttpRequestValidationParameters = new SignedHttpRequestValidationParameters()
813+
{
814+
RequireHttpsForJkuResourceRetrieval = false,
815+
},
816+
ExpectedException = new ExpectedException(typeof(SignedHttpRequestInvalidPopKeyException), "IDX23022", typeof(ArgumentException)),
817+
},
818+
new ResolvePopKeyTheoryData("Valid0KeysReturned")
826819
{
827820
JkuSetUrl = "https://www.contoso.com",
828821
SignedHttpRequestValidationParameters = new SignedHttpRequestValidationParameters()
829822
{
830823
HttpClientProvider = () => HttpResponseMessageUtils.SetupHttpClientThatReturns("{\"test\": 1}"),
831824
},
832825
ExpectedNumberOfPopKeysReturned = 0,
833-
TestId = "Valid0KeysReturned",
834826
},
835-
new ResolvePopKeyTheoryData
827+
new ResolvePopKeyTheoryData("Valid2KeysReturned")
836828
{
837829
JkuSetUrl = "https://www.contoso.com",
838830
SignedHttpRequestValidationParameters = new SignedHttpRequestValidationParameters()
839831
{
840832
HttpClientProvider = () => HttpResponseMessageUtils.SetupHttpClientThatReturns(DataSets.JsonWebKeySetString1),
841833
},
842834
ExpectedNumberOfPopKeysReturned = 2,
843-
TestId = "Valid2KeysReturned",
844835
},
845-
new ResolvePopKeyTheoryData
836+
new ResolvePopKeyTheoryData("Valid3KeysReturned")
846837
{
847838
JkuSetUrl = "https://www.contoso.com",
848839
SignedHttpRequestValidationParameters = new SignedHttpRequestValidationParameters()
849840
{
850841
HttpClientProvider = () => HttpResponseMessageUtils.SetupHttpClientThatReturns(DataSets.JsonWebKeySetECCString),
851842
},
852843
ExpectedNumberOfPopKeysReturned = 3,
853-
TestId = "Valid3KeysReturned",
854844
},
855845
};
856846
}

0 commit comments

Comments
 (0)