Skip to content

Commit 182414b

Browse files
committed
fix test case
1 parent d34eb73 commit 182414b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Accounts/Authentication.Test/AuthenticationFactoryTests.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
using Microsoft.Azure.Commands.Common.Authentication.Test;
2525
using Microsoft.WindowsAzure.Commands.Utilities.Common;
2626
using Xunit.Abstractions;
27+
using System.Text.RegularExpressions;
2728

2829
namespace Common.Authentication.Test
2930
{
@@ -342,7 +343,9 @@ public void CanAuthenticateUsingMSIObjectId()
342343
[Trait(Category.AcceptanceType, Category.CheckIn)]
343344
void ResponseRedactionWorks()
344345
{
345-
Assert.Equal(" \"access_token\": \"<redacted>\"", GeneralUtilities.TransformBody(" \"access_token\": \"eyJo1234567\""));
346+
IList<Regex> matchers = new List<Regex>();
347+
matchers.Add(new Regex("(\\s*\"access_token\"\\s*:\\s*)\"[^\"]+\""));
348+
Assert.Equal(" \"access_token\": \"<redacted>\"", GeneralUtilities.TransformBody(" \"access_token\": \"eyJo1234567\"", matchers));
346349
Assert.Equal(" \"foo\": \"bar\"", GeneralUtilities.TransformBody(" \"foo\": \"bar\""));
347350
}
348351

0 commit comments

Comments
 (0)