Skip to content

Commit bc8b65b

Browse files
committed
Resolve indexOutOfBound issue
1 parent 69851f7 commit bc8b65b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/test/java/com/microsoft/sqlserver/jdbc/SQLServerConnectionTest.java

+7-2
Original file line numberDiff line numberDiff line change
@@ -1382,8 +1382,13 @@ public void testGetSqlFedAuthTokenFailureNagativeWaiting() throws SQLException {
13821382
public void testManagedIdentityWithEncryptStrict() {
13831383
SQLServerDataSource ds = new SQLServerDataSource();
13841384

1385-
String connectionUrl = TestUtils.removeProperty(connectionString, "user");
1386-
connectionUrl = TestUtils.removeProperty(connectionUrl, "password");
1385+
String connectionUrl = connectionString;
1386+
if (connectionUrl.contains("user=")) {
1387+
connectionUrl = TestUtils.removeProperty(connectionUrl, "user");
1388+
}
1389+
if (connectionUrl.contains("password=")) {
1390+
connectionUrl = TestUtils.removeProperty(connectionUrl, "password");
1391+
}
13871392

13881393
ds.setURL(connectionUrl);
13891394
ds.setAuthentication("ActiveDirectoryMSI");

0 commit comments

Comments
 (0)