From 1358f941a1121bdcb6b5a351d8a2d1c512042c71 Mon Sep 17 00:00:00 2001 From: Ananya Garg Date: Wed, 27 Nov 2024 13:52:18 +0530 Subject: [PATCH] Updated testDSPooledConnectionAccessTokenCallbackClassExceptions test case in PooledConnectionTest.java --- .../jdbc/fedauth/PooledConnectionTest.java | 23 +------------------ 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/fedauth/PooledConnectionTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/fedauth/PooledConnectionTest.java index a7bf0f8c4..dee9f7b17 100644 --- a/src/test/java/com/microsoft/sqlserver/jdbc/fedauth/PooledConnectionTest.java +++ b/src/test/java/com/microsoft/sqlserver/jdbc/fedauth/PooledConnectionTest.java @@ -435,29 +435,8 @@ public void testDSPooledConnectionAccessTokenCallbackClassExceptions() throws Ex // User/password is not required for access token callback AbstractTest.updateDataSource(accessTokenCallbackConnectionString, ds); - ds.setAccessTokenCallbackClass(AccessTokenCallbackClass.class.getName()); - ds.setUser("user"); SQLServerPooledConnection pc; - - // Should fail with user set - try { - pc = (SQLServerPooledConnection) ds.getPooledConnection(); - fail(TestResource.getResource("R_expectedFailPassed")); - } catch (SQLServerException e) { - assertTrue(e.getMessage().matches(TestUtils.formatErrorMsg("R_AccessTokenCallbackWithUserPassword"))); - } - - ds.setUser(""); - ds.setPassword(UUID.randomUUID().toString()); - - // Should fail with password set - try { - pc = (SQLServerPooledConnection) ds.getPooledConnection(); - fail(TestResource.getResource("R_expectedFailPassed")); - } catch (SQLServerException e) { - assertTrue(e.getMessage().matches(TestUtils.formatErrorMsg("R_AccessTokenCallbackWithUserPassword"))); - } - + // Should fail with invalid accessTokenCallbackClass value ds.setAccessTokenCallbackClass("Invalid"); ds.setUser("");