99import org .junit .jupiter .api .AfterAll ;
1010import org .junit .jupiter .api .Assertions ;
1111import org .junit .jupiter .api .BeforeAll ;
12- import org .junit .jupiter .api .Disabled ;
1312import org .junit .jupiter .api .Test ;
1413import org .junit .jupiter .api .extension .RegisterExtension ;
1514
2221 *
2322 * @author Aleksandr Gorshenin
2423 */
25- @ Disabled
2624public class YdbDriverStaticCredsTest {
2725 @ RegisterExtension
2826 private static final YdbHelperExtension ydb = new YdbHelperExtension ();
@@ -38,15 +36,17 @@ public static void createUsers() throws SQLException {
3836 statement .execute (""
3937 + "CREATE USER user1 PASSWORD NULL;\n "
4038 + "CREATE USER user2 PASSWORD 'pwss';\n "
41- + "CREATE USER user3 PASSWORD 'pw :ss;'\n ;"
39+ + "CREATE USER user3 PASSWORD 'pwss';\n "
40+ + "CREATE USER user4 PASSWORD 'pw@&ss'\n ;"
41+ + "CREATE USER user5 PASSWORD 'pw@&ss'\n ;"
4242 );
4343 }
4444 }
4545
4646 @ AfterAll
4747 public static void dropUsers () throws SQLException {
4848 try (Statement statement = jdbc .connection ().createStatement ()) {
49- statement .execute ("DROP USER IF EXISTS user1, user2, user3;" );
49+ statement .execute ("DROP USER IF EXISTS user1, user2, user3, user4, user5 ;" );
5050 }
5151 }
5252
@@ -91,10 +91,10 @@ public void connectOK() throws SQLException {
9191 testConnection (connectByAuthority ("user1" , null ), "user1" );
9292
9393 testConnection (connectByProperties ("user2" , "pwss" ), "user2" );
94- testConnection (connectByAuthority ("user2 " , "pwss" ), "user2 " );
94+ testConnection (connectByAuthority ("user3 " , "pwss" ), "user3 " );
9595
96- testConnection (connectByProperties ("user3 " , "pw :ss; " ), "user3 " );
97- testConnection (connectByAuthority ("user3 " , "pw :ss; " ), "user3 " );
96+ testConnection (connectByProperties ("user4 " , "pw@&ss " ), "user4 " );
97+ testConnection (connectByAuthority ("user5 " , "pw@&ss " ), "user5 " );
9898 }
9999
100100 @ Test
@@ -106,17 +106,17 @@ public void connectWrong() throws SQLException {
106106 wrongConnection (connectByProperties ("user2" , null ));
107107 wrongConnection (connectByProperties ("user2" , "pass" ));
108108
109- wrongConnection (connectByAuthority ("user2" , "" ));
110- wrongConnection (connectByAuthority ("user2" , null ));
111- wrongConnection (connectByAuthority ("user2" , "pass" ));
112-
113- wrongConnection (connectByProperties ("user3" , "" ));
114- wrongConnection (connectByProperties ("user3" , null ));
115- wrongConnection (connectByProperties ("user3" , "pw:ss;" ));
116-
117109 wrongConnection (connectByAuthority ("user3" , "" ));
118110 wrongConnection (connectByAuthority ("user3" , null ));
119- wrongConnection (connectByAuthority ("user3" , "pw:ss;" ));
111+ wrongConnection (connectByAuthority ("user3" , "pass" ));
112+
113+ wrongConnection (connectByProperties ("user4" , "" ));
114+ wrongConnection (connectByProperties ("user4" , null ));
115+ wrongConnection (connectByProperties ("user4" , "pw:ss;" ));
116+
117+ wrongConnection (connectByAuthority ("user5" , "" ));
118+ wrongConnection (connectByAuthority ("user5" , null ));
119+ wrongConnection (connectByAuthority ("user5" , "pw:@&ss" ));
120120 }
121121
122122 interface ConnectionSupplier {
0 commit comments