From fa51fd47f4f91ba57a855ce267474b6cdc43f71d Mon Sep 17 00:00:00 2001 From: rusher Date: Wed, 26 Apr 2023 15:46:16 +0200 Subject: [PATCH] [misc] windows test correction --- .../org/mariadb/jdbc/integration/DataSourceTest.java | 9 +++++---- .../jdbc/integration/GssapiAuthenticationTest.java | 3 ++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/test/java/org/mariadb/jdbc/integration/DataSourceTest.java b/src/test/java/org/mariadb/jdbc/integration/DataSourceTest.java index 0144b0e33..f04fbab03 100644 --- a/src/test/java/org/mariadb/jdbc/integration/DataSourceTest.java +++ b/src/test/java/org/mariadb/jdbc/integration/DataSourceTest.java @@ -25,10 +25,11 @@ public void basic() throws SQLException { ds.setUrl(mDefUrl); testDs(ds); - ds = new MariaDbDataSource(); - ds.setPassword("ttt"); - ds.setUrl(mDefUrl); - assertThrows(SQLException.class, ds::getConnection); + MariaDbDataSource ds2 = new MariaDbDataSource(); + ds2.setUrl(mDefUrl); + ds2.setPassword("ttt"); + ds2.setUser("ttt"); + assertThrows(SQLException.class, ds2::getConnection); } private void testDs(MariaDbDataSource ds) throws SQLException { diff --git a/src/test/java/org/mariadb/jdbc/integration/GssapiAuthenticationTest.java b/src/test/java/org/mariadb/jdbc/integration/GssapiAuthenticationTest.java index d5df69d8d..af4016440 100644 --- a/src/test/java/org/mariadb/jdbc/integration/GssapiAuthenticationTest.java +++ b/src/test/java/org/mariadb/jdbc/integration/GssapiAuthenticationTest.java @@ -19,7 +19,8 @@ public void nativePassword() throws Exception { } catch (SQLException e) { // eat } - System.out.println("user name:" + System.getProperty("user.name")); + + stmt.execute("DROP USER IF EXISTS " + System.getProperty("user.name")); stmt.execute("CREATE USER " + System.getProperty("user.name") + " IDENTIFIED VIA gssapi"); stmt.execute("GRANT ALL PRIVILEGES ON *.* TO " + System.getProperty("user.name"));