Skip to content

Commit

Permalink
Tests | Address random error on AADPasswordWithWrongPassword test case (
Browse files Browse the repository at this point in the history
  • Loading branch information
cheenamalhotra authored Oct 18, 2021
1 parent c0fd7d2 commit 71aefa5
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,10 @@ public static void AADPasswordWithWrongPassword()
string[] credKeys = { "Password", "PWD" };
string connStr = DataTestUtility.RemoveKeysInConnStr(DataTestUtility.AADPasswordConnectionString, credKeys) + "Password=TestPassword;";

SqlException e = Assert.Throws<SqlException>(() => ConnectAndDisconnect(connStr));
Assert.Throws<SqlException>(() => ConnectAndDisconnect(connStr));

string expectedMessage = "ID3242: The security token could not be authenticated or authorized.";
Assert.Contains(expectedMessage, e.Message);
// We cannot verify error message with certainity as driver may cache token from other tests for current user
// and error message may change accordingly.
}

[ConditionalFact(nameof(IsAADConnStringsSetup))]
Expand Down

0 comments on commit 71aefa5

Please sign in to comment.