Skip to content

Commit ef6b770

Browse files
authored
Updated fedauth error tests (#2538)
1 parent b27b0c1 commit ef6b770

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/test/java/com/microsoft/sqlserver/jdbc/fedauth/ErrorMessageTest.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,8 @@ public void testADPasswordWrongPasswordWithConnectionStringUserName() throws SQL
397397
&& e.getCause().getCause().getMessage().toLowerCase().contains("invalid username or password")
398398
|| e.getCause().getCause().getMessage().contains(ERR_MSG_SIGNIN_TOO_MANY)
399399
|| e.getCause().getCause().getMessage().contains(ERR_FAULT_ID3342)
400-
|| e.getMessage().contains(ERR_MSG_REQUEST_THROTTLED));
400+
|| e.getMessage().contains(ERR_MSG_REQUEST_THROTTLED)
401+
|| e.getMessage().contains(ERR_FAULT_AUTH_FAIL));
401402
}
402403
}
403404

@@ -424,7 +425,8 @@ public void testADPasswordWrongPasswordWithDatasource() throws SQLException {
424425
&& e.getCause().getCause().getMessage().toLowerCase().contains("invalid username or password")
425426
|| e.getCause().getCause().getMessage().contains(ERR_MSG_SIGNIN_TOO_MANY)
426427
|| e.getCause().getCause().getMessage().contains(ERR_FAULT_ID3342)
427-
|| e.getMessage().contains(ERR_MSG_REQUEST_THROTTLED));
428+
|| e.getMessage().contains(ERR_MSG_REQUEST_THROTTLED)
429+
|| e.getMessage().contains(ERR_FAULT_AUTH_FAIL));
428430
}
429431
}
430432

@@ -445,7 +447,8 @@ public void testADPasswordWrongPasswordWithConnectionStringUser() throws SQLExce
445447
&& e.getCause().getCause().getMessage().toLowerCase().contains("invalid username or password")
446448
|| e.getCause().getCause().getMessage().contains(ERR_MSG_SIGNIN_TOO_MANY)
447449
|| e.getCause().getCause().getMessage().contains(ERR_FAULT_ID3342)
448-
|| e.getMessage().contains(ERR_MSG_REQUEST_THROTTLED));
450+
|| e.getMessage().contains(ERR_MSG_REQUEST_THROTTLED)
451+
|| e.getMessage().contains(ERR_FAULT_AUTH_FAIL));
449452
}
450453
}
451454

src/test/java/com/microsoft/sqlserver/jdbc/fedauth/FedauthCommon.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ public class FedauthCommon extends AbstractTest {
128128
static final String ERR_MSG_HAS_BEEN_CLOSED = TestResource.getResource("R_hasBeenClosed");
129129
static final String ERR_MSG_SIGNIN_TOO_MANY = TestResource.getResource("R_signinTooManyTimes");
130130
static final String ERR_FAULT_ID3342 = "FaultMessage: ID3242";
131+
static final String ERR_FAULT_AUTH_FAIL = "FaultMessage: Authentication Failure";
131132
static final String ERR_MSG_NOT_AUTH_AND_IS = TestUtils.R_BUNDLE
132133
.getString("R_SetAuthenticationWhenIntegratedSecurityTrue");
133134
static final String ERR_MSG_NOT_AUTH_AND_USER_PASSWORD = TestUtils.R_BUNDLE

0 commit comments

Comments
 (0)