Repository: xerial/sqlite-jdbc
Pull request #649 (2021-08-27 03:56:27)

migrate to JUnit 5
Migrating all tests to JUnit 5 using the Jupiter engine.

This also removes the need to declare test classes in `AllTests.java`, which for instance was overlooked on my collation PR (#627), thus tests were not running when running `mvn test`.


Patch:
diff --git a/pom.xml b/pom.xml
index d70100b2..6d3fdf0f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -105,7 +105,13 @@
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-surefire-report-plugin</artifactId>
-        <version>2.6</version>
+        <version>2.22.2</version>
+      </plugin>
+
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <version>2.22.2</version>
       </plugin>
 
       <plugin>
@@ -221,9 +227,21 @@
 
   <dependencies>
     <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>4.13.1</version>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-api</artifactId>
+      <version>5.7.2</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-engine</artifactId>
+      <version>5.7.2</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.hamcrest</groupId>
+      <artifactId>hamcrest-all</artifactId>
+      <version>1.3</version>
       <scope>test</scope>
     </dependency>
   </dependencies>
diff --git a/src/main/resources/META-INF/native-image/org.xerial/sqlite-jdbc/jni-config.json b/src/main/resources/META-INF/native-image/org.xerial/sqlite-jdbc/jni-config.json
index 620e19e5..6eb7156a 100644
--- a/src/main/resources/META-INF/native-image/org.xerial/sqlite-jdbc/jni-config.json
+++ b/src/main/resources/META-INF/native-image/org.xerial/sqlite-jdbc/jni-config.json
@@ -26,6 +26,13 @@
         "allDeclaredFields":true,
         "methods":[{"name":"<init>","parameterTypes":[] }]
     },
+    {
+        "name":"org.sqlite.Collation",
+        "allDeclaredMethods":true,
+        "allPublicMethods": true,
+        "allDeclaredFields":true,
+        "methods":[{"name":"<init>","parameterTypes":[] }]
+    },
     {
         "name":"org.sqlite.ProgressHandler",
         "allDeclaredMethods":true,
diff --git a/src/main/resources/META-INF/native-image/org.xerial/sqlite-jdbc/reflect-config.json b/src/main/resources/META-INF/native-image/org.xerial/sqlite-jdbc/reflect-config.json
index 620e19e5..6eb7156a 100644
--- a/src/main/resources/META-INF/native-image/org.xerial/sqlite-jdbc/reflect-config.json
+++ b/src/main/resources/META-INF/native-image/org.xerial/sqlite-jdbc/reflect-config.json
@@ -26,6 +26,13 @@
         "allDeclaredFields":true,
         "methods":[{"name":"<init>","parameterTypes":[] }]
     },
+    {
+        "name":"org.sqlite.Collation",
+        "allDeclaredMethods":true,
+        "allPublicMethods": true,
+        "allDeclaredFields":true,
+        "methods":[{"name":"<init>","parameterTypes":[] }]
+    },
     {
         "name":"org.sqlite.ProgressHandler",
         "allDeclaredMethods":true,


Test patch:
diff --git a/src/test/java/org/sqlite/AllTests.java b/src/test/java/org/sqlite/AllTests.java
deleted file mode 100644
index 9e3ad458..00000000
--- a/src/test/java/org/sqlite/AllTests.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package org.sqlite;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-import org.sqlite.util.OSInfoTest;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
-    BackupTest.class,
-    ConnectionTest.class,
-    DBMetaDataTest.class,
-    ErrorMessageTest.class,
-    ExtendedCommandTest.class,
-    ExtensionTest.class,
-    FetchSizeTest.class,
-    InsertQueryTest.class,
-    JDBCTest.class,
-    OSInfoTest.class,
-    PrepStmtTest.class,
-    QueryTest.class,
-    ReadUncommittedTest.class,
-    RSMetaDataTest.class,
-    SavepointTest.class,
-    SQLiteDataSourceTest.class,
-    SQLiteConnectionPoolDataSourceTest.class,
-    SQLiteJDBCLoaderTest.class,
-    StatementTest.class,
-    TransactionTest.class,
-    UDFTest.class,
-    JSON1Test.class,
-    ProgressHandlerTest.class,
-    BusyHandlerTest.class
-    
-})
-public class AllTests {
-// runs all Tests
-}
\ No newline at end of file
diff --git a/src/test/java/org/sqlite/BackupTest.java b/src/test/java/org/sqlite/BackupTest.java
index caabc9c2..e9f14fef 100644
--- a/src/test/java/org/sqlite/BackupTest.java
+++ b/src/test/java/org/sqlite/BackupTest.java
@@ -9,7 +9,7 @@
 //--------------------------------------
 package org.sqlite;
 
-import static org.junit.Assert.*;
+import org.junit.jupiter.api.Test;
 
 import java.io.File;
 import java.io.IOException;
@@ -19,11 +19,9 @@ import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.sql.Statement;
 
-import org.junit.BeforeClass;
-import org.junit.Test;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
-public class BackupTest
-{
+public class BackupTest {
 
     @Test
     public void backupAndRestore() throws SQLException, IOException {
@@ -59,14 +57,16 @@ public class BackupTest
     @Test
     public void memoryToDisk() throws Exception {
 
-        if (!SQLiteJDBCLoader.isNativeMode())
+        if (!SQLiteJDBCLoader.isNativeMode()) {
             return; // skip this test in pure-java mode
+        }
 
         Connection conn = DriverManager.getConnection("jdbc:sqlite:");
         Statement stmt = conn.createStatement();
         stmt.executeUpdate("create table sample(id integer primary key autoincrement, name)");
-        for (int i = 0; i < 10000; i++)
+        for (int i = 0; i < 10000; i++) {
             stmt.executeUpdate("insert into sample(name) values(\"leo\")");
+        }
 
         File tmpFile = File.createTempFile("backup-test2", ".sqlite");
         tmpFile.deleteOnExit();
diff --git a/src/test/java/org/sqlite/BusyHandlerTest.java b/src/test/java/org/sqlite/BusyHandlerTest.java
index 1c836ec3..780baded 100644
--- a/src/test/java/org/sqlite/BusyHandlerTest.java
+++ b/src/test/java/org/sqlite/BusyHandlerTest.java
@@ -1,8 +1,8 @@
 package org.sqlite;
 
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 import java.sql.Connection;
 import java.sql.DriverManager;
@@ -10,21 +10,20 @@ import java.sql.SQLException;
 import java.sql.Statement;
 import java.util.concurrent.CountDownLatch;
 
-import static org.junit.Assert.assertEquals;
-
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.fail;
 
 public class BusyHandlerTest {
     private Connection conn;
     private Statement stat;
 
-    @Before
+    @BeforeEach
     public void connect() throws Exception {
         conn = DriverManager.getConnection("jdbc:sqlite:target/test.db");
         stat = conn.createStatement();
     }
 
-    @After
+    @AfterEach
     public void close() throws SQLException {
         stat.close();
         conn.close();
@@ -55,20 +54,22 @@ public class BusyHandlerTest {
         }
 
         @Override
-        public void run(){
+        public void run() {
             try {
                 // Generate some work for the sqlite vm
                 stat.executeUpdate("drop table if exists foo;");
                 stat.executeUpdate("create table foo (id integer);");
                 stat.execute("insert into foo (id) values (wait_for_latch());");
-            } catch (SQLException ex) {System.out.println("HERE"+ex.toString());}
+            } catch (SQLException ex) {
+                System.out.println("HERE" + ex.toString());
+            }
         }
     }
 
     private void workWork() throws SQLException {
         // Generate some work for the sqlite vm
         int i = 0;
-        while (i<5) {
+        while (i < 5) {
             stat.execute("insert into foo (id) values (" + i + ")");
             i++;
         }
@@ -97,10 +98,10 @@ public class BusyHandlerTest {
         // let busyWork block inside insert
         busyWork.lockedLatch.await();
 
-        try{
+        try {
             workWork();
             fail("Should throw SQLITE_BUSY exception");
-        } catch(SQLException ex) {
+        } catch (SQLException ex) {
             assertEquals(SQLiteErrorCode.SQLITE_BUSY.code, ex.getErrorCode());
         }
 
@@ -130,10 +131,10 @@ public class BusyHandlerTest {
         busyWork.start();
         // let busyWork block inside insert
         busyWork.lockedLatch.await();
-        try{
+        try {
             workWork();
             fail("Should throw SQLITE_BUSY exception");
-        } catch(SQLException ex) {
+        } catch (SQLException ex) {
             assertEquals(SQLiteErrorCode.SQLITE_BUSY.code, ex.getErrorCode());
         }
         busyWork.completeLatch.countDown();
@@ -146,10 +147,10 @@ public class BusyHandlerTest {
         busyWork.start();
         // let busyWork block inside insert
         busyWork.lockedLatch.await();
-        try{
+        try {
             workWork();
             fail("Should throw SQLITE_BUSY exception");
-        } catch(SQLException ex) {
+        } catch (SQLException ex) {
             assertEquals(SQLiteErrorCode.SQLITE_BUSY.code, ex.getErrorCode());
         }
 
diff --git a/src/test/java/org/sqlite/CollationTest.java b/src/test/java/org/sqlite/CollationTest.java
index 2dd67a72..633133ba 100644
--- a/src/test/java/org/sqlite/CollationTest.java
+++ b/src/test/java/org/sqlite/CollationTest.java
@@ -1,8 +1,8 @@
 package org.sqlite;
 
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 import java.sql.Connection;
 import java.sql.DriverManager;
@@ -13,9 +13,9 @@ import java.text.Collator;
 import java.util.ArrayList;
 import java.util.Arrays;
 
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertArrayEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 /**
  * Tests User Defined Collations.
@@ -27,13 +27,13 @@ public class CollationTest {
     private static String valStr1 = "";
     private static String valStr2 = "";
 
-    @Before
+    @BeforeEach
     public void connect() throws Exception {
         conn = DriverManager.getConnection("jdbc:sqlite:");
         stat = conn.createStatement();
     }
 
-    @After
+    @AfterEach
     public void close() throws SQLException {
         stat.close();
         conn.close();
diff --git a/src/test/java/org/sqlite/ConnectionTest.java b/src/test/java/org/sqlite/ConnectionTest.java
index 31599a57..4c94eaf4 100644
--- a/src/test/java/org/sqlite/ConnectionTest.java
+++ b/src/test/java/org/sqlite/ConnectionTest.java
@@ -1,9 +1,9 @@
 package org.sqlite;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import org.junit.jupiter.api.Test;
+import org.sqlite.SQLiteConfig.JournalMode;
+import org.sqlite.SQLiteConfig.Pragma;
+import org.sqlite.SQLiteConfig.SynchronousMode;
 
 import java.io.File;
 import java.io.FileOutputStream;
@@ -23,19 +23,18 @@ import java.util.concurrent.ExecutionException;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.Future;
-import java.util.concurrent.TimeoutException;
 
-import org.junit.Test;
-import org.sqlite.SQLiteConfig.JournalMode;
-import org.sqlite.SQLiteConfig.Pragma;
-import org.sqlite.SQLiteConfig.SynchronousMode;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
 
 /**
  * These tests check whether access to files is woring correctly and some
  * Connection.close() cases.
  */
-public class ConnectionTest
-{
+public class ConnectionTest {
 
     @Test
     public void isValid() throws SQLException {
@@ -53,8 +52,7 @@ public class ConnectionTest
 
         try {
             stat.executeUpdate("create table A(id, name)");
-        }
-        catch (SQLException e) {
+        } catch (SQLException e) {
             return; // successfully detect the operation on the closed DB
         }
         fail("should not reach here");
@@ -76,25 +74,21 @@ public class ConnectionTest
             stat.executeUpdate("insert into A values(1, 'leo')");
 
             fail("read only flag is not properly set");
-        }
-        catch (SQLException e) {
+        } catch (SQLException e) {
             // success
-        }
-        finally {
+        } finally {
             stat.close();
             conn.close();
         }
 
         config.setReadOnly(true); // should be a no-op
 
-        try{
+        try {
             conn.setReadOnly(false);
             fail("should not change read only flag after opening connection");
-        }
-        catch (SQLException e) {
-           assert(e.getMessage().contains("Cannot change read-only flag after establishing a connection."));
-        }
-        finally {
+        } catch (SQLException e) {
+            assert (e.getMessage().contains("Cannot change read-only flag after establishing a connection."));
+        } finally {
             conn.close();
         }
     }
@@ -115,13 +109,11 @@ public class ConnectionTest
 
             try {
                 stat.executeUpdate("insert into track values(2, 'second track', 3)"); // invalid reference
-            }
-            catch (SQLException e) {
+            } catch (SQLException e) {
                 return; // successfully detect violation of foreign key constraints
             }
             fail("foreign key constraint must be enforced");
-        }
-        finally {
+        } finally {
             stat.close();
             conn.close();
         }
@@ -137,8 +129,7 @@ public class ConnectionTest
 
         try {
             assertFalse(conn.isReadOnly());
-        }
-        finally {
+        } finally {
             stat.close();
             conn.close();
         }
@@ -161,8 +152,7 @@ public class ConnectionTest
                 assertEquals(0, synchronous);
             }
 
-        }
-        finally {
+        } finally {
             stat.close();
             conn.close();
         }
@@ -182,19 +172,18 @@ public class ConnectionTest
         assertTrue(conn.isClosed());
     }
 
-    @Test(expected = SQLException.class)
+    @Test
     public void closeTest() throws SQLException {
         Connection conn = DriverManager.getConnection("jdbc:sqlite:");
         PreparedStatement prep = conn.prepareStatement("select null;");
         ResultSet rs = prep.executeQuery();
         conn.close();
-        prep.clearParameters();
+        assertThrows(SQLException.class, prep::clearParameters);
     }
 
-    @Test(expected = SQLException.class)
-    public void openInvalidLocation() throws SQLException {
-        Connection conn = DriverManager.getConnection("jdbc:sqlite:/");
-        conn.close();
+    @Test
+    public void openInvalidLocation() {
+        assertThrows(SQLException.class, () -> DriverManager.getConnection("jdbc:sqlite:/"));
     }
 
     @Test
@@ -202,7 +191,7 @@ public class ConnectionTest
         File testDB = copyToTemp("sample.db");
         assertTrue(testDB.exists());
         Connection conn = DriverManager
-                .getConnection(String.format("jdbc:sqlite::resource:%s", testDB.toURI().toURL()));
+            .getConnection(String.format("jdbc:sqlite::resource:%s", testDB.toURI().toURL()));
         Statement stat = conn.createStatement();
         ResultSet rs = stat.executeQuery("select * from coordinate");
         assertTrue(rs.next());
@@ -218,7 +207,7 @@ public class ConnectionTest
         assertTrue(testJAR.exists());
 
         Connection conn = DriverManager.getConnection(String.format("jdbc:sqlite::resource:jar:%s!/sample.db", testJAR
-                .toURI().toURL()));
+            .toURI().toURL()));
         Statement stat = conn.createStatement();
         ResultSet rs = stat.executeQuery("select * from coordinate");
         assertTrue(rs.next());
@@ -241,20 +230,22 @@ public class ConnectionTest
     public void concurrentClose() throws SQLException, InterruptedException, ExecutionException {
         final Connection conn = DriverManager.getConnection("jdbc:sqlite:");
         ResultSet[] rss = new ResultSet[512];
-        for (int i = 0; i < rss.length; i++)
+        for (int i = 0; i < rss.length; i++) {
             rss[i] = conn.prepareStatement("select null;").executeQuery();
+        }
         ExecutorService finalizer = Executors.newSingleThreadExecutor();
         try {
             ArrayList<Future<Void>> futures = new ArrayList<Future<Void>>(rss.length);
-            for (final ResultSet rs: rss)
+            for (final ResultSet rs : rss) {
                 futures.add(finalizer.submit(new Callable<Void>() {
                     public Void call() throws Exception {
                         rs.close();
                         return null;
                     }
                 }));
+            }
             conn.close();
-            for (Future<Void> f: futures) f.get();
+            for (Future<Void> f : futures) f.get();
         } finally {
             finalizer.shutdown();
         }
@@ -263,15 +254,16 @@ public class ConnectionTest
     public static File copyToTemp(String fileName) throws IOException {
         InputStream in = ConnectionTest.class.getResourceAsStream(fileName);
         File dir = new File("target");
-        if (!dir.exists())
+        if (!dir.exists()) {
             dir.mkdirs();
+        }
 
         File tmp = File.createTempFile(fileName, "", new File("target"));
         tmp.deleteOnExit();
         FileOutputStream out = new FileOutputStream(tmp);
 
         byte[] buf = new byte[8192];
-        for (int readBytes = 0; (readBytes = in.read(buf)) != -1;) {
+        for (int readBytes = 0; (readBytes = in.read(buf)) != -1; ) {
             out.write(buf, 0, readBytes);
         }
         out.flush();
@@ -318,110 +310,110 @@ public class ConnectionTest
 
     @Test
     public void setPragmasFromURI() throws Exception {
-    	 File testDB = copyToTemp("sample.db");
+        File testDB = copyToTemp("sample.db");
 
-         assertTrue(testDB.exists());
-         Connection conn = DriverManager.getConnection(String.format("jdbc:sqlite:%s?journal_mode=WAL&synchronous=OFF&journal_size_limit=500", testDB));
-         Statement stat = conn.createStatement();
+        assertTrue(testDB.exists());
+        Connection conn = DriverManager.getConnection(String.format("jdbc:sqlite:%s?journal_mode=WAL&synchronous=OFF&journal_size_limit=500", testDB));
+        Statement stat = conn.createStatement();
 
-         ResultSet rs = stat.executeQuery("pragma journal_mode");
-         assertEquals("wal", rs.getString(1));
-         rs.close();
+        ResultSet rs = stat.executeQuery("pragma journal_mode");
+        assertEquals("wal", rs.getString(1));
+        rs.close();
 
-         rs = stat.executeQuery("pragma synchronous");
-         assertEquals(false, rs.getBoolean(1));
-         rs.close();
+        rs = stat.executeQuery("pragma synchronous");
+        assertEquals(false, rs.getBoolean(1));
+        rs.close();
 
-         rs = stat.executeQuery("pragma journal_size_limit");
-         assertEquals(500, rs.getInt(1));
-         rs.close();
+        rs = stat.executeQuery("pragma journal_size_limit");
+        assertEquals(500, rs.getInt(1));
+        rs.close();
 
-         stat.close();
-         conn.close();
+        stat.close();
+        conn.close();
     }
 
-    @Test(expected = SQLException.class)
-    public void limits() throws Exception{
+    @Test
+    public void limits() throws Exception {
         File testDB = copyToTemp("sample.db");
 
         assertTrue(testDB.exists());
         Connection conn = DriverManager.getConnection(String.format("jdbc:sqlite:%s?limit_attached=0", testDB));
         Statement stat = conn.createStatement();
 
-        stat.executeUpdate("ATTACH DATABASE attach_test.db AS attachDb");
+        assertThrows(SQLException.class, () -> stat.executeUpdate("ATTACH DATABASE attach_test.db AS attachDb"));
 
         stat.close();
     }
 
     @Test
     public void ignoreUnknownParametersInURI() throws Exception {
-    	Connection conn = DriverManager.getConnection("jdbc:sqlite:file::memory:?cache=shared&foreign_keys=ON&debug=&invalid");
-    	Statement stat = conn.createStatement();
+        Connection conn = DriverManager.getConnection("jdbc:sqlite:file::memory:?cache=shared&foreign_keys=ON&debug=&invalid");
+        Statement stat = conn.createStatement();
 
-    	ResultSet rs = stat.executeQuery("pragma foreign_keys");
-    	assertEquals(true, rs.getBoolean(1));
-    	rs.close();
+        ResultSet rs = stat.executeQuery("pragma foreign_keys");
+        assertEquals(true, rs.getBoolean(1));
+        rs.close();
 
-    	stat.close();
-    	conn.close();
+        stat.close();
+        conn.close();
     }
 
-    @Test(expected = SQLException.class)
-    public void errorOnEmptyPragmaValueInURI() throws Exception {
-   		DriverManager.getConnection("jdbc:sqlite:file::memory:?journal_mode=&synchronous=");
+    @Test
+    public void errorOnEmptyPragmaValueInURI() {
+        assertThrows(SQLException.class, () -> DriverManager.getConnection("jdbc:sqlite:file::memory:?journal_mode=&synchronous="));
     }
 
     @Test
     public void ignoreDoubleAmpersandsInURI() throws Exception {
-    	File testDB = copyToTemp("sample.db");
+        File testDB = copyToTemp("sample.db");
 
-    	assertTrue(testDB.exists());
-    	Connection conn = DriverManager.getConnection(String.format("jdbc:sqlite:%s?synchronous=OFF&&&&journal_mode=WAL", testDB));
-    	Statement stat = conn.createStatement();
+        assertTrue(testDB.exists());
+        Connection conn = DriverManager.getConnection(String.format("jdbc:sqlite:%s?synchronous=OFF&&&&journal_mode=WAL", testDB));
+        Statement stat = conn.createStatement();
 
-    	ResultSet rs = stat.executeQuery("pragma journal_mode");
-    	assertEquals("wal", rs.getString(1));
-    	rs.close();
+        ResultSet rs = stat.executeQuery("pragma journal_mode");
+        assertEquals("wal", rs.getString(1));
+        rs.close();
 
-    	rs = stat.executeQuery("pragma synchronous");
-    	assertEquals(false, rs.getBoolean(1));
-    	rs.close();
+        rs = stat.executeQuery("pragma synchronous");
+        assertEquals(false, rs.getBoolean(1));
+        rs.close();
 
-    	stat.close();
-    	conn.close();
+        stat.close();
+        conn.close();
     }
 
     @Test
     public void useLastSpecifiedPragmaValueInURI() throws Exception {
-    	File testDB = copyToTemp("sample.db");
+        File testDB = copyToTemp("sample.db");
 
-    	assertTrue(testDB.exists());
-    	Connection conn = DriverManager.getConnection(String.format("jdbc:sqlite:%s?journal_mode=WAL&journal_mode=MEMORY&journal_mode=TRUNCATE", testDB));
-    	Statement stat = conn.createStatement();
+        assertTrue(testDB.exists());
+        Connection conn = DriverManager.getConnection(String.format("jdbc:sqlite:%s?journal_mode=WAL&journal_mode=MEMORY&journal_mode=TRUNCATE", testDB));
+        Statement stat = conn.createStatement();
 
-    	ResultSet rs = stat.executeQuery("pragma journal_mode");
-    	assertEquals("truncate", rs.getString(1));
-    	rs.close();
+        ResultSet rs = stat.executeQuery("pragma journal_mode");
+        assertEquals("truncate", rs.getString(1));
+        rs.close();
 
-    	stat.close();
-    	conn.close();
+        stat.close();
+        conn.close();
     }
 
     @Test
     public void overrideURIPragmaValuesWithProperties() throws Exception {
-    	File testDB = copyToTemp("sample.db");
+        File testDB = copyToTemp("sample.db");
 
-    	assertTrue(testDB.exists());
-    	Properties props = new Properties();
-    	props.setProperty(Pragma.JOURNAL_MODE.pragmaName, JournalMode.TRUNCATE.name());
-    	Connection conn = DriverManager.getConnection(String.format("jdbc:sqlite:%s?journal_mode=WAL", testDB), props);
-    	Statement stat = conn.createStatement();
+        assertTrue(testDB.exists());
+        Properties props = new Properties();
+        props.setProperty(Pragma.JOURNAL_MODE.pragmaName, JournalMode.TRUNCATE.name());
+        Connection conn = DriverManager.getConnection(String.format("jdbc:sqlite:%s?journal_mode=WAL", testDB), props);
+        Statement stat = conn.createStatement();
 
-    	ResultSet rs = stat.executeQuery("pragma journal_mode");
-    	assertEquals("truncate", rs.getString(1));
-    	rs.close();
+        ResultSet rs = stat.executeQuery("pragma journal_mode");
+        assertEquals("truncate", rs.getString(1));
+        rs.close();
 
-    	stat.close();
-    	conn.close();
+        stat.close();
+        conn.close();
     }
 }
diff --git a/src/test/java/org/sqlite/DBMetaDataTest.java b/src/test/java/org/sqlite/DBMetaDataTest.java
index 7933a013..10635f7b 100644
--- a/src/test/java/org/sqlite/DBMetaDataTest.java
+++ b/src/test/java/org/sqlite/DBMetaDataTest.java
@@ -1,9 +1,8 @@
 package org.sqlite;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 import java.io.File;
 import java.io.FileReader;
@@ -20,18 +19,20 @@ import java.util.HashMap;
 import java.util.Map;
 import java.util.Properties;
 
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-/** These tests are designed to stress Statements on memory databases. */
-public class DBMetaDataTest
-{
-    private Connection       conn;
-    private Statement        stat;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+/**
+ * These tests are designed to stress Statements on memory databases.
+ */
+public class DBMetaDataTest {
+    private Connection conn;
+    private Statement stat;
     private DatabaseMetaData meta;
 
-    @Before
+    @BeforeEach
     public void connect() throws Exception {
         conn = DriverManager.getConnection("jdbc:sqlite:");
         stat = conn.createStatement();
@@ -40,7 +41,7 @@ public class DBMetaDataTest
         meta = conn.getMetaData();
     }
 
-    @After
+    @AfterEach
     public void close() throws SQLException {
         meta = null;
         stat.close();
@@ -75,13 +76,13 @@ public class DBMetaDataTest
         assertTrue(rs.next());
         rs.close();
 
-        rs = meta.getTables(null, null, null, new String[] { "table" });
+        rs = meta.getTables(null, null, null, new String[] {"table"});
         assertTrue(rs.next());
         assertEquals(rs.getString("TABLE_NAME"), "test");
         assertFalse(rs.next());
         rs.close();
 
-        rs = meta.getTables(null, null, null, new String[] { "view" });
+        rs = meta.getTables(null, null, null, new String[] {"view"});
         assertTrue(rs.next());
         assertEquals(rs.getString("TABLE_NAME"), "testView");
         assertFalse(rs.next());
@@ -95,7 +96,7 @@ public class DBMetaDataTest
         assertTrue(rs.next());
         assertEquals(rs.getString("TABLE_TYPE"), "GLOBAL TEMPORARY");
         assertTrue(rs.next());
-        assertEquals(rs.getString("TABLE_TYPE"), "SYSTEM TABLE");        
+        assertEquals(rs.getString("TABLE_TYPE"), "SYSTEM TABLE");
         assertTrue(rs.next());
         assertEquals(rs.getString("TABLE_TYPE"), "TABLE");
         assertTrue(rs.next());
@@ -316,14 +317,14 @@ public class DBMetaDataTest
     @Test
     public void getExportedKeysColsForNamedKeys() throws SQLException {
 
-    	ResultSet exportedKeys;
+        ResultSet exportedKeys;
 
-    	// 1. Check for named primary keys
-    	// SQL is deliberately in uppercase, to make sure case-sensitivity is maintained
+        // 1. Check for named primary keys
+        // SQL is deliberately in uppercase, to make sure case-sensitivity is maintained
         stat.executeUpdate("CREATE TABLE PARENT1 (ID1 INTEGER, DATA1 INTEGER, CONSTRAINT PK_PARENT PRIMARY KEY (ID1))");
         stat.executeUpdate("CREATE TABLE CHILD1 (ID1 INTEGER, DATA2 INTEGER, FOREIGN KEY(ID1) REFERENCES PARENT1(ID1))");
 
-		exportedKeys = meta.getExportedKeys(null, null, "PARENT1");
+        exportedKeys = meta.getExportedKeys(null, null, "PARENT1");
 
         assertTrue(exportedKeys.next());
         assertEquals("PARENT1", exportedKeys.getString("PKTABLE_NAME"));
@@ -336,13 +337,13 @@ public class DBMetaDataTest
         assertFalse(exportedKeys.next());
 
         exportedKeys.close();
-        
-    	// 2. Check for named foreign keys
-    	// SQL is deliberately in mixed case, to make sure case-sensitivity is maintained
+
+        // 2. Check for named foreign keys
+        // SQL is deliberately in mixed case, to make sure case-sensitivity is maintained
         stat.executeUpdate("CREATE TABLE Parent2 (Id1 INTEGER, DATA1 INTEGER, PRIMARY KEY (Id1))");
         stat.executeUpdate("CREATE TABLE Child2 (Id1 INTEGER, DATA2 INTEGER, CONSTRAINT FK_Child2 FOREIGN KEY(Id1) REFERENCES Parent2(Id1))");
 
-		exportedKeys = meta.getExportedKeys(null, null, "Parent2");
+        exportedKeys = meta.getExportedKeys(null, null, "Parent2");
 
         assertTrue(exportedKeys.next());
         assertEquals("Parent2", exportedKeys.getString("PKTABLE_NAME"));
@@ -357,15 +358,18 @@ public class DBMetaDataTest
         exportedKeys.close();
     }
 
-    @Test 
-    public void getImportedKeysMultipleColumns()throws SQLException{
-    	ResultSet importedKeys;
-    	stat.executeUpdate("CREATE TABLE PONE ( ID_FIRST_ONE INTEGER NOT NULL, ID_SECOND_ONE INTEGER NOT NULL, ADDITIONAL_ONE TEXT, CONSTRAINT PONE_PK PRIMARY KEY (ID_FIRST_ONE, ID_SECOND_ONE) )");
-    	stat.executeUpdate("CREATE TABLE PTWO ( ID_FIRST_TWO INTEGER NOT NULL, ID_SECOND_TWO INTEGER NOT NULL, ADDITIONAL_TWO TEXT, CONSTRAINT PTWO_PK PRIMARY KEY (ID_FIRST_TWO, ID_SECOND_TWO) )");
-    	stat.executeUpdate("CREATE TABLE CHILD ( ID_CHILD INTEGER NOT NULL, ID_CHILD_TO_ONE INTEGER NOT NULL, ID_CHILD_TO_TWO INTEGER NOT NULL, CONSTRAINT CHILD_PK PRIMARY KEY (ID_CHILD, ID_CHILD_TO_ONE), CONSTRAINT PONE_FK01 FOREIGN KEY (ID_CHILD, ID_CHILD_TO_ONE) REFERENCES PONE (ID_FIRST_ONE, ID_SECOND_ONE) ON DELETE CASCADE, CONSTRAINT PTWO_FK02 FOREIGN KEY (ID_CHILD, ID_CHILD_TO_TWO) REFERENCES PTWO (ID_FIRST_TWO, ID_SECOND_TWO) )");
-    	
-		importedKeys = meta.getImportedKeys(null, null, "CHILD");
-		
+    @Test
+    public void getImportedKeysMultipleColumns() throws SQLException {
+        ResultSet importedKeys;
+        stat.executeUpdate(
+            "CREATE TABLE PONE ( ID_FIRST_ONE INTEGER NOT NULL, ID_SECOND_ONE INTEGER NOT NULL, ADDITIONAL_ONE TEXT, CONSTRAINT PONE_PK PRIMARY KEY (ID_FIRST_ONE, ID_SECOND_ONE) )");
+        stat.executeUpdate(
+            "CREATE TABLE PTWO ( ID_FIRST_TWO INTEGER NOT NULL, ID_SECOND_TWO INTEGER NOT NULL, ADDITIONAL_TWO TEXT, CONSTRAINT PTWO_PK PRIMARY KEY (ID_FIRST_TWO, ID_SECOND_TWO) )");
+        stat.executeUpdate(
+            "CREATE TABLE CHILD ( ID_CHILD INTEGER NOT NULL, ID_CHILD_TO_ONE INTEGER NOT NULL, ID_CHILD_TO_TWO INTEGER NOT NULL, CONSTRAINT CHILD_PK PRIMARY KEY (ID_CHILD, ID_CHILD_TO_ONE), CONSTRAINT PONE_FK01 FOREIGN KEY (ID_CHILD, ID_CHILD_TO_ONE) REFERENCES PONE (ID_FIRST_ONE, ID_SECOND_ONE) ON DELETE CASCADE, CONSTRAINT PTWO_FK02 FOREIGN KEY (ID_CHILD, ID_CHILD_TO_TWO) REFERENCES PTWO (ID_FIRST_TWO, ID_SECOND_TWO) )");
+
+        importedKeys = meta.getImportedKeys(null, null, "CHILD");
+
         assertTrue(importedKeys.next());
         assertEquals("PONE", importedKeys.getString("PKTABLE_NAME"));
         assertEquals("ID_FIRST_ONE", importedKeys.getString("PKCOLUMN_NAME"));
@@ -373,7 +377,7 @@ public class DBMetaDataTest
         assertEquals("PONE_FK01", importedKeys.getString("FK_NAME"));
         assertEquals("CHILD", importedKeys.getString("FKTABLE_NAME"));
         assertEquals("ID_CHILD", importedKeys.getString("FKCOLUMN_NAME"));
-        
+
         assertTrue(importedKeys.next());
         assertEquals("PONE", importedKeys.getString("PKTABLE_NAME"));
         assertEquals("ID_SECOND_ONE", importedKeys.getString("PKCOLUMN_NAME"));
@@ -401,17 +405,18 @@ public class DBMetaDataTest
         assertFalse(importedKeys.next());
         importedKeys.close();
     }
+
     @Test
     public void getImportedKeysColsForNamedKeys() throws SQLException {
 
-    	ResultSet importedKeys;
+        ResultSet importedKeys;
 
-    	// 1. Check for named primary keys
-    	// SQL is deliberately in uppercase, to make sure case-sensitivity is maintained
+        // 1. Check for named primary keys
+        // SQL is deliberately in uppercase, to make sure case-sensitivity is maintained
         stat.executeUpdate("CREATE TABLE PARENT1 (ID1 INTEGER, DATA1 INTEGER, CONSTRAINT PK_PARENT PRIMARY KEY (ID1))");
         stat.executeUpdate("CREATE TABLE CHILD1 (ID1 INTEGER, DATA2 INTEGER, FOREIGN KEY(ID1) REFERENCES PARENT1(ID1))");
 
-		importedKeys = meta.getImportedKeys(null, null, "CHILD1");
+        importedKeys = meta.getImportedKeys(null, null, "CHILD1");
 
         assertTrue(importedKeys.next());
         assertEquals("PARENT1", importedKeys.getString("PKTABLE_NAME"));
@@ -424,14 +429,14 @@ public class DBMetaDataTest
         assertFalse(importedKeys.next());
 
         importedKeys.close();
-        
-    	// 2. Check for named foreign keys
-    	// SQL is deliberately in mixed case, to make sure case-sensitivity is maintained
+
+        // 2. Check for named foreign keys
+        // SQL is deliberately in mixed case, to make sure case-sensitivity is maintained
         stat.executeUpdate("CREATE TABLE Parent2 (Id1 INTEGER, DATA1 INTEGER, PRIMARY KEY (Id1))");
         stat.executeUpdate("CREATE TABLE Child2 (Id1 INTEGER, DATA2 INTEGER, "
-        		+ "CONSTRAINT FK_Child2 FOREIGN KEY(Id1) REFERENCES Parent2(Id1))");
+            + "CONSTRAINT FK_Child2 FOREIGN KEY(Id1) REFERENCES Parent2(Id1))");
 
-		importedKeys = meta.getImportedKeys(null, null, "Child2");
+        importedKeys = meta.getImportedKeys(null, null, "Child2");
 
         assertTrue(importedKeys.next());
         assertEquals("Parent2", importedKeys.getString("PKTABLE_NAME"));
@@ -445,18 +450,18 @@ public class DBMetaDataTest
 
         importedKeys.close();
     }
-    
+
     @Test
     public void getImportedKeysColsForMixedCaseDefinition() throws SQLException {
 
-    	ResultSet importedKeys;
+        ResultSet importedKeys;
 
-    	// SQL is deliberately in mixed-case, to make sure case-sensitivity is maintained
+        // SQL is deliberately in mixed-case, to make sure case-sensitivity is maintained
         stat.executeUpdate("CREATE TABLE PARENT1 (ID1 INTEGER, DATA1 INTEGER, CONSTRAINT PK_PARENT PRIMARY KEY (ID1))");
         stat.executeUpdate("CREATE TABLE CHILD1 (ID1 INTEGER, DATA2 INTEGER, "
-        		+ "CONSTRAINT FK_Parent1 FOREIGN KEY(ID1) REFERENCES Parent1(Id1))");
+            + "CONSTRAINT FK_Parent1 FOREIGN KEY(ID1) REFERENCES Parent1(Id1))");
 
-		importedKeys = meta.getImportedKeys(null, null, "CHILD1");
+        importedKeys = meta.getImportedKeys(null, null, "CHILD1");
 
         assertTrue(importedKeys.next());
         assertEquals("Parent1", importedKeys.getString("PKTABLE_NAME"));
@@ -468,21 +473,21 @@ public class DBMetaDataTest
 
         assertFalse(importedKeys.next());
 
-        importedKeys.close();    
+        importedKeys.close();
     }
-    
+
     @Test
     public void getImportedKeysColsForMultipleImports() throws SQLException {
 
-    	ResultSet importedKeys;
+        ResultSet importedKeys;
 
-    	stat.executeUpdate("CREATE TABLE PARENT1 (ID1 INTEGER, DATA1 INTEGER, CONSTRAINT PK_PARENT1 PRIMARY KEY (ID1))");
-    	stat.executeUpdate("CREATE TABLE PARENT2 (ID2 INTEGER, DATA2 INTEGER, CONSTRAINT PK_PARENT2 PRIMARY KEY (ID2))");
-    	stat.executeUpdate("CREATE TABLE CHILD1 (ID1 INTEGER, ID2 INTEGER, "
-    			+ "CONSTRAINT FK_PARENT1 FOREIGN KEY(ID1) REFERENCES PARENT1(ID1), "
-    			+ "CONSTRAINT FK_PARENT2 FOREIGN KEY(ID2) REFERENCES PARENT2(ID2))");
+        stat.executeUpdate("CREATE TABLE PARENT1 (ID1 INTEGER, DATA1 INTEGER, CONSTRAINT PK_PARENT1 PRIMARY KEY (ID1))");
+        stat.executeUpdate("CREATE TABLE PARENT2 (ID2 INTEGER, DATA2 INTEGER, CONSTRAINT PK_PARENT2 PRIMARY KEY (ID2))");
+        stat.executeUpdate("CREATE TABLE CHILD1 (ID1 INTEGER, ID2 INTEGER, "
+            + "CONSTRAINT FK_PARENT1 FOREIGN KEY(ID1) REFERENCES PARENT1(ID1), "
+            + "CONSTRAINT FK_PARENT2 FOREIGN KEY(ID2) REFERENCES PARENT2(ID2))");
 
-		importedKeys = meta.getImportedKeys(null, null, "CHILD1");
+        importedKeys = meta.getImportedKeys(null, null, "CHILD1");
 
         assertTrue(importedKeys.next());
         assertEquals("PARENT1", importedKeys.getString("PKTABLE_NAME"));
@@ -491,7 +496,7 @@ public class DBMetaDataTest
         assertEquals("FK_PARENT1", importedKeys.getString("FK_NAME"));
         assertEquals("CHILD1", importedKeys.getString("FKTABLE_NAME"));
         assertEquals("ID1", importedKeys.getString("FKCOLUMN_NAME"));
-        
+
         assertTrue(importedKeys.next());
         assertEquals("PARENT2", importedKeys.getString("PKTABLE_NAME"));
         assertEquals("ID2", importedKeys.getString("PKCOLUMN_NAME"));
@@ -499,19 +504,19 @@ public class DBMetaDataTest
         assertEquals("FK_PARENT2", importedKeys.getString("FK_NAME"));
         assertEquals("CHILD1", importedKeys.getString("FKTABLE_NAME"));
         assertEquals("ID2", importedKeys.getString("FKCOLUMN_NAME"));
-        
+
         assertFalse(importedKeys.next());
 
-        importedKeys.close();    
-        
+        importedKeys.close();
+
         // Unnamed foreign keys and unnamed primary keys
-    	stat.executeUpdate("CREATE TABLE PARENT3 (ID3 INTEGER, DATA3 INTEGER, PRIMARY KEY (ID3))");
-    	stat.executeUpdate("CREATE TABLE PARENT4 (ID4 INTEGER, DATA4 INTEGER, CONSTRAINT PK_PARENT4 PRIMARY KEY (ID4))");
-    	stat.executeUpdate("CREATE TABLE CHILD2 (ID3 INTEGER, ID4 INTEGER, "
-    			+ "FOREIGN KEY(ID3) REFERENCES PARENT3(ID3), "
-    			+ "CONSTRAINT FK_PARENT4 FOREIGN KEY(ID4) REFERENCES PARENT4(ID4))");
+        stat.executeUpdate("CREATE TABLE PARENT3 (ID3 INTEGER, DATA3 INTEGER, PRIMARY KEY (ID3))");
+        stat.executeUpdate("CREATE TABLE PARENT4 (ID4 INTEGER, DATA4 INTEGER, CONSTRAINT PK_PARENT4 PRIMARY KEY (ID4))");
+        stat.executeUpdate("CREATE TABLE CHILD2 (ID3 INTEGER, ID4 INTEGER, "
+            + "FOREIGN KEY(ID3) REFERENCES PARENT3(ID3), "
+            + "CONSTRAINT FK_PARENT4 FOREIGN KEY(ID4) REFERENCES PARENT4(ID4))");
 
-		importedKeys = meta.getImportedKeys(null, null, "CHILD2");
+        importedKeys = meta.getImportedKeys(null, null, "CHILD2");
 
         assertTrue(importedKeys.next());
         assertEquals("PARENT3", importedKeys.getString("PKTABLE_NAME"));
@@ -520,7 +525,7 @@ public class DBMetaDataTest
         assertEquals("", importedKeys.getString("FK_NAME"));
         assertEquals("CHILD2", importedKeys.getString("FKTABLE_NAME"));
         assertEquals("ID3", importedKeys.getString("FKCOLUMN_NAME"));
-        
+
         assertTrue(importedKeys.next());
         assertEquals("PARENT4", importedKeys.getString("PKTABLE_NAME"));
         assertEquals("ID4", importedKeys.getString("PKCOLUMN_NAME"));
@@ -528,28 +533,28 @@ public class DBMetaDataTest
         assertEquals("FK_PARENT4", importedKeys.getString("FK_NAME"));
         assertEquals("CHILD2", importedKeys.getString("FKTABLE_NAME"));
         assertEquals("ID4", importedKeys.getString("FKCOLUMN_NAME"));
-        
+
         assertFalse(importedKeys.next());
 
-        importedKeys.close();   
+        importedKeys.close();
     }
-    
+
     @Test
     public void getImportedKeysCols2() throws SQLException {
 
-    	stat.executeUpdate("CREATE TABLE Authors (Id INTEGER NOT NULL, Name VARCHAR(20) NOT NULL, "
-    			+ "CONSTRAINT PK_Authors PRIMARY KEY (Id)," + 
-    			"  CONSTRAINT CHECK_UPPERCASE_Name CHECK (Name=UPPER(Name)))");
-    	stat.executeUpdate("CREATE TABLE Books (Id INTEGER NOT NULL, Title VARCHAR(255) NOT NULL, PreviousEditionId INTEGER,"
-    			+ "CONSTRAINT PK_Books PRIMARY KEY (Id), "
-    			+ "CONSTRAINT FK_PreviousEdition FOREIGN KEY(PreviousEditionId) REFERENCES Books (Id))");
-    	stat.executeUpdate("CREATE TABLE BookAuthors (BookId INTEGER NOT NULL, AuthorId INTEGER NOT NULL, "
-    			+ "CONSTRAINT FK_Y_Book FOREIGN KEY (BookId) REFERENCES Books (Id), "
-    			+ "CONSTRAINT FK_Z_Author FOREIGN KEY (AuthorId) REFERENCES Authors (Id)) ");
+        stat.executeUpdate("CREATE TABLE Authors (Id INTEGER NOT NULL, Name VARCHAR(20) NOT NULL, "
+            + "CONSTRAINT PK_Authors PRIMARY KEY (Id)," +
+            "  CONSTRAINT CHECK_UPPERCASE_Name CHECK (Name=UPPER(Name)))");
+        stat.executeUpdate("CREATE TABLE Books (Id INTEGER NOT NULL, Title VARCHAR(255) NOT NULL, PreviousEditionId INTEGER,"
+            + "CONSTRAINT PK_Books PRIMARY KEY (Id), "
+            + "CONSTRAINT FK_PreviousEdition FOREIGN KEY(PreviousEditionId) REFERENCES Books (Id))");
+        stat.executeUpdate("CREATE TABLE BookAuthors (BookId INTEGER NOT NULL, AuthorId INTEGER NOT NULL, "
+            + "CONSTRAINT FK_Y_Book FOREIGN KEY (BookId) REFERENCES Books (Id), "
+            + "CONSTRAINT FK_Z_Author FOREIGN KEY (AuthorId) REFERENCES Authors (Id)) ");
+
+        ResultSet importedKeys;
 
-    	ResultSet importedKeys;
-    	
-		importedKeys = meta.getImportedKeys(null, null, "BookAuthors");
+        importedKeys = meta.getImportedKeys(null, null, "BookAuthors");
 
         assertTrue(importedKeys.next());
         assertEquals("Authors", importedKeys.getString("PKTABLE_NAME"));
@@ -558,7 +563,7 @@ public class DBMetaDataTest
         assertEquals("FK_Z_Author", importedKeys.getString("FK_NAME"));
         assertEquals("BookAuthors", importedKeys.getString("FKTABLE_NAME"));
         assertEquals("AuthorId", importedKeys.getString("FKCOLUMN_NAME"));
-        
+
         assertTrue(importedKeys.next());
         assertEquals("Books", importedKeys.getString("PKTABLE_NAME"));
         assertEquals("Id", importedKeys.getString("PKCOLUMN_NAME"));
@@ -566,61 +571,61 @@ public class DBMetaDataTest
         assertEquals("FK_Y_Book", importedKeys.getString("FK_NAME"));
         assertEquals("BookAuthors", importedKeys.getString("FKTABLE_NAME"));
         assertEquals("BookId", importedKeys.getString("FKCOLUMN_NAME"));
-        
+
         assertFalse(importedKeys.next());
 
-        importedKeys.close();  
-	
+        importedKeys.close();
+
 
         ResultSet exportedKeys;
 
-		exportedKeys = meta.getExportedKeys(null, null, "Authors");
-
-		assertTrue(exportedKeys.next());
-		assertEquals("Authors", exportedKeys.getString("PKTABLE_NAME"));
-		assertEquals("Id", exportedKeys.getString("PKCOLUMN_NAME"));
-		assertEquals("PK_Authors", exportedKeys.getString("PK_NAME"));
-		assertEquals("FK_Z_Author", exportedKeys.getString("FK_NAME"));
-		assertEquals("BookAuthors", exportedKeys.getString("FKTABLE_NAME"));
-		assertEquals("AuthorId", exportedKeys.getString("FKCOLUMN_NAME"));
-
-		assertFalse(exportedKeys.next());
-
-		exportedKeys.close(); 
-
-		exportedKeys = meta.getExportedKeys(null, null, "Books");
-
-		assertTrue(exportedKeys.next());
-		assertEquals("Books", exportedKeys.getString("PKTABLE_NAME"));
-		assertEquals("Id", exportedKeys.getString("PKCOLUMN_NAME"));
-		assertEquals("PK_Books", exportedKeys.getString("PK_NAME"));
-		assertEquals("FK_Y_Book", exportedKeys.getString("FK_NAME"));
-		assertEquals("BookAuthors", exportedKeys.getString("FKTABLE_NAME"));
-		assertEquals("BookId", exportedKeys.getString("FKCOLUMN_NAME"));
-		
-		assertTrue(exportedKeys.next());
-		assertEquals("Books", exportedKeys.getString("PKTABLE_NAME"));
-		assertEquals("Id", exportedKeys.getString("PKCOLUMN_NAME"));
-		assertEquals("PK_Books", exportedKeys.getString("PK_NAME"));
-		assertEquals("FK_PreviousEdition", exportedKeys.getString("FK_NAME")); // ???
-		assertEquals("Books", exportedKeys.getString("FKTABLE_NAME"));
-		assertEquals("PreviousEditionId", exportedKeys.getString("FKCOLUMN_NAME"));
-		
-		assertFalse(exportedKeys.next());
-
-		exportedKeys.close();  
+        exportedKeys = meta.getExportedKeys(null, null, "Authors");
+
+        assertTrue(exportedKeys.next());
+        assertEquals("Authors", exportedKeys.getString("PKTABLE_NAME"));
+        assertEquals("Id", exportedKeys.getString("PKCOLUMN_NAME"));
+        assertEquals("PK_Authors", exportedKeys.getString("PK_NAME"));
+        assertEquals("FK_Z_Author", exportedKeys.getString("FK_NAME"));
+        assertEquals("BookAuthors", exportedKeys.getString("FKTABLE_NAME"));
+        assertEquals("AuthorId", exportedKeys.getString("FKCOLUMN_NAME"));
+
+        assertFalse(exportedKeys.next());
+
+        exportedKeys.close();
+
+        exportedKeys = meta.getExportedKeys(null, null, "Books");
+
+        assertTrue(exportedKeys.next());
+        assertEquals("Books", exportedKeys.getString("PKTABLE_NAME"));
+        assertEquals("Id", exportedKeys.getString("PKCOLUMN_NAME"));
+        assertEquals("PK_Books", exportedKeys.getString("PK_NAME"));
+        assertEquals("FK_Y_Book", exportedKeys.getString("FK_NAME"));
+        assertEquals("BookAuthors", exportedKeys.getString("FKTABLE_NAME"));
+        assertEquals("BookId", exportedKeys.getString("FKCOLUMN_NAME"));
+
+        assertTrue(exportedKeys.next());
+        assertEquals("Books", exportedKeys.getString("PKTABLE_NAME"));
+        assertEquals("Id", exportedKeys.getString("PKCOLUMN_NAME"));
+        assertEquals("PK_Books", exportedKeys.getString("PK_NAME"));
+        assertEquals("FK_PreviousEdition", exportedKeys.getString("FK_NAME")); // ???
+        assertEquals("Books", exportedKeys.getString("FKTABLE_NAME"));
+        assertEquals("PreviousEditionId", exportedKeys.getString("FKCOLUMN_NAME"));
+
+        assertFalse(exportedKeys.next());
+
+        exportedKeys.close();
     }
-    
+
     @Test
     public void getExportedKeysColsForMultipleImports() throws SQLException {
 
-    	ResultSet exportedKeys;
+        ResultSet exportedKeys;
 
-    	stat.executeUpdate("CREATE TABLE PARENT1 (ID1 INTEGER, ID2 INTEGER, CONSTRAINT PK_PARENT1 PRIMARY KEY (ID1))");
-    	stat.executeUpdate("CREATE TABLE CHILD1 (ID1 INTEGER, CONSTRAINT FK_PARENT1 FOREIGN KEY(ID1) REFERENCES PARENT1(ID1))");
-    	stat.executeUpdate("CREATE TABLE CHILD2 (ID2 INTEGER, CONSTRAINT FK_PARENT2 FOREIGN KEY(ID2) REFERENCES PARENT1(ID2))");
+        stat.executeUpdate("CREATE TABLE PARENT1 (ID1 INTEGER, ID2 INTEGER, CONSTRAINT PK_PARENT1 PRIMARY KEY (ID1))");
+        stat.executeUpdate("CREATE TABLE CHILD1 (ID1 INTEGER, CONSTRAINT FK_PARENT1 FOREIGN KEY(ID1) REFERENCES PARENT1(ID1))");
+        stat.executeUpdate("CREATE TABLE CHILD2 (ID2 INTEGER, CONSTRAINT FK_PARENT2 FOREIGN KEY(ID2) REFERENCES PARENT1(ID2))");
 
-		exportedKeys = meta.getExportedKeys(null, null, "PARENT1");
+        exportedKeys = meta.getExportedKeys(null, null, "PARENT1");
 
         assertTrue(exportedKeys.next());
         assertEquals("PARENT1", exportedKeys.getString("PKTABLE_NAME"));
@@ -629,7 +634,7 @@ public class DBMetaDataTest
         assertEquals("FK_PARENT1", exportedKeys.getString("FK_NAME"));
         assertEquals("CHILD1", exportedKeys.getString("FKTABLE_NAME"));
         assertEquals("ID1", exportedKeys.getString("FKCOLUMN_NAME"));
-        
+
         assertTrue(exportedKeys.next());
         assertEquals("PARENT1", exportedKeys.getString("PKTABLE_NAME"));
         assertEquals("ID2", exportedKeys.getString("PKCOLUMN_NAME"));
@@ -637,24 +642,24 @@ public class DBMetaDataTest
         assertEquals("FK_PARENT2", exportedKeys.getString("FK_NAME"));
         assertEquals("CHILD2", exportedKeys.getString("FKTABLE_NAME"));
         assertEquals("ID2", exportedKeys.getString("FKCOLUMN_NAME"));
-        
+
         assertFalse(exportedKeys.next());
 
-        exportedKeys.close();    
+        exportedKeys.close();
     }
-    
+
     @Test
     public void columnOrderOfgetTables() throws SQLException {
-    	
-    	stat.executeUpdate("CREATE TABLE TABLE1 (ID1 INTEGER PRIMARY KEY AUTOINCREMENT, ID2 INTEGER)");
-    	stat.executeUpdate("CREATE TABLE TABLE2 (ID2 INTEGER, DATA2 VARCHAR(20))");
-    	stat.executeUpdate("CREATE TEMP TABLE TABLE3 (ID3 INTEGER, DATA3 VARCHAR(20))");
-    	stat.executeUpdate("CREATE VIEW VIEW1 (V1, V2) AS SELECT ID1, ID2 FROM TABLE1");
-    	
+
+        stat.executeUpdate("CREATE TABLE TABLE1 (ID1 INTEGER PRIMARY KEY AUTOINCREMENT, ID2 INTEGER)");
+        stat.executeUpdate("CREATE TABLE TABLE2 (ID2 INTEGER, DATA2 VARCHAR(20))");
+        stat.executeUpdate("CREATE TEMP TABLE TABLE3 (ID3 INTEGER, DATA3 VARCHAR(20))");
+        stat.executeUpdate("CREATE VIEW VIEW1 (V1, V2) AS SELECT ID1, ID2 FROM TABLE1");
+
         ResultSet rsTables = meta.getTables(null, null, null, new String[] {"TABLE", "VIEW", "GLOBAL TEMPORARY", "SYSTEM TABLE"});
-        
+
         assertTrue(rsTables.next());
-        
+
         // Check order of columns
         ResultSetMetaData rsmeta = rsTables.getMetaData();
         assertEquals(rsmeta.getColumnCount(), 10);
@@ -668,14 +673,14 @@ public class DBMetaDataTest
         assertEquals(rsmeta.getColumnName(8), "TYPE_NAME");
         assertEquals(rsmeta.getColumnName(9), "SELF_REFERENCING_COL_NAME");
         assertEquals(rsmeta.getColumnName(10), "REF_GENERATION");
-        
+
         assertEquals("TABLE3", rsTables.getString("TABLE_NAME"));
         assertEquals("GLOBAL TEMPORARY", rsTables.getString("TABLE_TYPE"));
-        
+
         assertTrue(rsTables.next());
         assertEquals("sqlite_sequence", rsTables.getString("TABLE_NAME"));
         assertEquals("SYSTEM TABLE", rsTables.getString("TABLE_TYPE"));
-        
+
         assertTrue(rsTables.next());
         assertEquals("TABLE1", rsTables.getString("TABLE_NAME"));
         assertEquals("TABLE", rsTables.getString("TABLE_TYPE"));
@@ -688,8 +693,8 @@ public class DBMetaDataTest
         assertTrue(rsTables.next());
         assertEquals("VIEW1", rsTables.getString("TABLE_NAME"));
         assertEquals("VIEW", rsTables.getString("TABLE_TYPE"));
-                
-        rsTables.close();    
+
+        rsTables.close();
     }
 
     @Test
@@ -892,7 +897,7 @@ public class DBMetaDataTest
         rs = meta.getPrimaryKeys(null, null, "view_nopk");
         assertFalse(rs.next());
     }
-    
+
     @Test
     public void moreOfgetColumns() throws SQLException {
         ResultSet rs;
@@ -902,7 +907,7 @@ public class DBMetaDataTest
         stat.executeUpdate("CREATE TABLE TabCols2 (Col1, Col2);");
         // quoted table, column and primary key names
         stat.executeUpdate("CREATE TABLE `TabCols3` (`Col1`, `Col2`);");
-        
+
         rs = meta.getColumns(null, null, "tabcols1", "%");
         assertTrue(rs.next());
         assertEquals(rs.getString("TABLE_NAME"), "tabcols1");
@@ -916,7 +921,7 @@ public class DBMetaDataTest
         assertEquals(rs.getString("COLUMN_NAME"), "col2");
         assertEquals(rs.getInt("DATA_TYPE"), Types.VARCHAR);
         assertFalse(rs.next());
-        
+
         rs = meta.getColumns(null, null, "TabCols2", "%");
         assertTrue(rs.next());
         assertEquals(rs.getString("TABLE_NAME"), "TabCols2");
@@ -930,7 +935,7 @@ public class DBMetaDataTest
         assertEquals(rs.getString("COLUMN_NAME"), "Col2");
         assertEquals(rs.getInt("DATA_TYPE"), Types.VARCHAR);
         assertFalse(rs.next());
-        
+
         rs = meta.getColumns(null, null, "TabCols3", "%");
         assertTrue(rs.next());
         assertEquals(rs.getString("TABLE_NAME"), "TabCols3");
@@ -944,7 +949,7 @@ public class DBMetaDataTest
         assertEquals(rs.getString("COLUMN_NAME"), "Col2");
         assertEquals(rs.getInt("DATA_TYPE"), Types.VARCHAR);
         assertFalse(rs.next());
-        
+
     }
 
     @Test
@@ -957,7 +962,7 @@ public class DBMetaDataTest
         stat.executeUpdate("CREATE TABLE TAB2 (COL1 INTEGER NOT NULL PRIMARY KEY, COL2);");
         // autoincrement
         stat.executeUpdate("CREATE TABLE TAB3 (COL1 INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, COL2);");
-        
+
         rs = meta.getColumns(null, null, "TAB1", "%");
         assertTrue(rs.next());
         assertEquals(rs.getString("TABLE_NAME"), "TAB1");
@@ -971,7 +976,7 @@ public class DBMetaDataTest
         assertEquals(rs.getString("COLUMN_NAME"), "COL2");
         assertEquals(rs.getInt("DATA_TYPE"), Types.VARCHAR);
         assertFalse(rs.next());
-        
+
         rs = meta.getColumns(null, null, "TAB2", "%");
         assertTrue(rs.next());
         assertEquals(rs.getString("TABLE_NAME"), "TAB2");
@@ -985,7 +990,7 @@ public class DBMetaDataTest
         assertEquals(rs.getString("COLUMN_NAME"), "COL2");
         assertEquals(rs.getInt("DATA_TYPE"), Types.VARCHAR);
         assertFalse(rs.next());
-        
+
         rs = meta.getColumns(null, null, "TAB3", "%");
         assertTrue(rs.next());
         assertEquals(rs.getString("TABLE_NAME"), "TAB3");
@@ -999,7 +1004,7 @@ public class DBMetaDataTest
         assertEquals(rs.getString("COLUMN_NAME"), "COL2");
         assertEquals(rs.getInt("DATA_TYPE"), Types.VARCHAR);
         assertFalse(rs.next());
-        
+
     }
 
     @Test
@@ -1013,7 +1018,7 @@ public class DBMetaDataTest
         stat.executeUpdate("create table pk3 (col1, col2, col3, col4, primary key (col3, col2  ));");
         // extra spaces and mixed case are intentional, do not remove!
         stat.executeUpdate("create table pk4 (col1, col2, col3, col4, " +
-                "\r\nCONSTraint\r\nnamed  primary\r\n\t\t key   (col3, col2  ));");
+            "\r\nCONSTraint\r\nnamed  primary\r\n\t\t key   (col3, col2  ));");
         // mixed-case table, column and primary key names - GitHub issue #219
         stat.executeUpdate("CREATE TABLE Pk5 (Col1, Col2, Col3, Col4, CONSTRAINT NamedPk PRIMARY KEY (Col3, Col2));");
         // quoted table, column and primary key names - GitHub issue #219
@@ -1027,8 +1032,9 @@ public class DBMetaDataTest
         stat.executeUpdate("CREATE TABLE `Pk12` (`Col1`, `Col2`, `Col3`, `Col4`, CONSTRAINT`NamedPk`PRIMARY KEY(`Col3`,`Col2`));");
         stat.executeUpdate("CREATE TABLE \"Pk13\" (\"Col1\", \"Col2\", \"Col3\", \"Col4\", CONSTRAINT \"NamedPk\" PRIMARY KEY(\"Col3\",\"Col2\"));");
         stat.executeUpdate("CREATE TABLE \"Pk14\" (\"Col1\", \"Col2\", \"Col3\", \"Col4\", PRIMARY KEY(\"Col3\"), FOREIGN KEY (\"Col1\") REFERENCES \"pk1\" (\"col1\"))");
-        stat.executeUpdate("CREATE TABLE \"Pk15\" (\"Col1\", \"Col2\", \"Col3\", \"Col4\", PRIMARY KEY(\"Col3\", \"Col2\"), FOREIGN KEY (\"Col1\") REFERENCES \"pk1\" (\"col1\"))");
-        
+        stat.executeUpdate(
+            "CREATE TABLE \"Pk15\" (\"Col1\", \"Col2\", \"Col3\", \"Col4\", PRIMARY KEY(\"Col3\", \"Col2\"), FOREIGN KEY (\"Col1\") REFERENCES \"pk1\" (\"col1\"))");
+
         rs = meta.getPrimaryKeys(null, null, "nopk");
         assertFalse(rs.next());
         rsmeta = rs.getMetaData();
@@ -1040,7 +1046,7 @@ public class DBMetaDataTest
         assertEquals(rsmeta.getColumnName(5), "KEY_SEQ");
         assertEquals(rsmeta.getColumnName(6), "PK_NAME");
         rs.close();
-        
+
         assertPrimaryKey(meta, "pk1", null, "col1");
         assertPrimaryKey(meta, "pk2", null, "col2");
         assertPrimaryKey(meta, "pk3", null, "col3", "col2");
@@ -1057,29 +1063,29 @@ public class DBMetaDataTest
         assertPrimaryKey(meta, "Pk14", null, "Col3");
         assertPrimaryKey(meta, "Pk15", null, "Col3", "Col2");
     }
-    
-    private void assertPrimaryKey(DatabaseMetaData meta, String tableName, String pkName, String... pkColumns) throws Exception {  
-    	final Map<String, Integer> colSeq = new HashMap<String, Integer>();
-    	for (int i = 0; i < pkColumns.length; i++) {
-    		colSeq.put(pkColumns[i], i+1);
-    	}
-    	Arrays.sort(pkColumns);
-    	
-	    final ResultSet rs = meta.getPrimaryKeys(null, null, tableName);
-	    assertTrue(rs.next());
-	    for (int i = 0; i < pkColumns.length; i++) {
-	    	assertEquals("DatabaseMetaData.getPrimaryKeys: TABLE_CAT", null, rs.getString("TABLE_CAT"));
-	    	assertEquals("DatabaseMetaData.getPrimaryKeys: TABLE_SCHEM", null, rs.getString("TABLE_SCHEM"));
-		    assertEquals("DatabaseMetaData.getPrimaryKeys: TABLE_NAME", tableName, rs.getString("TABLE_NAME"));
-		    assertEquals("DatabaseMetaData.getPrimaryKeys: COLUMN_NAME", pkColumns[i], rs.getString("COLUMN_NAME"));
-		    assertEquals("DatabaseMetaData.getPrimaryKeys: PK_NAME", pkName, rs.getString("PK_NAME"));
-		    assertEquals("DatabaseMetaData.getPrimaryKeys: KEY_SEQ", colSeq.get(pkColumns[i]).intValue(), rs.getInt("KEY_SEQ"));
-		    if (i < pkColumns.length - 1) assertTrue(rs.next());
-	    }
-
-	    assertFalse(rs.next());
-
-	    rs.close();
+
+    private void assertPrimaryKey(DatabaseMetaData meta, String tableName, String pkName, String... pkColumns) throws Exception {
+        final Map<String, Integer> colSeq = new HashMap<String, Integer>();
+        for (int i = 0; i < pkColumns.length; i++) {
+            colSeq.put(pkColumns[i], i + 1);
+        }
+        Arrays.sort(pkColumns);
+
+        final ResultSet rs = meta.getPrimaryKeys(null, null, tableName);
+        assertTrue(rs.next());
+        for (int i = 0; i < pkColumns.length; i++) {
+            assertEquals(null, rs.getString("TABLE_CAT"), "DatabaseMetaData.getPrimaryKeys: TABLE_CAT");
+            assertEquals(null, rs.getString("TABLE_SCHEM"), "DatabaseMetaData.getPrimaryKeys: TABLE_SCHEM");
+            assertEquals(tableName, rs.getString("TABLE_NAME"), "DatabaseMetaData.getPrimaryKeys: TABLE_NAME");
+            assertEquals(pkColumns[i], rs.getString("COLUMN_NAME"), "DatabaseMetaData.getPrimaryKeys: COLUMN_NAME");
+            assertEquals(pkName, rs.getString("PK_NAME"), "DatabaseMetaData.getPrimaryKeys: PK_NAME");
+            assertEquals(colSeq.get(pkColumns[i]).intValue(), rs.getInt("KEY_SEQ"), "DatabaseMetaData.getPrimaryKeys: KEY_SEQ");
+            if (i < pkColumns.length - 1) assertTrue(rs.next());
+        }
+
+        assertFalse(rs.next());
+
+        rs.close();
     }
 
     @Test
@@ -1178,7 +1184,7 @@ public class DBMetaDataTest
 
     @Test
     public void getIndexInfoOnTest() throws SQLException {
-        ResultSet rs = meta.getIndexInfo(null,null,"test",false,false);
+        ResultSet rs = meta.getIndexInfo(null, null, "test", false, false);
 
         assertNotNull(rs);
     }
@@ -1188,7 +1194,7 @@ public class DBMetaDataTest
         stat.executeUpdate("create table testindex (id integer primary key, fn float default 0.0, sn not null);");
         stat.executeUpdate("create index testindex_idx on testindex (sn);");
 
-        ResultSet rs = meta.getIndexInfo(null,null,"testindex",false,false);
+        ResultSet rs = meta.getIndexInfo(null, null, "testindex", false, false);
         ResultSetMetaData rsmd = rs.getMetaData();
 
         assertNotNull(rs);
@@ -1201,7 +1207,7 @@ public class DBMetaDataTest
         stat.executeUpdate("create table testindex (id integer primary key, fn float default 0.0, sn not null);");
         stat.executeUpdate("create index testindex_idx on testindex (sn, fn/2);");
 
-        ResultSet rs = meta.getIndexInfo(null,null,"testindex",false,false);
+        ResultSet rs = meta.getIndexInfo(null, null, "testindex", false, false);
         ResultSetMetaData rsmd = rs.getMetaData();
 
         assertNotNull(rs);
@@ -1215,7 +1221,7 @@ public class DBMetaDataTest
         stat.executeUpdate("create index testindex_idx on testindex (sn);");
         stat.executeUpdate("create index testindex_pk_idx on testindex (id);");
 
-        ResultSet rs = meta.getIndexInfo(null,null,"testindex",false,false);
+        ResultSet rs = meta.getIndexInfo(null, null, "testindex", false, false);
         ResultSetMetaData rsmd = rs.getMetaData();
 
         assertNotNull(rs);
@@ -1225,23 +1231,23 @@ public class DBMetaDataTest
 
     @Test
     public void version() throws Exception {
-      File versionFile = new File("./VERSION");
-      Properties version = new Properties();
-      version.load(new FileReader(versionFile));
-      String versionString = version.getProperty("version");
-      int majorVersion = Integer.valueOf(versionString.split("\\.")[0]);
-      int minorVersion = Integer.valueOf(versionString.split("\\.")[1]);
-      
-      assertTrue("major version check", majorVersion > 0);
-      assertEquals("driver name","SQLite JDBC", meta.getDriverName());
-      assertTrue("driver version", meta.getDriverVersion().startsWith(String.format("%d.%d", majorVersion, minorVersion)));
-      assertEquals("driver major version", majorVersion, meta.getDriverMajorVersion());
-      assertEquals("driver minor version", minorVersion, meta.getDriverMinorVersion());
-      assertEquals("db name","SQLite", meta.getDatabaseProductName());
-      assertEquals("db version", versionString, meta.getDatabaseProductVersion());
-      assertEquals("db major version", majorVersion, meta.getDatabaseMajorVersion());
-      assertEquals("db minor version", minorVersion, meta.getDatabaseMinorVersion());
-      assertEquals("user name", null, meta.getUserName());
+        File versionFile = new File("./VERSION");
+        Properties version = new Properties();
+        version.load(new FileReader(versionFile));
+        String versionString = version.getProperty("version");
+        int majorVersion = Integer.parseInt(versionString.split("\\.")[0]);
+        int minorVersion = Integer.parseInt(versionString.split("\\.")[1]);
+
+        assertTrue(majorVersion > 0, "major version check");
+        assertEquals("SQLite JDBC", meta.getDriverName(), "driver name");
+        assertTrue(meta.getDriverVersion().startsWith(String.format("%d.%d", majorVersion, minorVersion)), "driver version");
+        assertEquals(majorVersion, meta.getDriverMajorVersion(), "driver major version");
+        assertEquals(minorVersion, meta.getDriverMinorVersion(), "driver minor version");
+        assertEquals("SQLite", meta.getDatabaseProductName(), "db name");
+        assertEquals(versionString, meta.getDatabaseProductVersion(), "db version");
+        assertEquals(majorVersion, meta.getDatabaseMajorVersion(), "db major version");
+        assertEquals(minorVersion, meta.getDatabaseMinorVersion(), "db minor version");
+        assertEquals(null, meta.getUserName(), "user name");
     }
-    
+
 }
diff --git a/src/test/java/org/sqlite/ErrorMessageTest.java b/src/test/java/org/sqlite/ErrorMessageTest.java
index d2ee4e78..f9afa8d6 100644
--- a/src/test/java/org/sqlite/ErrorMessageTest.java
+++ b/src/test/java/org/sqlite/ErrorMessageTest.java
@@ -1,6 +1,8 @@
 package org.sqlite;
 
-import static org.junit.Assume.assumeTrue;
+import org.hamcrest.BaseMatcher;
+import org.hamcrest.Description;
+import org.junit.jupiter.api.Test;
 
 import java.io.File;
 import java.io.IOException;
@@ -8,29 +10,26 @@ import java.sql.Connection;
 import java.sql.DriverManager;
 import java.sql.SQLException;
 import java.sql.Statement;
-import java.util.Properties;
 
-import org.hamcrest.BaseMatcher;
-import org.hamcrest.Description;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.matchers.JUnitMatchers;
-import org.junit.rules.ExpectedException;
+import static org.hamcrest.CoreMatchers.anyOf;
+import static org.hamcrest.CoreMatchers.containsString;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assumptions.assumeTrue;
 
 public class ErrorMessageTest {
-    @Rule
-    public ExpectedException thrown = ExpectedException.none();
-
     static class VendorCodeMatcher extends BaseMatcher<Object> {
         final SQLiteErrorCode expected;
 
-        VendorCodeMatcher(SQLiteErrorCode expected) {this.expected = expected;}
+        VendorCodeMatcher(SQLiteErrorCode expected) {
+            this.expected = expected;
+        }
 
         public boolean matches(Object o) {
             if (!(o instanceof SQLException)) {
                 return false;
             }
-            SQLException e = (SQLException)o;
+            SQLException e = (SQLException) o;
             SQLiteErrorCode ec = SQLiteErrorCode.getErrorCode(e.getErrorCode());
             return ec == expected;
         }
@@ -48,13 +47,15 @@ public class ErrorMessageTest {
     static class ResultCodeMatcher extends BaseMatcher<Object> {
         final SQLiteErrorCode expected;
 
-        ResultCodeMatcher(SQLiteErrorCode expected) {this.expected = expected;}
+        ResultCodeMatcher(SQLiteErrorCode expected) {
+            this.expected = expected;
+        }
 
         public boolean matches(Object o) {
             if (!(o instanceof SQLiteException)) {
                 return false;
             }
-            SQLiteException e = (SQLiteException)o;
+            SQLiteException e = (SQLiteException) o;
             return e.getResultCode() == expected;
         }
 
@@ -82,8 +83,8 @@ public class ErrorMessageTest {
         assumeTrue(to.delete());
         assumeTrue(from.renameTo(to));
 
-        thrown.expectMessage(JUnitMatchers.containsString("[SQLITE_READONLY_DBMOVED]"));
-        stmt.executeUpdate("insert into sample values(2, \"bar\")");
+        Exception exception = assertThrows(SQLException.class, () -> stmt.executeUpdate("insert into sample values(2, \"bar\")"));
+        assertThat(exception.getMessage(), containsString("[SQLITE_READONLY_DBMOVED]"));
 
         stmt.close();
         conn.close();
@@ -105,8 +106,9 @@ public class ErrorMessageTest {
 
         conn = DriverManager.getConnection("jdbc:sqlite:" + file.getAbsolutePath());
         stmt = conn.createStatement();
-        thrown.expectMessage(JUnitMatchers.containsString("[SQLITE_READONLY]"));
-        stmt.executeUpdate("insert into sample values(2, \"bar\")");
+        Statement finalStmt = stmt;
+        Exception exception = assertThrows(SQLException.class, () -> finalStmt.executeUpdate("insert into sample values(2, \"bar\")"));
+        assertThat(exception.getMessage(), containsString("[SQLITE_READONLY]"));
         stmt.close();
         conn.close();
     }
@@ -118,11 +120,10 @@ public class ErrorMessageTest {
         assumeTrue(dir.mkdir());
         dir.deleteOnExit();
 
-        thrown.expectMessage(JUnitMatchers.either(
-            JUnitMatchers.containsString("[SQLITE_CANTOPEN]")).or(
-            JUnitMatchers.containsString("[SQLITE_CANTOPEN_ISDIR]")));
-        Connection conn = DriverManager.getConnection("jdbc:sqlite:" + dir.getAbsolutePath());
-        conn.close();
+        Exception exception = assertThrows(SQLException.class, () -> DriverManager.getConnection("jdbc:sqlite:" + dir.getAbsolutePath()));
+        assertThat(exception.getMessage(), anyOf(
+            containsString("[SQLITE_CANTOPEN]"),
+            containsString("[SQLITE_CANTOPEN_ISDIR]")));
     }
 
     @Test
@@ -139,10 +140,11 @@ public class ErrorMessageTest {
         assumeTrue(to.delete());
         assumeTrue(from.renameTo(to));
 
-        thrown.expectMessage(JUnitMatchers.containsString("[SQLITE_READONLY_DBMOVED]"));
-        thrown.expect(new VendorCodeMatcher(SQLiteErrorCode.SQLITE_READONLY));
-        thrown.expect(new ResultCodeMatcher(SQLiteErrorCode.SQLITE_READONLY_DBMOVED));
-        stmt.executeUpdate("insert into sample values(2, \"bar\")");
+        Exception exception = assertThrows(SQLException.class, () -> stmt.executeUpdate("insert into sample values(2, \"bar\")"));
+        assertThat(exception.getMessage(), containsString("[SQLITE_READONLY_DBMOVED]"));
+        assertThat(exception, new VendorCodeMatcher(SQLiteErrorCode.SQLITE_READONLY));
+        assertThat(exception, new ResultCodeMatcher(SQLiteErrorCode.SQLITE_READONLY_DBMOVED));
+
 
         stmt.close();
         conn.close();
diff --git a/src/test/java/org/sqlite/ExtendedCommandTest.java b/src/test/java/org/sqlite/ExtendedCommandTest.java
index d8f986b7..f559da21 100755
--- a/src/test/java/org/sqlite/ExtendedCommandTest.java
+++ b/src/test/java/org/sqlite/ExtendedCommandTest.java
@@ -9,36 +9,28 @@
 //--------------------------------------
 package org.sqlite;
 
-import static org.junit.Assert.*;
-
-import java.sql.SQLException;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.sqlite.ExtendedCommand.BackupCommand;
 import org.sqlite.ExtendedCommand.RestoreCommand;
 import org.sqlite.ExtendedCommand.SQLExtension;
 
-public class ExtendedCommandTest
-{
+import java.sql.SQLException;
 
-    @Before
-    public void setUp() throws Exception {}
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
-    @After
-    public void tearDown() throws Exception {}
+public class ExtendedCommandTest {
 
     public static BackupCommand parseBackupCommand(String sql) throws SQLException {
         SQLExtension e = ExtendedCommand.parse(sql);
-        assertTrue(BackupCommand.class.isInstance(e));
-        return BackupCommand.class.cast(e);
+        assertTrue(e instanceof BackupCommand);
+        return (BackupCommand) e;
     }
 
     public static RestoreCommand parseRestoreCommand(String sql) throws SQLException {
         SQLExtension e = ExtendedCommand.parse(sql);
-        assertTrue(RestoreCommand.class.isInstance(e));
-        return RestoreCommand.class.cast(e);
+        assertTrue(e instanceof RestoreCommand);
+        return (RestoreCommand) e;
     }
 
     @Test
diff --git a/src/test/java/org/sqlite/ExtensionTest.java b/src/test/java/org/sqlite/ExtensionTest.java
index 5f581462..78153e78 100644
--- a/src/test/java/org/sqlite/ExtensionTest.java
+++ b/src/test/java/org/sqlite/ExtensionTest.java
@@ -1,34 +1,37 @@
 package org.sqlite;
 
-import org.junit.After;
-import org.junit.Assume;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.Assumptions;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 import java.sql.Connection;
 import java.sql.DriverManager;
 import java.sql.ResultSet;
 import java.sql.Statement;
 
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assumptions.*;
 
 public class ExtensionTest {
     Connection conn;
     Statement stat;
 
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         conn = DriverManager.getConnection("jdbc:sqlite:");
         stat = conn.createStatement();
     }
 
-    @After
+    @AfterEach
     public void tearDown() throws Exception {
-        if(stat != null)
+        if (stat != null) {
             stat.close();
-        if(conn != null)
+        }
+        if (conn != null) {
             conn.close();
+        }
 
     }
 
@@ -71,7 +74,7 @@ public class ExtensionTest {
             rs.close();
             // SQLite has to be compiled with JDBC Extensions for this test to
             // continue.
-            Assume.assumeTrue(hasJdbcExtensions);
+            assumeTrue(hasJdbcExtensions);
         }
         {
             ResultSet rs = stat.executeQuery("select cos(radians(45))");
diff --git a/src/test/java/org/sqlite/FetchSizeTest.java b/src/test/java/org/sqlite/FetchSizeTest.java
index fb72f5c3..279daf5e 100755
--- a/src/test/java/org/sqlite/FetchSizeTest.java
+++ b/src/test/java/org/sqlite/FetchSizeTest.java
@@ -1,6 +1,8 @@
 package org.sqlite;
 
-import static junit.framework.Assert.*;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 import java.sql.Connection;
 import java.sql.DriverManager;
@@ -8,26 +10,24 @@ import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 
-import org.junit.After;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 /**
  * Created by IntelliJ IDEA. User: david_donn Date: 19/01/2010 Time: 11:50:24 AM
  * To change this template use File | Settings | File Templates.
  */
-public class FetchSizeTest
-{
+public class FetchSizeTest {
 
     private Connection conn;
 
-    @Before
+    @BeforeEach
     public void connect() throws Exception {
         conn = DriverManager.getConnection("jdbc:sqlite:");
     }
 
-    @After
+    @AfterEach
     public void close() throws SQLException {
         conn.close();
     }
diff --git a/src/test/java/org/sqlite/InsertQueryTest.java b/src/test/java/org/sqlite/InsertQueryTest.java
index e68d2671..f8dec330 100644
--- a/src/test/java/org/sqlite/InsertQueryTest.java
+++ b/src/test/java/org/sqlite/InsertQueryTest.java
@@ -9,6 +9,11 @@
 //--------------------------------------
 package org.sqlite;
 
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+
 import java.io.File;
 import java.sql.Connection;
 import java.sql.DriverManager;
@@ -17,141 +22,118 @@ import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.sql.Statement;
 
-import org.junit.After;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 
-public class InsertQueryTest
-{
+public class InsertQueryTest {
     String dbName;
 
-    @Before
-    public void setUp() throws Exception
-    {
+    @BeforeEach
+    public void setUp() throws Exception {
         File tmpFile = File.createTempFile("tmp-sqlite", ".db");
         tmpFile.deleteOnExit();
         dbName = tmpFile.getAbsolutePath();
     }
 
-    @After
-    public void tearDown() throws Exception
-    {
+    @AfterEach
+    public void tearDown() throws Exception {
 
     }
 
-    interface ConnectionFactory
-    {
+    interface ConnectionFactory {
         Connection getConnection() throws SQLException;
 
         void dispose() throws SQLException;
     }
 
-    class IndependentConnectionFactory implements ConnectionFactory
-    {
-        public Connection getConnection() throws SQLException
-        {
+    class IndependentConnectionFactory implements ConnectionFactory {
+        public Connection getConnection() throws SQLException {
             return DriverManager.getConnection("jdbc:sqlite:" + dbName);
         }
 
-        public void dispose() throws SQLException
-        {
+        public void dispose() throws SQLException {
 
         }
 
     }
 
-    class SharedConnectionFactory implements ConnectionFactory
-    {
+    class SharedConnectionFactory implements ConnectionFactory {
         private Connection conn = null;
 
-        public Connection getConnection() throws SQLException
-        {
-            if (conn == null)
+        public Connection getConnection() throws SQLException {
+            if (conn == null) {
                 conn = DriverManager.getConnection("jdbc:sqlite:" + dbName);
+            }
             return conn;
         }
 
-        public void dispose() throws SQLException
-        {
-            if (conn != null)
+        public void dispose() throws SQLException {
+            if (conn != null) {
                 conn.close();
+            }
         }
     }
 
-    static class BD
-    {
+    static class BD {
         String fullId;
         String type;
 
-        public BD(String fullId, String type)
-        {
+        public BD(String fullId, String type) {
             this.fullId = fullId;
             this.type = type;
         }
 
-        public String getFullId()
-        {
+        public String getFullId() {
             return fullId;
         }
 
-        public void setFullId(String fullId)
-        {
+        public void setFullId(String fullId) {
             this.fullId = fullId;
         }
 
-        public String getType()
-        {
+        public String getType() {
             return type;
         }
 
-        public void setType(String type)
-        {
+        public void setType(String type) {
             this.type = type;
         }
 
-        public static byte[] serializeBD(BD item)
-        {
+        public static byte[] serializeBD(BD item) {
             return new byte[0];
         }
 
     }
 
     @Test
-    public void insertLockTestUsingSharedConnection() throws Exception
-    {
+    public void insertLockTestUsingSharedConnection() throws Exception {
         insertAndQuery(new SharedConnectionFactory());
     }
 
     @Test
-    public void insertLockTestUsingIndependentConnection() throws Exception
-    {
+    public void insertLockTestUsingIndependentConnection() throws Exception {
         insertAndQuery(new IndependentConnectionFactory());
     }
 
-    void insertAndQuery(ConnectionFactory factory) throws SQLException
-    {
-        try
-        {
+    void insertAndQuery(ConnectionFactory factory) throws SQLException {
+        try {
             Statement st = factory.getConnection().createStatement();
             st
-                    .executeUpdate("CREATE TABLE IF NOT EXISTS data (fid VARCHAR(255) PRIMARY KEY, type VARCHAR(64), data BLOB);");
+                .executeUpdate("CREATE TABLE IF NOT EXISTS data (fid VARCHAR(255) PRIMARY KEY, type VARCHAR(64), data BLOB);");
             st
-                    .executeUpdate("CREATE TABLE IF NOT EXISTS ResourcesTags (bd_fid VARCHAR(255), name VARCHAR(64), version INTEGER);");
+                .executeUpdate("CREATE TABLE IF NOT EXISTS ResourcesTags (bd_fid VARCHAR(255), name VARCHAR(64), version INTEGER);");
             st.close();
 
             factory.getConnection().setAutoCommit(false);
 
             // Object Serialization
             PreparedStatement statAddBD = factory.getConnection().prepareStatement(
-                    "INSERT OR REPLACE INTO data values (?, ?, ?)");
+                "INSERT OR REPLACE INTO data values (?, ?, ?)");
             PreparedStatement statDelRT = factory.getConnection().prepareStatement(
-                    "DELETE FROM ResourcesTags WHERE bd_fid = ?");
+                "DELETE FROM ResourcesTags WHERE bd_fid = ?");
             PreparedStatement statAddRT = factory.getConnection().prepareStatement(
-                    "INSERT INTO ResourcesTags values (?, ?, ?)");
+                "INSERT INTO ResourcesTags values (?, ?, ?)");
 
-            for (int i = 0; i < 10; i++)
-            {
+            for (int i = 0; i < 10; i++) {
                 BD item = new BD(Integer.toHexString(i), Integer.toString(i));
 
                 // SQLite database insertion
@@ -166,8 +148,7 @@ public class InsertQueryTest
 
                 statAddRT.setString(1, item.getFullId());
 
-                for (int j = 0; j < 2; j++)
-                {
+                for (int j = 0; j < 2; j++) {
                     statAddRT.setString(2, "1");
                     statAddRT.setLong(3, 1L);
                     statAddRT.execute();
@@ -194,17 +175,15 @@ public class InsertQueryTest
 
             rs.close();
             stat.close();
-        }
-        finally
-        {
+        } finally {
             factory.dispose();
         }
 
     }
 
-    @Test(expected = SQLException.class)
-    public void reproduceDatabaseLocked() throws SQLException
-    {
+    @Disabled("Not sure this worked recently, the second query cannot find the table 'sample'")
+    @Test
+    public void reproduceDatabaseLocked() throws SQLException {
         Connection conn = DriverManager.getConnection("jdbc:sqlite:" + dbName);
         Connection conn2 = DriverManager.getConnection("jdbc:sqlite:" + dbName);
         Statement stat = conn.createStatement();
diff --git a/src/test/java/org/sqlite/JDBCTest.java b/src/test/java/org/sqlite/JDBCTest.java
index b10e8c98..70d9324e 100644
--- a/src/test/java/org/sqlite/JDBCTest.java
+++ b/src/test/java/org/sqlite/JDBCTest.java
@@ -9,25 +9,22 @@
 //--------------------------------------
 package org.sqlite;
 
+import org.junit.jupiter.api.Test;
+
 import java.sql.Connection;
 import java.sql.DriverManager;
 import java.sql.Statement;
 import java.util.Properties;
 
-import junit.framework.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import static org.junit.jupiter.api.Assertions.assertNull;
 
-public class JDBCTest
-{
+public class JDBCTest {
     @Test
     public void enableLoadExtensionTest() throws Exception {
         Properties prop = new Properties();
         prop.setProperty("enable_load_extension", "true");
 
-        Connection conn = null;
-        try {
-            conn = DriverManager.getConnection("jdbc:sqlite:", prop);
+        try (Connection conn = DriverManager.getConnection("jdbc:sqlite:", prop)) {
             Statement stat = conn.createStatement();
 
             // How to build shared lib in Windows
@@ -40,10 +37,6 @@ public class JDBCTest
             //            System.out.println(rs.getDouble(1));
 
         }
-        finally {
-            if (conn != null)
-                conn.close();
-        }
     }
 
     @Test
@@ -54,7 +47,7 @@ public class JDBCTest
 
     @Test
     public void shouldReturnNullIfProtocolUnhandled() throws Exception {
-        Assert.assertNull(JDBC.createConnection("jdbc:anotherpopulardatabaseprotocol:", null));
+        assertNull(JDBC.createConnection("jdbc:anotherpopulardatabaseprotocol:", null));
     }
 
 }
diff --git a/src/test/java/org/sqlite/JSON1Test.java b/src/test/java/org/sqlite/JSON1Test.java
index dc7a86cb..788e20a7 100644
--- a/src/test/java/org/sqlite/JSON1Test.java
+++ b/src/test/java/org/sqlite/JSON1Test.java
@@ -1,13 +1,15 @@
 package org.sqlite;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import java.sql.Connection;
 import java.sql.DriverManager;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 /**
  * Tests the JSON1 extension using the examples listed in the documentation.
@@ -509,8 +511,8 @@ public class JSON1Test {
         conn.createStatement().execute("insert into user values('harry', json_array('504-200-0000','304-200-0000'))");
 
         String q = "SELECT DISTINCT user.name"
-                + " FROM user, json_each(user.phone)"
-                + " where json_each.value LIKE '704-%'";
+            + " FROM user, json_each(user.phone)"
+            + " where json_each.value LIKE '704-%'";
 
         ResultSet rs = conn.createStatement().executeQuery(q);
         assertTrue(rs.next());
@@ -532,11 +534,11 @@ public class JSON1Test {
         conn.createStatement().execute("insert into user values('harry', json_array('504-200-0000','304-200-0000'))");
 
         String q = "SELECT name FROM user WHERE phone LIKE '705-%'"
-                + " UNION"
-                + " SELECT user.name"
-                + " FROM user, json_each(user.phone)"
-                + " WHERE json_valid(user.phone)"
-                + " AND json_each.value LIKE '704-%'";
+            + " UNION"
+            + " SELECT user.name"
+            + " FROM user, json_each(user.phone)"
+            + " WHERE json_valid(user.phone)"
+            + " AND json_each.value LIKE '704-%'";
 
         ResultSet rs = conn.createStatement().executeQuery(q);
         assertTrue(rs.next());
@@ -553,8 +555,8 @@ public class JSON1Test {
         conn.createStatement().execute("insert into big values(json_object('a',2,'c',4))");
 
         String q = "SELECT big.rowid, fullkey, value"
-                + " FROM big, json_tree(big.json)"
-                + " WHERE json_tree.type NOT IN ('object', 'array')";
+            + " FROM big, json_tree(big.json)"
+            + " WHERE json_tree.type NOT IN ('object', 'array')";
 
         ResultSet rs = conn.createStatement().executeQuery(q);
         assertTrue(rs.next());
@@ -579,8 +581,8 @@ public class JSON1Test {
         conn.createStatement().execute("insert into big values(json_object('a',2,'c',4))");
 
         String q = "SELECT big.rowid, fullkey, atom"
-                + " FROM big, json_tree(big.json)"
-                + " WHERE atom IS NOT NULL";
+            + " FROM big, json_tree(big.json)"
+            + " WHERE atom IS NOT NULL";
 
         ResultSet rs = conn.createStatement().executeQuery(q);
         assertTrue(rs.next());
diff --git a/src/test/java/org/sqlite/ListenerTest.java b/src/test/java/org/sqlite/ListenerTest.java
index e41f2885..4536e709 100644
--- a/src/test/java/org/sqlite/ListenerTest.java
+++ b/src/test/java/org/sqlite/ListenerTest.java
@@ -1,7 +1,7 @@
 package org.sqlite;
 
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 import java.io.File;
 import java.sql.DriverManager;
@@ -10,193 +10,193 @@ import java.util.LinkedList;
 import java.util.List;
 import java.util.concurrent.atomic.AtomicBoolean;
 
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 public class ListenerTest {
 
-  private SQLiteConnection connectionOne, connectionTwo;
+    private SQLiteConnection connectionOne, connectionTwo;
 
-  @Before
-  public void connect() throws Exception {
-    File tmpFile = File.createTempFile("test-listeners", ".db");
-    tmpFile.deleteOnExit();
+    @BeforeEach
+    public void connect() throws Exception {
+        File tmpFile = File.createTempFile("test-listeners", ".db");
+        tmpFile.deleteOnExit();
 
-    connectionOne = (SQLiteConnection)DriverManager.getConnection("jdbc:sqlite:" + tmpFile.getAbsolutePath());
-    connectionTwo = (SQLiteConnection)DriverManager.getConnection("jdbc:sqlite:" + tmpFile.getAbsolutePath());
+        connectionOne = (SQLiteConnection) DriverManager.getConnection("jdbc:sqlite:" + tmpFile.getAbsolutePath());
+        connectionTwo = (SQLiteConnection) DriverManager.getConnection("jdbc:sqlite:" + tmpFile.getAbsolutePath());
 
-    Statement create = connectionOne.createStatement();
-    create.execute("CREATE TABLE IF NOT EXISTS sample (id INTEGER PRIMARY KEY AUTOINCREMENT, description TEXT);");
-  }
-
-  @Test
-  public void testSetAndRemoveUpdateHook() throws Exception {
-    final List<Update> updates = new LinkedList<Update>();
-
-    SQLiteUpdateListener listener = new SQLiteUpdateListener() {
-      @Override
-      public void onUpdate(Type type, String database, String table, long rowId) {
-        synchronized (updates) {
-          updates.add(new Update(type, database, table, rowId));
-          updates.notifyAll();
-        }
-      }
-    };
-
-    connectionOne.addUpdateListener(listener);
+        Statement create = connectionOne.createStatement();
+        create.execute("CREATE TABLE IF NOT EXISTS sample (id INTEGER PRIMARY KEY AUTOINCREMENT, description TEXT);");
+    }
 
-    Statement statement = connectionOne.createStatement();
-    statement.execute("INSERT INTO sample (description) VALUES ('smert za smert')");
+    @Test
+    public void testSetAndRemoveUpdateHook() throws Exception {
+        final List<Update> updates = new LinkedList<Update>();
 
-    synchronized (updates) {
-      if (updates.isEmpty()) {
-        updates.wait(1000);
-      }
-    }
+        SQLiteUpdateListener listener = new SQLiteUpdateListener() {
+            @Override
+            public void onUpdate(Type type, String database, String table, long rowId) {
+                synchronized (updates) {
+                    updates.add(new Update(type, database, table, rowId));
+                    updates.notifyAll();
+                }
+            }
+        };
 
-    if (updates.isEmpty()) throw new AssertionError("Never got update!");
+        connectionOne.addUpdateListener(listener);
 
-    assertEquals(1, updates.size());
-    assertEquals("sample", updates.get(0).table);
-    assertEquals(1, updates.get(0).rowId);
-    assertEquals(SQLiteUpdateListener.Type.INSERT, updates.get(0).type);
+        Statement statement = connectionOne.createStatement();
+        statement.execute("INSERT INTO sample (description) VALUES ('smert za smert')");
 
-    updates.clear();
+        synchronized (updates) {
+            if (updates.isEmpty()) {
+                updates.wait(1000);
+            }
+        }
 
-    connectionOne.removeUpdateListener(listener);
+        if (updates.isEmpty()) throw new AssertionError("Never got update!");
 
-    Statement secondStatement = connectionOne.createStatement();
-    secondStatement.execute("INSERT INTO sample (description) VALUES ('amor fati')");
+        assertEquals(1, updates.size());
+        assertEquals("sample", updates.get(0).table);
+        assertEquals(1, updates.get(0).rowId);
+        assertEquals(SQLiteUpdateListener.Type.INSERT, updates.get(0).type);
 
-    synchronized (updates) {
-      if (updates.isEmpty()) {
-        updates.wait(1000);
-      }
-    }
+        updates.clear();
 
-    assertTrue(updates.isEmpty());
-  }
+        connectionOne.removeUpdateListener(listener);
 
-  @Test
-  public void testMultiConnectionHook() throws Exception {
-    final List<Update> updates = new LinkedList<Update>();
+        Statement secondStatement = connectionOne.createStatement();
+        secondStatement.execute("INSERT INTO sample (description) VALUES ('amor fati')");
 
-    SQLiteUpdateListener listener = new SQLiteUpdateListener() {
-      @Override
-      public void onUpdate(Type type, String database, String table, long rowId) {
         synchronized (updates) {
-          updates.add(new Update(type, database, table, rowId));
-          updates.notifyAll();
+            if (updates.isEmpty()) {
+                updates.wait(1000);
+            }
         }
-      }
-    };
-
-    connectionOne.addUpdateListener(listener);
 
-    Statement statement = connectionOne.createStatement();
-    statement.execute("INSERT INTO sample (description) VALUES ('smert za smert')");
-
-    synchronized (updates) {
-      if (updates.isEmpty()) {
-        updates.wait(1000);
-      }
+        assertTrue(updates.isEmpty());
     }
 
-    if (updates.isEmpty()) throw new AssertionError("Never got update!");
+    @Test
+    public void testMultiConnectionHook() throws Exception {
+        final List<Update> updates = new LinkedList<Update>();
 
-    assertEquals(1, updates.size());
-    assertEquals("sample", updates.get(0).table);
-    assertEquals(1, updates.get(0).rowId);
-    assertEquals(SQLiteUpdateListener.Type.INSERT, updates.get(0).type);
+        SQLiteUpdateListener listener = new SQLiteUpdateListener() {
+            @Override
+            public void onUpdate(Type type, String database, String table, long rowId) {
+                synchronized (updates) {
+                    updates.add(new Update(type, database, table, rowId));
+                    updates.notifyAll();
+                }
+            }
+        };
 
-    updates.clear();
+        connectionOne.addUpdateListener(listener);
 
-    Statement secondStatement = connectionTwo.createStatement();
-    secondStatement.execute("INSERT INTO sample (description) VALUES ('amor fati')");
+        Statement statement = connectionOne.createStatement();
+        statement.execute("INSERT INTO sample (description) VALUES ('smert za smert')");
 
-    synchronized (updates) {
-      if (updates.isEmpty()) {
-        updates.wait(1000);
-      }
-    }
+        synchronized (updates) {
+            if (updates.isEmpty()) {
+                updates.wait(1000);
+            }
+        }
 
-    assertTrue(updates.isEmpty());
+        if (updates.isEmpty()) throw new AssertionError("Never got update!");
 
-    connectionOne.removeUpdateListener(listener);
-  }
+        assertEquals(1, updates.size());
+        assertEquals("sample", updates.get(0).table);
+        assertEquals(1, updates.get(0).rowId);
+        assertEquals(SQLiteUpdateListener.Type.INSERT, updates.get(0).type);
 
-  @Test
-  public void testMultiInsertAndCommit() throws Exception {
-    final List<Update>  updates   = new LinkedList<Update>();
-    final AtomicBoolean committed = new AtomicBoolean(false);
+        updates.clear();
 
-    SQLiteUpdateListener updateListener = new SQLiteUpdateListener() {
-      @Override
-      public void onUpdate(Type type, String database, String table, long rowId) {
-        synchronized (updates) {
-          updates.add(new Update(type, database, table, rowId));
-          updates.notifyAll();
-        }
-      }
-    };
+        Statement secondStatement = connectionTwo.createStatement();
+        secondStatement.execute("INSERT INTO sample (description) VALUES ('amor fati')");
 
-    SQLiteCommitListener commitListener = new SQLiteCommitListener() {
-      @Override
-      public void onCommit() {
-        synchronized (committed) {
-          committed.set(true);
+        synchronized (updates) {
+            if (updates.isEmpty()) {
+                updates.wait(1000);
+            }
         }
-      }
 
-      @Override
-      public void onRollback() {
-        throw new AssertionError("rollback?");
-      }
-    };
+        assertTrue(updates.isEmpty());
 
-    connectionOne.addUpdateListener(updateListener);
-    connectionOne.addCommitListener(commitListener);
+        connectionOne.removeUpdateListener(listener);
+    }
 
-    connectionOne.setAutoCommit(false);
+    @Test
+    public void testMultiInsertAndCommit() throws Exception {
+        final List<Update> updates = new LinkedList<Update>();
+        final AtomicBoolean committed = new AtomicBoolean(false);
+
+        SQLiteUpdateListener updateListener = new SQLiteUpdateListener() {
+            @Override
+            public void onUpdate(Type type, String database, String table, long rowId) {
+                synchronized (updates) {
+                    updates.add(new Update(type, database, table, rowId));
+                    updates.notifyAll();
+                }
+            }
+        };
+
+        SQLiteCommitListener commitListener = new SQLiteCommitListener() {
+            @Override
+            public void onCommit() {
+                synchronized (committed) {
+                    committed.set(true);
+                }
+            }
+
+            @Override
+            public void onRollback() {
+                throw new AssertionError("rollback?");
+            }
+        };
+
+        connectionOne.addUpdateListener(updateListener);
+        connectionOne.addCommitListener(commitListener);
+
+        connectionOne.setAutoCommit(false);
+
+        for (int i = 0; i < 100; i++) {
+            Statement statement = connectionOne.createStatement();
+            statement.execute("INSERT INTO sample (description) VALUES ('test: " + i + "')");
+        }
 
-    for (int i=0;i<100;i++) {
-      Statement statement = connectionOne.createStatement();
-      statement.execute("INSERT INTO sample (description) VALUES ('test: " + i + "')");
-    }
+        connectionOne.setAutoCommit(true);
 
-    connectionOne.setAutoCommit(true);
+        synchronized (committed) {
+            if (!committed.get()) {
+                committed.wait(1000);
+            }
+        }
 
-    synchronized (committed) {
-      if (!committed.get()) {
-        committed.wait(1000);
-      }
-    }
+        assertTrue(committed.get());
+        assertEquals(100, updates.size());
 
-    assertTrue(committed.get());
-    assertEquals(100, updates.size());
+        for (int i = 0; i < 100; i++) {
+            assertEquals(i + 1, updates.get(i).rowId);
+            assertEquals("sample", updates.get(i).table);
+            assertEquals(SQLiteUpdateListener.Type.INSERT, updates.get(i).type);
+        }
 
-    for (int i=0;i<100;i++) {
-      assertEquals(i+1, updates.get(i).rowId);
-      assertEquals("sample", updates.get(i).table);
-      assertEquals(SQLiteUpdateListener.Type.INSERT, updates.get(i).type);
+        connectionOne.removeUpdateListener(updateListener);
+        connectionOne.removeCommitListener(commitListener);
     }
 
-    connectionOne.removeUpdateListener(updateListener);
-    connectionOne.removeCommitListener(commitListener);
-  }
-
 
-  private static class Update {
-    private final SQLiteUpdateListener.Type type;
-    private final String                    database;
-    private final String                    table;
-    private final long                      rowId;
+    private static class Update {
+        private final SQLiteUpdateListener.Type type;
+        private final String database;
+        private final String table;
+        private final long rowId;
 
-    private Update(SQLiteUpdateListener.Type type, String database, String table, long rowId) {
-      this.type     = type;
-      this.database = database;
-      this.table    = table;
-      this.rowId    = rowId;
+        private Update(SQLiteUpdateListener.Type type, String database, String table, long rowId) {
+            this.type = type;
+            this.database = database;
+            this.table = table;
+            this.rowId = rowId;
+        }
     }
-  }
 }
diff --git a/src/test/java/org/sqlite/PrepStmtTest.java b/src/test/java/org/sqlite/PrepStmtTest.java
index 636e8205..5ae47709 100644
--- a/src/test/java/org/sqlite/PrepStmtTest.java
+++ b/src/test/java/org/sqlite/PrepStmtTest.java
@@ -1,9 +1,13 @@
 package org.sqlite;
 
-import static org.junit.Assert.*;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 import java.io.ByteArrayInputStream;
+import java.io.InputStreamReader;
 import java.io.UnsupportedEncodingException;
+import java.nio.charset.StandardCharsets;
 import java.sql.Connection;
 import java.sql.Date;
 import java.sql.DriverManager;
@@ -14,46 +18,44 @@ import java.sql.SQLException;
 import java.sql.Statement;
 import java.util.StringTokenizer;
 
-import org.junit.After;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/** These tests are designed to stress PreparedStatements on memory dbs. */
-public class PrepStmtTest
-{
-    static byte[]      b1    = new byte[] { 1, 2, 7, 4, 2, 6, 2, 8, 5, 2, 3, 1, 5, 3, 6, 3, 3, 6, 2, 5 };
-    static byte[]      b2    = getUtf8Bytes("To be or not to be.");
-    static byte[]      b3    = getUtf8Bytes("Question!#$%");
-    static String      utf01 = "\uD840\uDC40";
-    static String      utf02 = "\uD840\uDC47 ";
-    static String      utf03 = " \uD840\uDC43";
-    static String      utf04 = " \uD840\uDC42 ";
-    static String      utf05 = "\uD840\uDC40\uD840\uDC44";
-    static String      utf06 = "Hello World, \uD840\uDC40 \uD880\uDC99";
-    static String      utf07 = "\uD840\uDC41 testing \uD880\uDC99";
-    static String      utf08 = "\uD840\uDC40\uD840\uDC44 testing";
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
+
+/**
+ * These tests are designed to stress PreparedStatements on memory dbs.
+ */
+public class PrepStmtTest {
+    static byte[] b1 = new byte[] {1, 2, 7, 4, 2, 6, 2, 8, 5, 2, 3, 1, 5, 3, 6, 3, 3, 6, 2, 5};
+    static byte[] b2 = getUtf8Bytes("To be or not to be.");
+    static byte[] b3 = getUtf8Bytes("Question!#$%");
+    static String utf01 = "\uD840\uDC40";
+    static String utf02 = "\uD840\uDC47 ";
+    static String utf03 = " \uD840\uDC43";
+    static String utf04 = " \uD840\uDC42 ";
+    static String utf05 = "\uD840\uDC40\uD840\uDC44";
+    static String utf06 = "Hello World, \uD840\uDC40 \uD880\uDC99";
+    static String utf07 = "\uD840\uDC41 testing \uD880\uDC99";
+    static String utf08 = "\uD840\uDC40\uD840\uDC44 testing";
 
     private Connection conn;
-    private Statement  stat;
+    private Statement stat;
 
     private static byte[] getUtf8Bytes(String str) {
-        try {
-            return str.getBytes("UTF-8");
-        }
-        catch (UnsupportedEncodingException e) {
-            fail(e.getMessage());
-            return null;
-        }
+        return str.getBytes(StandardCharsets.UTF_8);
     }
-    
-    @Before
+
+    @BeforeEach
     public void connect() throws Exception {
         conn = DriverManager.getConnection("jdbc:sqlite:");
         stat = conn.createStatement();
     }
 
-    @After
+    @AfterEach
     public void close() throws SQLException {
         stat.close();
         conn.close();
@@ -151,7 +153,7 @@ public class PrepStmtTest
     }
 
     @Test
-    public void set() throws SQLException, UnsupportedEncodingException {
+    public void set() throws SQLException {
         ResultSet rs;
         PreparedStatement prep = conn.prepareStatement("select ?, ?, ?;");
 
@@ -200,7 +202,7 @@ public class PrepStmtTest
         assertArrayEq(rs.getBytes(3), b3);
         assertFalse(rs.next());
         rs.close();
-        
+
         // null date, time and timestamp (fix #363)
         prep.setDate(1, null);
         prep.setTime(2, null);
@@ -216,15 +218,15 @@ public class PrepStmtTest
         prep.setBinaryStream(1, inByte, b1.length);
         ByteArrayInputStream inAscii = new ByteArrayInputStream(b2);
         prep.setAsciiStream(2, inAscii, b2.length);
-        byte[] b3 = utf08.getBytes("UTF-8");
+        byte[] b3 = utf08.getBytes(StandardCharsets.UTF_8);
         ByteArrayInputStream inUnicode = new ByteArrayInputStream(b3);
         prep.setUnicodeStream(3, inUnicode, b3.length);
 
         rs = prep.executeQuery();
         assertTrue(rs.next());
         assertArrayEq(b1, rs.getBytes(1));
-        assertEquals(new String(b2, "UTF-8"), rs.getString(2));
-        assertEquals(new String(b3, "UTF-8"), rs.getString(3));
+        assertEquals(new String(b2, StandardCharsets.UTF_8), rs.getString(2));
+        assertEquals(new String(b3, StandardCharsets.UTF_8), rs.getString(3));
         assertFalse(rs.next());
         rs.close();
     }
@@ -325,7 +327,7 @@ public class PrepStmtTest
     @Test
     public void utf() throws SQLException {
         ResultSet rs = stat.executeQuery("select '" + utf01 + "','" + utf02 + "','" + utf03 + "','" + utf04 + "','"
-                + utf05 + "','" + utf06 + "','" + utf07 + "','" + utf08 + "';");
+            + utf05 + "','" + utf06 + "','" + utf07 + "','" + utf08 + "';");
         assertArrayEq(rs.getBytes(1), getUtf8Bytes(utf01));
         assertArrayEq(rs.getBytes(2), getUtf8Bytes(utf02));
         assertArrayEq(rs.getBytes(3), getUtf8Bytes(utf03));
@@ -387,7 +389,7 @@ public class PrepStmtTest
             prep.setDouble(4, Double.MAX_VALUE + i);
             prep.addBatch();
         }
-        assertArrayEq(prep.executeBatch(), new int[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
+        assertArrayEq(prep.executeBatch(), new int[] {1, 1, 1, 1, 1, 1, 1, 1, 1, 1});
         prep.close();
 
         rs = stat.executeQuery("select * from test;");
@@ -449,7 +451,7 @@ public class PrepStmtTest
             prep.setInt(1, Integer.MIN_VALUE + i);
             prep.addBatch();
         }
-        assertArrayEq(new int[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }, prep.executeBatch());
+        assertArrayEq(new int[] {1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, prep.executeBatch());
         prep.close();
         ResultSet rs = stat.executeQuery("select count(*) from test;");
         assertTrue(rs.next());
@@ -464,7 +466,7 @@ public class PrepStmtTest
         for (int i = 0; i < 10; i++) {
             prep.addBatch();
         }
-        assertArrayEq(new int[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }, prep.executeBatch());
+        assertArrayEq(new int[] {1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, prep.executeBatch());
         prep.close();
         ResultSet rs = stat.executeQuery("select count(*) from test;");
         assertTrue(rs.next());
@@ -490,7 +492,9 @@ public class PrepStmtTest
         assertEquals(meta.getColumnType(2), Types.INTEGER);
         assertEquals(meta.getColumnType(3), Types.INTEGER);*/
 
-        prep.setInt(1, 2);prep.setInt(2, 3);prep.setInt(3, -1);
+        prep.setInt(1, 2);
+        prep.setInt(2, 3);
+        prep.setInt(3, -1);
         meta = prep.executeQuery().getMetaData();
         assertEquals(meta.getColumnCount(), 3);
         prep.close();
@@ -630,23 +634,21 @@ public class PrepStmtTest
         prep.addBatch();
     }
 
-    @Test(expected = SQLException.class)
-    public void noSuchTable() throws SQLException {
-        PreparedStatement prep = conn.prepareStatement("select * from doesnotexist;");
-        prep.executeQuery();
+    @Test
+    public void noSuchTable() {
+        assertThrows(SQLException.class, () -> conn.prepareStatement("select * from doesnotexist;"));
     }
 
-    @Test(expected = SQLException.class)
+    @Test
     public void noSuchCol() throws SQLException {
-        PreparedStatement prep = conn.prepareStatement("select notacol from (select 1);");
-        prep.executeQuery();
+        assertThrows(SQLException.class, () ->  conn.prepareStatement("select notacol from (select 1);"));
     }
 
-    @Test(expected = SQLException.class)
+    @Test
     public void noSuchColName() throws SQLException {
         ResultSet rs = conn.prepareStatement("select 1;").executeQuery();
         assertTrue(rs.next());
-        rs.getInt("noSuchColName");
+        assertThrows(SQLException.class, () -> rs.getInt("noSuchColName"));
     }
 
     @Test
@@ -701,15 +703,17 @@ public class PrepStmtTest
         assertNotNull(a);
         assertNotNull(b);
         assertEquals(a.length, b.length);
-        for (int i = 0; i < a.length; i++)
+        for (int i = 0; i < a.length; i++) {
             assertEquals(a[i], b[i]);
+        }
     }
 
     private void assertArrayEq(int[] a, int[] b) {
         assertNotNull(a);
         assertNotNull(b);
         assertEquals(a.length, b.length);
-        for (int i = 0; i < a.length; i++)
+        for (int i = 0; i < a.length; i++) {
             assertEquals(a[i], b[i]);
+        }
     }
 }
diff --git a/src/test/java/org/sqlite/ProgressHandlerTest.java b/src/test/java/org/sqlite/ProgressHandlerTest.java
index e5223c76..5899eb4a 100644
--- a/src/test/java/org/sqlite/ProgressHandlerTest.java
+++ b/src/test/java/org/sqlite/ProgressHandlerTest.java
@@ -1,29 +1,29 @@
 package org.sqlite;
 
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 import java.sql.Connection;
 import java.sql.DriverManager;
 import java.sql.SQLException;
 import java.sql.Statement;
 
-import static junit.framework.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
 
 public class ProgressHandlerTest {
     private Connection conn;
     private Statement stat;
 
-    @Before
+    @BeforeEach
     public void connect() throws Exception {
         conn = DriverManager.getConnection("jdbc:sqlite:");
         stat = conn.createStatement();
     }
 
-    @After
+    @AfterEach
     public void close() throws SQLException {
         stat.close();
         conn.close();
diff --git a/src/test/java/org/sqlite/QueryTest.java b/src/test/java/org/sqlite/QueryTest.java
index cecbeafb..c1f98806 100644
--- a/src/test/java/org/sqlite/QueryTest.java
+++ b/src/test/java/org/sqlite/QueryTest.java
@@ -9,19 +9,28 @@
 //--------------------------------------
 package org.sqlite;
 
-import java.sql.*;
+import org.junit.jupiter.api.Test;
+import org.sqlite.date.FastDateFormat;
+
+import java.sql.Clob;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
 import java.util.Calendar;
 import java.util.Date;
 import java.util.Properties;
 import java.util.TimeZone;
 
-import org.junit.Test;
-import org.sqlite.date.FastDateFormat;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
 
-import static org.junit.Assert.*;
-
-public class QueryTest
-{
+public class QueryTest {
     public Connection getConnection() throws SQLException {
         return DriverManager.getConnection("jdbc:sqlite::memory:");
     }
@@ -30,10 +39,10 @@ public class QueryTest
     public void nullQuery() throws Exception {
         Connection conn = getConnection();
         Statement stmt = conn.createStatement();
-	try {
-		stmt.execute(null);
-	} catch (NullPointerException e) {
-	}
+        try {
+            stmt.execute(null);
+        } catch (NullPointerException e) {
+        }
         stmt.close();
         conn.close();
     }
@@ -49,8 +58,7 @@ public class QueryTest
         try {
             ResultSet rs = stmt.executeQuery("SELECT * FROM sample");
             rs.next();
-        }
-        catch (SQLException e) {
+        } catch (SQLException e) {
             e.printStackTrace();
         }
 
@@ -109,8 +117,7 @@ public class QueryTest
         try {
             statement = conn.createStatement();
             statement.execute("create table sample (date_time datetime)");
-        }
-        finally {
+        } finally {
             if (statement != null) statement.close();
         }
 
@@ -131,8 +138,7 @@ public class QueryTest
             preparedStatement.executeUpdate();
             preparedStatement.setDate(1, nowLikeCustomZoneIsUtc, utcCalendar);
             preparedStatement.executeUpdate();
-        }
-        finally {
+        } finally {
             if (preparedStatement != null) preparedStatement.close();
         }
 
@@ -146,8 +152,7 @@ public class QueryTest
             assertTrue(resultSet.next());
             assertEquals(now, resultSet.getDate(1, customCalendar));
             assertEquals(nowLikeCustomZoneIsUtc, resultSet.getDate(1, utcCalendar));
-        }
-        finally {
+        } finally {
             if (resultSet != null) resultSet.close();
         }
     }
@@ -250,20 +255,20 @@ public class QueryTest
             statement.executeUpdate("insert into mxp values(3,2,'T')");
 
             ResultSet rs = statement
-                    .executeQuery("select group_concat(ifnull(shortname, name)) from mxp, person where mxp.mid=2 and mxp.pid=person.id and mxp.type='T'");
+                .executeQuery("select group_concat(ifnull(shortname, name)) from mxp, person where mxp.mid=2 and mxp.pid=person.id and mxp.type='T'");
             while (rs.next()) {
                 // read the result set
                 assertEquals("Y,abc", rs.getString(1));
             }
             rs = statement
-                    .executeQuery("select group_concat(ifnull(shortname, name)) from mxp, person where mxp.mid=1 and mxp.pid=person.id and mxp.type='T'");
+                .executeQuery("select group_concat(ifnull(shortname, name)) from mxp, person where mxp.mid=1 and mxp.pid=person.id and mxp.type='T'");
             while (rs.next()) {
                 // read the result set
                 assertEquals("Y", rs.getString(1));
             }
 
             PreparedStatement ps = conn
-                    .prepareStatement("select group_concat(ifnull(shortname, name)) from mxp, person where mxp.mid=? and mxp.pid=person.id and mxp.type='T'");
+                .prepareStatement("select group_concat(ifnull(shortname, name)) from mxp, person where mxp.mid=? and mxp.pid=person.id and mxp.type='T'");
             ps.clearParameters();
             ps.setInt(1, new Integer(2));
             rs = ps.executeQuery();
@@ -279,18 +284,16 @@ public class QueryTest
                 assertEquals("Y,abc", rs.getString(1));
             }
 
-        }
-        catch (SQLException e) {
+        } catch (SQLException e) {
             // if the error message is "out of memory",
             // it probably means no database file is found
             System.err.println(e.getMessage());
-        }
-        finally {
+        } finally {
             try {
-                if (conn != null)
+                if (conn != null) {
                     conn.close();
-            }
-            catch (SQLException e) {
+                }
+            } catch (SQLException e) {
                 // connection close failed.
                 System.err.println(e);
             }
@@ -314,27 +317,23 @@ public class QueryTest
                     try {
                         clob.getSubString(0, length);
                         fail("SQLException expected because position is less than 1");
-                    }
-                    catch (SQLException ignore) {
+                    } catch (SQLException ignore) {
                     }
                     try {
                         clob.getSubString(1, -1);
                         fail("SQLException expected because length is less than 0");
-                    }
-                    catch (SQLException ignore) {
+                    } catch (SQLException ignore) {
                     }
                     assertEquals("", clob.getSubString(1, 0));
                     assertEquals(content, clob.getSubString(1, length));
                     assertEquals(content.substring(2, content.length() - 1), clob.getSubString(3, content.length() - 3));
-                }
-                finally {
+                } finally {
                     if (rs != null) rs.close();
                 }
             } finally {
                 if (stmt != null) stmt.close();
             }
-        }
-        finally {
+        } finally {
             if (conn != null) conn.close();
         }
     }
diff --git a/src/test/java/org/sqlite/RSMetaDataTest.java b/src/test/java/org/sqlite/RSMetaDataTest.java
index 8d2dac84..150f8e5e 100644
--- a/src/test/java/org/sqlite/RSMetaDataTest.java
+++ b/src/test/java/org/sqlite/RSMetaDataTest.java
@@ -1,8 +1,8 @@
 package org.sqlite;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 import java.sql.Connection;
 import java.sql.DriverManager;
@@ -12,44 +12,40 @@ import java.sql.SQLException;
 import java.sql.Statement;
 import java.sql.Types;
 
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
-public class RSMetaDataTest
-{
+public class RSMetaDataTest {
     private Connection conn;
     private Statement stat;
     private ResultSetMetaData meta;
 
-    @Before
-    public void connect() throws Exception
-    {
+    @BeforeEach
+    public void connect() throws Exception {
         conn = DriverManager.getConnection("jdbc:sqlite:");
         stat = conn.createStatement();
         stat.executeUpdate("create table People (pid integer primary key autoincrement, "
-                + " firstname string(255), surname string(25,5), dob date);");
+            + " firstname string(255), surname string(25,5), dob date);");
         stat.executeUpdate("insert into people values (null, 'Mohandas', 'Gandhi', " + " '1869-10-02');");
         meta = stat.executeQuery("select pid, firstname, surname from people;").getMetaData();
     }
 
-    @After
-    public void close() throws SQLException
-    {
+    @AfterEach
+    public void close() throws SQLException {
         stat.executeUpdate("drop table people;");
         stat.close();
         conn.close();
     }
 
     @Test
-    public void catalogName() throws SQLException
-    {
+    public void catalogName() throws SQLException {
         assertEquals(meta.getCatalogName(1), "People");
     }
 
     @Test
-    public void columns() throws SQLException
-    {
+    public void columns() throws SQLException {
         assertEquals(meta.getColumnCount(), 3);
         assertEquals(meta.getColumnName(1), "pid");
         assertEquals(meta.getColumnName(2), "firstname");
@@ -66,30 +62,29 @@ public class RSMetaDataTest
     }
 
     @Test
-    public void columnTypes() throws SQLException
-    {
+    public void columnTypes() throws SQLException {
         stat.executeUpdate(
             "create table tbl (col1 INT, col2 INTEGER, col3 TINYINT, " +
-            "col4 SMALLINT, col5 MEDIUMINT, col6 BIGINT, col7 UNSIGNED BIG INT, " +
-            "col8 INT2, col9 INT8, col10 CHARACTER(20), col11 VARCHAR(255), " +
-            "col12 VARYING CHARACTER(255), col13 NCHAR(55), " +
-            "col14 NATIVE CHARACTER(70), col15 NVARCHAR(100), col16 TEXT, " +
-            "col17 CLOB, col18 BLOB, col19 REAL, col20 DOUBLE, " +
-            "col21 DOUBLE PRECISION, col22 FLOAT, col23 NUMERIC, " +
-            "col24 DECIMAL(10,5), col25 BOOLEAN, col26 DATE, col27 DATETIME, " +
-            "col28 TIMESTAMP, col29 CHAR(70), col30 TEXT)"
+                "col4 SMALLINT, col5 MEDIUMINT, col6 BIGINT, col7 UNSIGNED BIG INT, " +
+                "col8 INT2, col9 INT8, col10 CHARACTER(20), col11 VARCHAR(255), " +
+                "col12 VARYING CHARACTER(255), col13 NCHAR(55), " +
+                "col14 NATIVE CHARACTER(70), col15 NVARCHAR(100), col16 TEXT, " +
+                "col17 CLOB, col18 BLOB, col19 REAL, col20 DOUBLE, " +
+                "col21 DOUBLE PRECISION, col22 FLOAT, col23 NUMERIC, " +
+                "col24 DECIMAL(10,5), col25 BOOLEAN, col26 DATE, col27 DATETIME, " +
+                "col28 TIMESTAMP, col29 CHAR(70), col30 TEXT)"
         );
         // insert empty data into table otherwise getColumnType returns null
         stat.executeUpdate(
             "insert into tbl values (1, 2, 3, 4, 5, 6, 7, 8, 9," +
-            "'c', 'varchar', 'varying', 'n', 'n','nvarchar', 'text', 'clob'," +
-            "null, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 0, 12345, 123456, 0, 'char', 'some text')");
+                "'c', 'varchar', 'varying', 'n', 'n','nvarchar', 'text', 'clob'," +
+                "null, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 0, 12345, 123456, 0, 'char', 'some text')");
         meta = stat.executeQuery(
             "select col1, col2, col3, col4, col5, col6, col7, col8, col9, " +
-            "col10, col11, col12, col13, col14, col15, col16, col17, col18, " +
-            "col19, col20, col21, col22, col23, col24, col25, col26, col27, " +
-            "col28, col29, col30, " +
-            "cast(col1 as boolean) from tbl"
+                "col10, col11, col12, col13, col14, col15, col16, col17, col18, " +
+                "col19, col20, col21, col22, col23, col24, col25, col26, col27, " +
+                "col28, col29, col30, " +
+                "cast(col1 as boolean) from tbl"
         ).getMetaData();
 
         assertEquals(Types.INTEGER, meta.getColumnType(1));
@@ -126,7 +121,7 @@ public class RSMetaDataTest
 
         assertEquals(Types.TIMESTAMP, meta.getColumnType(28));
         assertEquals(Types.CHAR, meta.getColumnType(29));
-        
+
         assertEquals(Types.VARCHAR, meta.getColumnType(30));
 
         assertEquals(Types.BOOLEAN, meta.getColumnType(31));
@@ -136,8 +131,7 @@ public class RSMetaDataTest
     }
 
     @Test
-    public void differentRS() throws SQLException
-    {
+    public void differentRS() throws SQLException {
         meta = stat.executeQuery("select * from people;").getMetaData();
         assertEquals(meta.getColumnCount(), 4);
         assertEquals(meta.getColumnName(1), "pid");
@@ -147,37 +141,32 @@ public class RSMetaDataTest
     }
 
     @Test
-    public void nullable() throws SQLException
-    {
+    public void nullable() throws SQLException {
         meta = stat.executeQuery("select null;").getMetaData();
         assertEquals(meta.isNullable(1), ResultSetMetaData.columnNullable);
     }
 
-    @Test(expected = SQLException.class)
-    public void badCatalogIndex() throws SQLException
-    {
-        meta.getCatalogName(4);
+    @Test
+    public void badCatalogIndex() {
+        assertThrows(SQLException.class, () -> meta.getCatalogName(4));
     }
 
-    @Test(expected = SQLException.class)
-    public void badColumnIndex() throws SQLException
-    {
-        meta.getColumnName(4);
+    @Test
+    public void badColumnIndex() {
+        assertThrows(SQLException.class, () -> meta.getColumnName(4));
     }
 
     @Test
-    public void scale() throws SQLException 
-    {
+    public void scale() throws SQLException {
         assertEquals(0, meta.getScale(2));
         assertEquals(5, meta.getScale(3));
     }
-	
-	@Test
-	public void tableName() throws SQLException
-	{
-		final ResultSet rs = stat.executeQuery( "SELECT pid, time(dob) as some_time from people");
-		assertEquals( "People", rs.getMetaData().getTableName( 1));
-		assertEquals( "", rs.getMetaData().getTableName( 2));
-		rs.close();
-	}
+
+    @Test
+    public void tableName() throws SQLException {
+        final ResultSet rs = stat.executeQuery("SELECT pid, time(dob) as some_time from people");
+        assertEquals("People", rs.getMetaData().getTableName(1));
+        assertEquals("", rs.getMetaData().getTableName(2));
+        rs.close();
+    }
 }
diff --git a/src/test/java/org/sqlite/ReadUncommittedTest.java b/src/test/java/org/sqlite/ReadUncommittedTest.java
index 5fd2bd20..59efe196 100644
--- a/src/test/java/org/sqlite/ReadUncommittedTest.java
+++ b/src/test/java/org/sqlite/ReadUncommittedTest.java
@@ -9,27 +9,24 @@
 //--------------------------------------
 package org.sqlite;
 
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
 import java.sql.Connection;
 import java.sql.DriverManager;
 import java.sql.SQLException;
 import java.sql.Statement;
 import java.util.Properties;
 
-import org.junit.After;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
-public class ReadUncommittedTest
-{
+public class ReadUncommittedTest {
     private Connection conn;
     private Statement stat;
 
-    @Before
-    public void connect() throws Exception
-    {
+    @BeforeEach
+    public void connect() throws Exception {
         Properties prop = new Properties();
         prop.setProperty("shared_cache", "true");
         conn = DriverManager.getConnection("jdbc:sqlite:", prop);
@@ -38,52 +35,47 @@ public class ReadUncommittedTest
         stat.executeUpdate("create view testView as select * from test;");
     }
 
-    @After
-    public void close() throws SQLException
-    {
+    @AfterEach
+    public void close() throws SQLException {
         stat.close();
         conn.close();
     }
 
     @Test
-    public void setReadUncommitted() throws SQLException
-    {
+    public void setReadUncommitted() throws SQLException {
         conn.setTransactionIsolation(SQLiteConnection.TRANSACTION_READ_UNCOMMITTED);
     }
 
     @Test
-    public void setSerializable() throws SQLException
-    {
+    public void setSerializable() throws SQLException {
         conn.setTransactionIsolation(SQLiteConnection.TRANSACTION_SERIALIZABLE);
     }
 
     @Test
-    public void setIsolationPromotedToSerializable() throws SQLException
-    {
+    public void setIsolationPromotedToSerializable() throws SQLException {
         conn.setTransactionIsolation(SQLiteConnection.TRANSACTION_REPEATABLE_READ);
     }
 
     @Test
-    public void setReadUncommittedWithConfig() throws SQLException
-    {
+    public void setReadUncommittedWithConfig() throws SQLException {
         // Override original setup
         Properties prop = new Properties();
         prop.setProperty("shared_cache", "true");
         conn = DriverManager.getConnection("jdbc:sqlite:", prop);
         stat = conn.createStatement();
-        assertEquals("Fail to set pragma read_uncommitted", "0",
-            stat.executeQuery("PRAGMA read_uncommitted;").getString(1));
+        assertEquals(stat.executeQuery("PRAGMA read_uncommitted;").getString(1), "0",
+            "Fail to set pragma read_uncommitted");
 
         prop.setProperty("read_uncommitted", "true");
         conn = DriverManager.getConnection("jdbc:sqlite:", prop);
         stat = conn.createStatement();
-        assertEquals("Fail to set pragma read_uncommitted", "1",
-            stat.executeQuery("PRAGMA read_uncommitted;").getString(1));
+        assertEquals("1", stat.executeQuery("PRAGMA read_uncommitted;").getString(1),
+            "Fail to set pragma read_uncommitted");
 
         prop.setProperty("read_uncommitted", "false");
         conn = DriverManager.getConnection("jdbc:sqlite:", prop);
         stat = conn.createStatement();
-        assertEquals("Fail to set pragma read_uncommitted", "0",
-            stat.executeQuery("PRAGMA read_uncommitted;").getString(1));
+        assertEquals("0", stat.executeQuery("PRAGMA read_uncommitted;").getString(1),
+            "Fail to set pragma read_uncommitted");
     }
 }
diff --git a/src/test/java/org/sqlite/ResultSetTest.java b/src/test/java/org/sqlite/ResultSetTest.java
index 8e106f25..b907f850 100644
--- a/src/test/java/org/sqlite/ResultSetTest.java
+++ b/src/test/java/org/sqlite/ResultSetTest.java
@@ -1,8 +1,8 @@
 package org.sqlite;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
 
 import java.sql.Connection;
 import java.sql.DriverManager;
@@ -10,16 +10,18 @@ import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.sql.Statement;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 public class ResultSetTest {
 
     private Connection conn;
     private Statement stat;
 
-    @Before
+    @BeforeEach
     public void connect() throws Exception {
         conn = DriverManager.getConnection("jdbc:sqlite:");
         stat = conn.createStatement();
@@ -27,7 +29,7 @@ public class ResultSetTest {
         stat.executeUpdate("insert into test values (1, 'description', 'bar')");
     }
 
-    @After
+    @AfterEach
     public void close() throws SQLException {
         stat.close();
         conn.close();
@@ -35,7 +37,7 @@ public class ResultSetTest {
 
     @Test
     public void testTableColumnLowerNowFindLowerCaseColumn()
-            throws SQLException {
+        throws SQLException {
         ResultSet resultSet = stat.executeQuery("select * from test");
         assertTrue(resultSet.next());
         assertEquals(1, resultSet.findColumn("id"));
@@ -43,7 +45,7 @@ public class ResultSetTest {
 
     @Test
     public void testTableColumnLowerNowFindUpperCaseColumn()
-            throws SQLException {
+        throws SQLException {
         ResultSet resultSet = stat.executeQuery("select * from test");
         assertTrue(resultSet.next());
         assertEquals(1, resultSet.findColumn("ID"));
@@ -51,7 +53,7 @@ public class ResultSetTest {
 
     @Test
     public void testTableColumnLowerNowFindMixedCaseColumn()
-            throws SQLException {
+        throws SQLException {
         ResultSet resultSet = stat.executeQuery("select * from test");
         assertTrue(resultSet.next());
         assertEquals(1, resultSet.findColumn("Id"));
@@ -59,7 +61,7 @@ public class ResultSetTest {
 
     @Test
     public void testTableColumnUpperNowFindLowerCaseColumn()
-            throws SQLException {
+        throws SQLException {
         ResultSet resultSet = stat.executeQuery("select * from test");
         assertTrue(resultSet.next());
         assertEquals(2, resultSet.findColumn("description"));
@@ -67,7 +69,7 @@ public class ResultSetTest {
 
     @Test
     public void testTableColumnUpperNowFindUpperCaseColumn()
-            throws SQLException {
+        throws SQLException {
         ResultSet resultSet = stat.executeQuery("select * from test");
         assertTrue(resultSet.next());
         assertEquals(2, resultSet.findColumn("DESCRIPTION"));
@@ -75,7 +77,7 @@ public class ResultSetTest {
 
     @Test
     public void testTableColumnUpperNowFindMixedCaseColumn()
-            throws SQLException {
+        throws SQLException {
         ResultSet resultSet = stat.executeQuery("select * from test");
         assertTrue(resultSet.next());
         assertEquals(2, resultSet.findColumn("Description"));
@@ -83,7 +85,7 @@ public class ResultSetTest {
 
     @Test
     public void testTableColumnMixedNowFindLowerCaseColumn()
-            throws SQLException {
+        throws SQLException {
         ResultSet resultSet = stat.executeQuery("select * from test");
         assertTrue(resultSet.next());
         assertEquals(3, resultSet.findColumn("foo"));
@@ -91,7 +93,7 @@ public class ResultSetTest {
 
     @Test
     public void testTableColumnMixedNowFindUpperCaseColumn()
-            throws SQLException {
+        throws SQLException {
         ResultSet resultSet = stat.executeQuery("select * from test");
         assertTrue(resultSet.next());
         assertEquals(3, resultSet.findColumn("FOO"));
@@ -99,7 +101,7 @@ public class ResultSetTest {
 
     @Test
     public void testTableColumnMixedNowFindMixedCaseColumn()
-            throws SQLException {
+        throws SQLException {
         ResultSet resultSet = stat.executeQuery("select * from test");
         assertTrue(resultSet.next());
         assertEquals(3, resultSet.findColumn("fOo"));
@@ -107,7 +109,7 @@ public class ResultSetTest {
 
     @Test
     public void testSelectWithTableNameAliasNowFindWithoutTableNameAlias()
-            throws SQLException {
+        throws SQLException {
         ResultSet resultSet = stat.executeQuery("select t.id from test as t");
         assertTrue(resultSet.next());
         assertEquals(1, resultSet.findColumn("id"));
@@ -118,28 +120,28 @@ public class ResultSetTest {
      * https://www.sqlite.org/c3ref/column_name.html :
      * "If there is no AS clause then the name of the column is unspecified"
      */
-    @Test(expected = SQLException.class)
+    @Test
     public void testSelectWithTableNameAliasNowNotFindWithTableNameAlias()
-            throws SQLException {
+        throws SQLException {
         ResultSet resultSet = stat.executeQuery("select t.id from test as t");
         assertTrue(resultSet.next());
-        resultSet.findColumn("t.id");
+        assertThrows(SQLException.class, () -> resultSet.findColumn("t.id"));
     }
 
     @Test
     public void testSelectWithTableNameNowFindWithoutTableName()
-            throws SQLException {
+        throws SQLException {
         ResultSet resultSet = stat.executeQuery("select test.id from test");
         assertTrue(resultSet.next());
         assertEquals(1, resultSet.findColumn("id"));
     }
 
-    @Test(expected = SQLException.class)
+    @Test
     public void testSelectWithTableNameNowNotFindWithTableName()
-            throws SQLException {
+        throws SQLException {
         ResultSet resultSet = stat.executeQuery("select test.id from test");
         assertTrue(resultSet.next());
-        resultSet.findColumn("test.id");
+        assertThrows(SQLException.class, () -> resultSet.findColumn("test.id"));
     }
 
     @Test
diff --git a/src/test/java/org/sqlite/SQLiteConfigTest.java b/src/test/java/org/sqlite/SQLiteConfigTest.java
index 8b3a3ae6..0eb5e5a4 100644
--- a/src/test/java/org/sqlite/SQLiteConfigTest.java
+++ b/src/test/java/org/sqlite/SQLiteConfigTest.java
@@ -1,17 +1,16 @@
 package org.sqlite;
 
-import static org.junit.Assert.*;
+import org.junit.jupiter.api.Test;
 
 import java.sql.SQLException;
 import java.util.Properties;
 
-import org.junit.Test;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 public class SQLiteConfigTest {
 
     @Test
-    public void toProperites() throws SQLException
-    {
+    public void toProperites() throws SQLException {
         SQLiteConfig config = new SQLiteConfig();
 
         config.setReadOnly(true);
diff --git a/src/test/java/org/sqlite/SQLiteConnectionPoolDataSourceTest.java b/src/test/java/org/sqlite/SQLiteConnectionPoolDataSourceTest.java
index de864708..89e55ae2 100644
--- a/src/test/java/org/sqlite/SQLiteConnectionPoolDataSourceTest.java
+++ b/src/test/java/org/sqlite/SQLiteConnectionPoolDataSourceTest.java
@@ -13,29 +13,26 @@
  *--------------------------------------------------------------------------*/
 package org.sqlite;
 
-import org.junit.Ignore;
-import org.junit.Test;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
 import org.sqlite.javax.SQLiteConnectionPoolDataSource;
 
 import javax.sql.ConnectionPoolDataSource;
 import javax.sql.PooledConnection;
-
 import java.sql.Connection;
 import java.sql.SQLException;
 import java.sql.Statement;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
 
-public class SQLiteConnectionPoolDataSourceTest
-{
+public class SQLiteConnectionPoolDataSourceTest {
 
     @Test
     public void connectionTest()
-            throws SQLException
-    {
+        throws SQLException {
         ConnectionPoolDataSource ds = new SQLiteConnectionPoolDataSource();
 
         PooledConnection pooledConn = ds.getPooledConnection();
@@ -49,8 +46,7 @@ public class SQLiteConnectionPoolDataSourceTest
         try {
             handle.createStatement().execute("select 1");
             fail();
-        }
-        catch (SQLException e) {
+        } catch (SQLException e) {
             assertEquals("Connection is closed", e.getMessage());
         }
 
@@ -64,11 +60,10 @@ public class SQLiteConnectionPoolDataSourceTest
         assertTrue(handle.isClosed());
     }
 
-    @Ignore
+    @Disabled
     @Test
     public void proxyConnectionCloseTest()
-            throws SQLException
-    {
+        throws SQLException {
         ConnectionPoolDataSource ds = new SQLiteConnectionPoolDataSource();
         PooledConnection pooledConn = ds.getPooledConnection();
         System.out.println("pooledConn: " + pooledConn.getClass());
diff --git a/src/test/java/org/sqlite/SQLiteDataSourceTest.java b/src/test/java/org/sqlite/SQLiteDataSourceTest.java
index 05a14969..b7c0c6a1 100755
--- a/src/test/java/org/sqlite/SQLiteDataSourceTest.java
+++ b/src/test/java/org/sqlite/SQLiteDataSourceTest.java
@@ -9,26 +9,26 @@
 //--------------------------------------
 package org.sqlite;
 
-import static org.junit.Assert.*;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 import java.nio.ByteOrder;
-
 import java.sql.Connection;
 import java.sql.ResultSet;
 import java.sql.Statement;
 
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
-public class SQLiteDataSourceTest
-{
+public class SQLiteDataSourceTest {
 
-    @Before
-    public void setUp() throws Exception {}
+    @BeforeEach
+    public void setUp() throws Exception {
+    }
 
-    @After
-    public void tearDown() throws Exception {}
+    @AfterEach
+    public void tearDown() throws Exception {
+    }
 
     @Test
     public void enumParam() throws Exception {
@@ -51,8 +51,7 @@ public class SQLiteDataSourceTest
             }
             assertEquals(1, count);
 
-        }
-        finally {
+        } finally {
             stat.close();
             conn.close();
         }
@@ -63,10 +62,10 @@ public class SQLiteDataSourceTest
     public void encoding() throws Exception {
 
         String[] configArray = new String[] {
-                "UTF8", "UTF-8", "UTF_8",
-                "UTF16", "UTF-16", "UTF_16",
-                "UTF_16LE", "UTF-16LE", "UTF16_LITTLE_ENDIAN",
-                "UTF_16BE", "UTF-16BE","UTF16_BIG_ENDIAN" };
+            "UTF8", "UTF-8", "UTF_8",
+            "UTF16", "UTF-16", "UTF_16",
+            "UTF_16LE", "UTF-16LE", "UTF16_LITTLE_ENDIAN",
+            "UTF_16BE", "UTF-16BE", "UTF16_BIG_ENDIAN"};
 
         String nativeOrder;
         if (ByteOrder.nativeOrder().equals(ByteOrder.LITTLE_ENDIAN)) {
@@ -75,7 +74,7 @@ public class SQLiteDataSourceTest
             nativeOrder = "be";
         }
         String[] encodingArray = new String[] {
-                "UTF-8", "UTF-16" + nativeOrder, "UTF-16le", "UTF-16be" };
+            "UTF-8", "UTF-16" + nativeOrder, "UTF-16le", "UTF-16be"};
 
         for (int i = 0; i < configArray.length; i++) {
             SQLiteDataSource ds = new SQLiteDataSource();
diff --git a/src/test/java/org/sqlite/SQLiteJDBCLoaderTest.java b/src/test/java/org/sqlite/SQLiteJDBCLoaderTest.java
index e71e2fda..fc9eabe7 100644
--- a/src/test/java/org/sqlite/SQLiteJDBCLoaderTest.java
+++ b/src/test/java/org/sqlite/SQLiteJDBCLoaderTest.java
@@ -24,9 +24,9 @@
 //--------------------------------------
 package org.sqlite;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 import java.io.BufferedInputStream;
 import java.io.File;
@@ -49,36 +49,31 @@ import java.util.concurrent.atomic.AtomicInteger;
 import java.util.jar.JarEntry;
 import java.util.jar.JarOutputStream;
 
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
 
-public class SQLiteJDBCLoaderTest
-{
+public class SQLiteJDBCLoaderTest {
 
     private Connection connection = null;
 
-    @Before
-    public void setUp() throws Exception
-    {
+    @BeforeEach
+    public void setUp() throws Exception {
         connection = null;
         // create a database connection
         connection = DriverManager.getConnection("jdbc:sqlite::memory:");
     }
 
-    @After
-    public void tearDown() throws Exception
-    {
-        if (connection != null)
+    @AfterEach
+    public void tearDown() throws Exception {
+        if (connection != null) {
             connection.close();
+        }
     }
 
     @Test
-    public void query() throws ClassNotFoundException
-    {
-        try
-        {
+    public void query() throws ClassNotFoundException {
+        try {
             Statement statement = connection.createStatement();
             statement.setQueryTimeout(30); // set timeout to 30 sec.
 
@@ -87,15 +82,12 @@ public class SQLiteJDBCLoaderTest
             statement.executeUpdate("insert into person values(2, 'yui')");
 
             ResultSet rs = statement.executeQuery("select * from person order by id");
-            while (rs.next())
-            {
+            while (rs.next()) {
                 // read the result set
                 rs.getInt(1);
                 rs.getString(2);
             }
-        }
-        catch (SQLException e)
-        {
+        } catch (SQLException e) {
             // if e.getMessage() is "out of memory", it probably means no
             // database file is found
             fail(e.getMessage());
@@ -103,15 +95,14 @@ public class SQLiteJDBCLoaderTest
     }
 
     @Test
-    public void function() throws SQLException
-    {
+    public void function() throws SQLException {
         Function.create(connection, "total", new Function() {
             @Override
-            protected void xFunc() throws SQLException
-            {
+            protected void xFunc() throws SQLException {
                 int sum = 0;
-                for (int i = 0; i < args(); i++)
+                for (int i = 0; i < args(); i++) {
                     sum += value_int(i);
+                }
                 result(sum);
             }
         });
@@ -122,9 +113,8 @@ public class SQLiteJDBCLoaderTest
     }
 
     @Test
-    public void version()
-    {
-    // System.out.println(SQLiteJDBCLoader.getVersion());
+    public void version() {
+        // System.out.println(SQLiteJDBCLoader.getVersion());
     }
 
     @Test
@@ -147,7 +137,7 @@ public class SQLiteJDBCLoaderTest
                         //}
                     } catch (SQLException e) {
                         e.printStackTrace();
-                        Assert.fail(e.getLocalizedMessage());
+                        fail(e.getLocalizedMessage());
                     }
                     completedThreads.incrementAndGet();
                 }
@@ -162,9 +152,9 @@ public class SQLiteJDBCLoaderTest
     public void multipleClassLoader() throws Throwable {
         // Get current classpath
         String[] stringUrls = System.getProperty("java.class.path")
-                .split(System.getProperty("path.separator"));
+            .split(System.getProperty("path.separator"));
         // Find the classes under test.
-        String targetFolderName = Paths.get("").toAbsolutePath().resolve(Paths.get("target","classes")).toString();
+        String targetFolderName = Paths.get("").toAbsolutePath().resolve(Paths.get("target", "classes")).toString();
         File classesDir = null;
         String classesDirPrefix = null;
         for (String stringUrl : stringUrls) {
@@ -176,12 +166,12 @@ public class SQLiteJDBCLoaderTest
             }
         }
         if (classesDir == null) {
-            Assert.fail("Couldn't find classes under test.");
+            fail("Couldn't find classes under test.");
         }
         // Create a JAR file out the classes and resources
         File jarFile = File.createTempFile("jar-for-test-", ".jar");
         createJar(classesDir, classesDirPrefix, jarFile);
-        URL[] jarUrl = new URL[] { jarFile.toPath().toUri().toURL() };
+        URL[] jarUrl = new URL[] {jarFile.toPath().toUri().toURL()};
 
         final AtomicInteger completedThreads = new AtomicInteger(0);
         ExecutorService pool = Executors.newFixedThreadPool(4);
@@ -193,15 +183,15 @@ public class SQLiteJDBCLoaderTest
                     // Create an isolated class loader, it should load *different* instances
                     // of SQLiteJDBCLoader.class
                     URLClassLoader classLoader = new URLClassLoader(
-                            jarUrl, ClassLoader.getSystemClassLoader().getParent());
+                        jarUrl, ClassLoader.getSystemClassLoader().getParent());
                     Class<?> clazz =
-                            classLoader.loadClass("org.sqlite.SQLiteJDBCLoader");
+                        classLoader.loadClass("org.sqlite.SQLiteJDBCLoader");
                     Method initMethod = clazz.getDeclaredMethod("initialize");
                     initMethod.invoke(null);
                     classLoader.close();
                 } catch (Throwable e) {
                     e.printStackTrace();
-                    Assert.fail(e.getLocalizedMessage());
+                    fail(e.getLocalizedMessage());
                 }
                 completedThreads.incrementAndGet();
             });
@@ -238,7 +228,7 @@ public class SQLiteJDBCLoaderTest
             }
 
             JarEntry entry = new JarEntry(
-                    source.getPath().replace("\\", "/").substring(changeDir.length() + 1));
+                source.getPath().replace("\\", "/").substring(changeDir.length() + 1));
             entry.setTime(source.lastModified());
             target.putNextEntry(entry);
             in = new BufferedInputStream(new FileInputStream(source));
diff --git a/src/test/java/org/sqlite/SavepointTest.java b/src/test/java/org/sqlite/SavepointTest.java
index 904fed18..5c972daf 100644
--- a/src/test/java/org/sqlite/SavepointTest.java
+++ b/src/test/java/org/sqlite/SavepointTest.java
@@ -1,8 +1,9 @@
 package org.sqlite;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 import java.io.File;
 import java.sql.Connection;
@@ -14,32 +15,30 @@ import java.sql.Savepoint;
 import java.sql.Statement;
 import java.util.Properties;
 
-import org.junit.After;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 /**
  * These tests assume that Statements and PreparedStatements are working as per
  * normal and test the interactions of commit(), setSavepoint(), setSavepoint(String),
  * rollback(Savepoint), and release(Savepoint).
  */
-public class SavepointTest
-{
+public class SavepointTest {
     private Connection conn1, conn2;
-    private Statement  stat1, stat2;
+    private Statement stat1, stat2;
 
-    boolean            done = false;
+    boolean done = false;
 
-    @BeforeClass
+    @BeforeAll
     public static void forName() throws Exception {
         System.out.println("running in " + (SQLiteJDBCLoader.isNativeMode() ? "native" : "pure-java") + " mode");
     }
 
-    @Before
+    @BeforeEach
     public void connect() throws Exception {
         File tmpFile = File.createTempFile("test-trans", ".db");
-	// tmpFile.deleteOnExit();
+        // tmpFile.deleteOnExit();
 
         Properties prop = new Properties();
         prop.setProperty("shared_cache", "false");
@@ -51,7 +50,7 @@ public class SavepointTest
         stat2 = conn2.createStatement();
     }
 
-    @After
+    @AfterEach
     public void close() throws Exception {
         stat1.close();
         stat2.close();
diff --git a/src/test/java/org/sqlite/StatementTest.java b/src/test/java/org/sqlite/StatementTest.java
index 839d94ea..c917efc8 100644
--- a/src/test/java/org/sqlite/StatementTest.java
+++ b/src/test/java/org/sqlite/StatementTest.java
@@ -1,6 +1,11 @@
 package org.sqlite;
 
-import static org.junit.Assert.*;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+import org.sqlite.jdbc3.JDBC3Statement;
+import org.sqlite.jdbc4.JDBC4Statement;
 
 import java.io.UnsupportedEncodingException;
 import java.lang.reflect.Method;
@@ -13,26 +18,28 @@ import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.sql.Statement;
 
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.sqlite.jdbc3.JDBC3Statement;
-import org.sqlite.jdbc4.JDBC4Statement;
-
-/** These tests are designed to stress Statements on memory databases. */
-public class StatementTest
-{
+import static org.junit.jupiter.api.Assertions.assertArrayEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+/**
+ * These tests are designed to stress Statements on memory databases.
+ */
+public class StatementTest {
     private Connection conn;
-    private Statement  stat;
+    private Statement stat;
 
-    @Before
+    @BeforeEach
     public void connect() throws Exception {
         conn = DriverManager.getConnection("jdbc:sqlite:");
         stat = conn.createStatement();
     }
 
-    @After
+    @AfterEach
     public void close() throws SQLException {
         stat.close();
         conn.close();
@@ -51,17 +58,17 @@ public class StatementTest
         // multiple SQL statements
         assertEquals(
             stat.executeUpdate("insert into s1 values (11);" +
-                               "insert into s1 values (12)"),
+                "insert into s1 values (12)"),
             2);
         assertEquals(
             stat.executeUpdate("update s1 set c1 = 21 where c1 = 11;" +
-                               "update s1 set c1 = 22 where c1 = 12;" +
-                               "update s1 set c1 = 23 where c1 = 13"),
+                "update s1 set c1 = 22 where c1 = 12;" +
+                "update s1 set c1 = 23 where c1 = 13"),
             2); // c1 = 13 does not exist
         assertEquals(
             stat.executeUpdate("delete from s1 where c1 = 21;" +
-                               "delete from s1 where c1 = 22;" +
-                               "delete from s1 where c1 = 23"),
+                "delete from s1 where c1 = 22;" +
+                "delete from s1 where c1 = 23"),
             2); // c1 = 23 does not exist
 
         assertEquals(stat.executeUpdate("drop table s1;"), 0);
@@ -196,8 +203,9 @@ public class StatementTest
     public void insert1000() throws SQLException {
         assertEquals(stat.executeUpdate("create table in1000 (a);"), 0);
         conn.setAutoCommit(false);
-        for (int i = 0; i < 1000; i++)
+        for (int i = 0; i < 1000; i++) {
             assertEquals(stat.executeUpdate("insert into in1000 values (" + i + ");"), 1);
+        }
         conn.commit();
 
         ResultSet rs = stat.executeQuery("select count(a) from in1000;");
@@ -212,8 +220,9 @@ public class StatementTest
         assertNotNull(a);
         assertNotNull(b);
         assertEquals(a.length, b.length);
-        for (int i = 0; i < a.length; i++)
+        for (int i = 0; i < a.length; i++) {
             assertEquals(a[i], b[i]);
+        }
     }
 
     @Test
@@ -224,16 +233,16 @@ public class StatementTest
         stat.addBatch("insert into batch values (2);");
         stat.addBatch("insert into batch values (3);");
         stat.addBatch("insert into batch values (4);");
-        assertArrayEq(new int[] { 0, 1, 1, 1, 1, 1 }, stat.executeBatch());
+        assertArrayEq(new int[] {0, 1, 1, 1, 1, 1}, stat.executeBatch());
         assertArrayEq(new int[] {}, stat.executeBatch());
         stat.clearBatch();
         stat.addBatch("insert into batch values (9);");
-        assertArrayEq(new int[] { 1 }, stat.executeBatch());
+        assertArrayEq(new int[] {1}, stat.executeBatch());
         assertArrayEq(new int[] {}, stat.executeBatch());
         stat.clearBatch();
         stat.addBatch("insert into batch values (7);");
         stat.addBatch("insert into batch values (7);");
-        assertArrayEq(new int[] { 1, 1 }, stat.executeBatch());
+        assertArrayEq(new int[] {1, 1}, stat.executeBatch());
         stat.clearBatch();
 
         ResultSet rs = stat.executeQuery("select count(*) from batch;");
@@ -266,7 +275,7 @@ public class StatementTest
 
         // closing one statement shouldn't close shared db metadata object.
         stat.close();
-        Statement stat2  = conn.createStatement();
+        Statement stat2 = conn.createStatement();
         rs = stat2.getGeneratedKeys();
         assertNotNull(rs);
         rs.close();
@@ -305,13 +314,13 @@ public class StatementTest
     public void nullDate() throws SQLException {
         ResultSet rs = stat.executeQuery("select null;");
         assertTrue(rs.next());
-        assertEquals(rs.getDate(1), null);
-        assertEquals(rs.getTime(1), null);
+        assertNull(rs.getDate(1));
+        assertNull(rs.getTime(1));
         rs.close();
     }
 
-    @Ignore
-    @Test(expected = SQLException.class)
+    @Disabled
+    @Test
     public void ambiguousColumnNaming() throws SQLException {
         stat.executeUpdate("create table t1 (c1 int);");
         stat.executeUpdate("create table t2 (c1 int, c2 int);");
@@ -323,50 +332,49 @@ public class StatementTest
         rs.close();
     }
 
-    @Test(expected = SQLException.class)
+    @Test
     public void failToDropWhenRSOpen() throws SQLException {
         stat.executeUpdate("create table t1 (c1);");
         stat.executeUpdate("insert into t1 values (4);");
         stat.executeUpdate("insert into t1 values (4);");
         conn.createStatement().executeQuery("select * from t1;").next();
-        stat.executeUpdate("drop table t1;");
+        assertThrows(SQLException.class, () -> stat.executeUpdate("drop table t1;"));
     }
 
-    @Test(expected = SQLException.class)
-    public void executeNoRS() throws SQLException {
-        assertFalse(stat.execute("insert into test values (8);"));
-        stat.getResultSet();
+    @Test
+    public void executeNoRS() {
+        assertThrows(SQLException.class, () -> stat.execute("insert into test values (8);"));
     }
 
-    @Test(expected = SQLException.class)
+    @Test
     public void executeClearRS() throws SQLException {
         assertTrue(stat.execute("select null;"));
         assertNotNull(stat.getResultSet());
         assertFalse(stat.getMoreResults());
-        stat.getResultSet();
+        assertThrows(SQLException.class, () -> stat.getResultSet());
     }
 
-    @Test(expected = BatchUpdateException.class)
+    @Test
     public void batchReturnsResults() throws SQLException {
         stat.addBatch("select null;");
-        stat.executeBatch();
+        assertThrows(BatchUpdateException.class, () -> stat.executeBatch());
     }
 
-    @Test(expected = SQLException.class)
-    public void noSuchTable() throws SQLException {
-        stat.executeQuery("select * from doesnotexist;");
+    @Test
+    public void noSuchTable() {
+        assertThrows(SQLException.class, () -> stat.executeQuery("select * from doesnotexist;"));
     }
 
-    @Test(expected = SQLException.class)
-    public void noSuchCol() throws SQLException {
-        stat.executeQuery("select notacol from (select 1);");
+    @Test
+    public void noSuchCol() {
+        assertThrows(SQLException.class, () -> stat.executeQuery("select notacol from (select 1);"));
     }
 
-    @Test(expected = SQLException.class)
+    @Test
     public void noSuchColName() throws SQLException {
         ResultSet rs = stat.executeQuery("select 1;");
         assertTrue(rs.next());
-        rs.getInt("noSuchColName");
+        assertThrows(SQLException.class, () -> rs.getInt("noSuchColName"));
     }
 
     @Test
@@ -388,26 +396,26 @@ public class StatementTest
     public void bytesTest() throws SQLException, UnsupportedEncodingException {
         stat.executeUpdate("CREATE TABLE blobs (Blob BLOB)");
         PreparedStatement prep = conn.prepareStatement("insert into blobs values(?)");
-        
+
         String str = "This is a test";
         byte[] strBytes = str.getBytes("UTF-8");
-        
+
         prep.setBytes(1, strBytes);
         prep.executeUpdate();
-        
+
         ResultSet rs = stat.executeQuery("select * from blobs");
         assertTrue(rs.next());
 
         byte[] resultBytes = rs.getBytes(1);
         assertArrayEquals(strBytes, resultBytes);
-        
+
         String resultStr = rs.getString(1);
         assertEquals(str, resultStr);
 
         byte[] resultBytesAfterConversionToString = rs.getBytes(1);
         assertArrayEquals(strBytes, resultBytesAfterConversionToString);
     }
-    
+
     @Test
     public void dateTimeTest() throws SQLException {
         Date day = new Date(new java.util.Date().getTime());
@@ -421,7 +429,7 @@ public class StatementTest
         Date d = rs.getDate(1);
         assertEquals(day.getTime(), d.getTime());
     }
-    
+
     @Test
     public void defaultDateTimeTest() throws SQLException {
         stat.executeUpdate("create table daywithdefaultdatetime (id integer, datetime datatime default current_timestamp)");
@@ -461,34 +469,35 @@ public class StatementTest
         stat.setEscapeProcessing(false);
     }
 
-    @Test(expected=SQLException.class)
+    @Test
     public void setEscapeProcessingToTrue() throws SQLException {
-        stat.setEscapeProcessing(true);
+        assertThrows(SQLException.class, () -> stat.setEscapeProcessing(true));
     }
 
     @Test
     public void unwrapTest() throws SQLException {
-        assertTrue( conn.isWrapperFor(Connection.class) );
-        assertFalse( conn.isWrapperFor(Statement.class) );
-        assertEquals( conn, conn.unwrap(Connection.class) );
-        assertEquals( conn, conn.unwrap(SQLiteConnection.class) );
+        assertTrue(conn.isWrapperFor(Connection.class));
+        assertFalse(conn.isWrapperFor(Statement.class));
+        assertEquals(conn, conn.unwrap(Connection.class));
+        assertEquals(conn, conn.unwrap(SQLiteConnection.class));
 
-        assertTrue( stat.isWrapperFor(Statement.class) );
-        assertEquals( stat, stat.unwrap(Statement.class) );
-        assertEquals( stat, stat.unwrap(JDBC3Statement.class) );
+        assertTrue(stat.isWrapperFor(Statement.class));
+        assertEquals(stat, stat.unwrap(Statement.class));
+        assertEquals(stat, stat.unwrap(JDBC3Statement.class));
 
         ResultSet rs = stat.executeQuery("select 1");
 
-        assertTrue( rs.isWrapperFor(ResultSet.class) );
-        assertEquals( rs, rs.unwrap(ResultSet.class) );
+        assertTrue(rs.isWrapperFor(ResultSet.class));
+        assertEquals(rs, rs.unwrap(ResultSet.class));
 
         rs.close();
     }
 
     @Test
     public void closeOnCompletionTest() throws Exception {
-        if ( ! (stat instanceof JDBC4Statement) )
+        if (!(stat instanceof JDBC4Statement)) {
             return;
+        }
 
         // Run the following code only for JDK7 or higher
         Method mIsCloseOnCompletion = JDBC4Statement.class.getDeclaredMethod("isCloseOnCompletion");
@@ -501,7 +510,7 @@ public class StatementTest
         ResultSet rs = stat.executeQuery("select 1");
         rs.close();
 
-        assertTrue( stat.isClosed() );
+        assertTrue(stat.isClosed());
     }
 
     @Test
@@ -511,9 +520,9 @@ public class StatementTest
         stat.setFetchDirection(ResultSet.FETCH_UNKNOWN);
     }
 
-    @Test(expected = SQLException.class)
-    public void setFetchDirectionBadArgument() throws SQLException {
-        stat.setFetchDirection(999);
+    @Test
+    public void setFetchDirectionBadArgument() {
+        assertThrows(SQLException.class, () -> stat.setFetchDirection(999));
     }
 
     @Test
diff --git a/src/test/java/org/sqlite/TransactionTest.java b/src/test/java/org/sqlite/TransactionTest.java
index 9b0c4181..ad2aa3f4 100644
--- a/src/test/java/org/sqlite/TransactionTest.java
+++ b/src/test/java/org/sqlite/TransactionTest.java
@@ -1,6 +1,10 @@
 package org.sqlite;
 
-import static org.junit.Assert.*;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.sqlite.SQLiteConfig.TransactionMode;
 
 import java.io.File;
 import java.sql.Connection;
@@ -9,35 +13,36 @@ import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.sql.Statement;
-import java.util.*;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Properties;
+import java.util.Set;
 
-import org.junit.After;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.sqlite.SQLiteConfig.TransactionMode;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 /**
  * These tests assume that Statements and PreparedStatements are working as per
  * normal and test the interactions of commit(), rollback() and
  * setAutoCommit(boolean) with multiple connections to the same db.
  */
-public class TransactionTest
-{
+public class TransactionTest {
     private Connection conn1, conn2, conn3;
-    private Statement  stat1, stat2, stat3;
+    private Statement stat1, stat2, stat3;
 
-    boolean            done = false;
+    boolean done = false;
 
-    @BeforeClass
+    @BeforeAll
     public static void forName() throws Exception {
         System.out.println("running in " + (SQLiteJDBCLoader.isNativeMode() ? "native" : "pure-java") + " mode");
     }
 
-    @Before
+    @BeforeEach
     public void connect() throws Exception {
         File tmpFile = File.createTempFile("test-trans", ".db");
-	// tmpFile.deleteOnExit();
+        // tmpFile.deleteOnExit();
 
         Properties prop = new Properties();
         prop.setProperty("shared_cache", "false");
@@ -57,7 +62,7 @@ public class TransactionTest
         //        }
     }
 
-    @After
+    @AfterEach
     public void close() throws Exception {
         stat1.close();
         stat2.close();
@@ -111,7 +116,8 @@ public class TransactionTest
             pstat2.execute();
         } else {
             stat2.execute("insert into test values (3);");
-        };
+        }
+        ;
         conn2.setAutoCommit(true);
 
         final ResultSet rs = stat1.executeQuery("select c1 from test");
@@ -275,8 +281,7 @@ public class TransactionTest
             public void run() {
                 try {
                     stat2.executeUpdate("insert into t values (3);");
-                }
-                catch (SQLException e) {
+                } catch (SQLException e) {
                     e.printStackTrace();
                     return;
                 }
@@ -292,15 +297,16 @@ public class TransactionTest
         rs.close();
 
         synchronized (lock) {
-            if(!lock.done) {
+            if (!lock.done) {
                 lock.wait(5000);
-                if (!lock.done)
+                if (!lock.done) {
                     throw new Exception("should be done");
+                }
             }
         }
     }
 
-    @Test(expected = SQLException.class)
+    @Test
     public void secondConnMustTimeout() throws SQLException {
         stat1.setQueryTimeout(1);
         stat1.executeUpdate("create table t (c1);");
@@ -310,7 +316,7 @@ public class TransactionTest
         assertTrue(rs.next());
 
         ((SQLiteConnection) conn2).setBusyTimeout(10);
-        stat2.executeUpdate("insert into t values (3);"); // can't be done
+        assertThrows(SQLException.class, () -> stat2.executeUpdate("insert into t values (3);")); // can't be done
     }
 
     //    @Test(expected= SQLException.class)
@@ -326,14 +332,14 @@ public class TransactionTest
         stat1.executeUpdate("insert into t values (3);"); // can't be done
     }
 
-    @Test(expected = SQLException.class)
+    @Test
     public void cantCommit() throws SQLException {
-        conn1.commit();
+        assertThrows(SQLException.class, () -> conn1.commit());
     }
 
-    @Test(expected = SQLException.class)
+    @Test
     public void cantRollback() throws SQLException {
-        conn1.rollback();
+        assertThrows(SQLException.class, () -> conn1.rollback());
     }
 
     @Test
@@ -344,37 +350,37 @@ public class TransactionTest
         ds.setUrl("jdbc:sqlite:" + tmpFile.getAbsolutePath());
 
         // deferred
-        SQLiteConnection con = (SQLiteConnection)ds.getConnection();
+        SQLiteConnection con = (SQLiteConnection) ds.getConnection();
         assertEquals(TransactionMode.DEFERRED, con.getConnectionConfig().getTransactionMode());
         assertEquals("begin;", con.getConnectionConfig().transactionPrefix());
         runUpdates(con, "tbl1");
-        
+
         ds.setTransactionMode(TransactionMode.DEFERRED.name());
-        con = (SQLiteConnection)ds.getConnection();
+        con = (SQLiteConnection) ds.getConnection();
         assertEquals(TransactionMode.DEFERRED, con.getConnectionConfig().getTransactionMode());
         assertEquals("begin;", con.getConnectionConfig().transactionPrefix());
 
         // Misspelled deferred should be accepted for backwards compatibility
         ds.setTransactionMode("DEFFERED");
-        con = (SQLiteConnection)ds.getConnection();
+        con = (SQLiteConnection) ds.getConnection();
         assertEquals(TransactionMode.DEFERRED, con.getConnectionConfig().getTransactionMode());
         assertEquals("begin;", con.getConnectionConfig().transactionPrefix());
 
-        con = (SQLiteConnection)ds.getConnection();
+        con = (SQLiteConnection) ds.getConnection();
         con.getConnectionConfig().setTransactionMode(TransactionMode.valueOf("DEFFERED"));
         assertEquals(TransactionMode.DEFERRED, con.getConnectionConfig().getTransactionMode());
         assertEquals("begin;", con.getConnectionConfig().transactionPrefix());
 
         // immediate
         ds.setTransactionMode(TransactionMode.IMMEDIATE.name());
-        con = (SQLiteConnection)ds.getConnection();
+        con = (SQLiteConnection) ds.getConnection();
         assertEquals(TransactionMode.IMMEDIATE, con.getConnectionConfig().getTransactionMode());
         assertEquals("begin immediate;", con.getConnectionConfig().transactionPrefix());
         runUpdates(con, "tbl2");
 
         // exclusive
         ds.setTransactionMode(TransactionMode.EXCLUSIVE.name());
-        con = (SQLiteConnection)ds.getConnection();
+        con = (SQLiteConnection) ds.getConnection();
         assertEquals(TransactionMode.EXCLUSIVE, con.getConnectionConfig().getTransactionMode());
         assertEquals("begin exclusive;", con.getConnectionConfig().transactionPrefix());
         runUpdates(con, "tbl3");
@@ -383,7 +389,7 @@ public class TransactionTest
     }
 
     public void runUpdates(Connection con, String table) throws SQLException {
-        Statement stat = con.createStatement(); 
+        Statement stat = con.createStatement();
 
         con.setAutoCommit(false);
         stat.execute("create table " + table + "(id)");
diff --git a/src/test/java/org/sqlite/TypeMapTest.java b/src/test/java/org/sqlite/TypeMapTest.java
index a52f0d7d..4fd0212f 100644
--- a/src/test/java/org/sqlite/TypeMapTest.java
+++ b/src/test/java/org/sqlite/TypeMapTest.java
@@ -1,13 +1,14 @@
 package org.sqlite;
 
+import org.junit.jupiter.api.Test;
+
 import java.sql.Connection;
 import java.sql.DriverManager;
 import java.sql.SQLException;
 import java.util.Map;
-import org.junit.Test;
 
 public class TypeMapTest {
-    
+
     public Connection getConnection() throws SQLException {
         return DriverManager.getConnection("jdbc:sqlite::memory:");
     }
@@ -15,19 +16,19 @@ public class TypeMapTest {
     @Test
     public void getTypeMap() throws Exception {
         Connection conn = getConnection();
-        
+
         Map<String, Class<?>> m = conn.getTypeMap();
-        
+
         conn.close();
     }
-    
+
     @Test
     public void setTypeMap() throws Exception {
         Connection conn = getConnection();
-        
+
         Map<String, Class<?>> m = conn.getTypeMap();
         conn.setTypeMap(m);
-        
+
         conn.close();
     }
 
diff --git a/src/test/java/org/sqlite/UDFTest.java b/src/test/java/org/sqlite/UDFTest.java
index 9f60f4d9..035bf0a6 100644
--- a/src/test/java/org/sqlite/UDFTest.java
+++ b/src/test/java/org/sqlite/UDFTest.java
@@ -1,6 +1,8 @@
 package org.sqlite;
 
-import static org.junit.Assert.*;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 import java.sql.Connection;
 import java.sql.DriverManager;
@@ -11,28 +13,29 @@ import java.sql.Statement;
 import java.util.LinkedList;
 import java.util.List;
 
-import org.junit.After;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
-/** Tests User Defined Functions. */
-public class UDFTest
-{
-    private static int    val        = 0;
-    private static byte[] b1         = new byte[] { 2, 5, -4, 8, -1, 3, -5 };
-    private static int    gotTrigger = 0;
+/**
+ * Tests User Defined Functions.
+ */
+public class UDFTest {
+    private static int val = 0;
+    private static final byte[] b1 = new byte[] {2, 5, -4, 8, -1, 3, -5};
+    private static int gotTrigger = 0;
 
-    private Connection    conn;
-    private Statement     stat;
+    private Connection conn;
+    private Statement stat;
 
-    @Before
+    @BeforeEach
     public void connect() throws Exception {
         conn = DriverManager.getConnection("jdbc:sqlite:");
         stat = conn.createStatement();
     }
 
-    @After
+    @AfterEach
     public void close() throws SQLException {
         stat.close();
         conn.close();
@@ -93,8 +96,9 @@ public class UDFTest
             @Override
             public void xFunc() throws SQLException {
                 int ret = 0;
-                for (int i = 0; i < args(); i++)
+                for (int i = 0; i < args(); i++) {
                     ret += value_int(i);
+                }
                 result(ret);
             }
         });
@@ -237,7 +241,7 @@ public class UDFTest
         prep.close();
     }
 
-    @Test(expected = SQLException.class)
+    @Test
     public void customErr() throws SQLException {
         Function.create(conn, "f9", new Function() {
             @Override
@@ -245,7 +249,7 @@ public class UDFTest
                 throw new SQLException("myErr");
             }
         });
-        stat.executeQuery("select f9();");
+        assertThrows(SQLException.class, () -> stat.executeQuery("select f9();"));
     }
 
     @Test
@@ -269,8 +273,9 @@ public class UDFTest
 
             @Override
             protected void xStep() throws SQLException {
-                for (int i = 0; i < args(); i++)
+                for (int i = 0; i < args(); i++) {
                     val += value_int(i);
+                }
             }
 
             @Override
@@ -296,14 +301,16 @@ public class UDFTest
 
             @Override
             protected void xStep() throws SQLException {
-                for (int i = 0; i < args(); i++)
+                for (int i = 0; i < args(); i++) {
                     val += value_int(i);
+                }
             }
 
             @Override
             protected void xInverse() throws SQLException {
-                for (int i = 0; i < args(); i++)
+                for (int i = 0; i < args(); i++) {
                     val -= value_int(i);
+                }
             }
 
             @Override
@@ -422,7 +429,7 @@ public class UDFTest
         });
 
         ResultSet rs = stat.executeQuery("select f1() + f2() + f3() + f4() + f5() + f6()"
-                + " + f7() + f8() + f9() + f10() + f11();");
+            + " + f7() + f8() + f9() + f10() + f11();");
         assertTrue(rs.next());
         assertEquals(rs.getInt(1), 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11);
         rs.close();
@@ -437,8 +444,7 @@ public class UDFTest
             protected void xFunc() {
                 try {
                     sum += value_int(1);
-                }
-                catch (SQLException e) {
+                } catch (SQLException e) {
                     e.printStackTrace();
                 }
             }
@@ -451,7 +457,7 @@ public class UDFTest
         Function.create(conn, "func", func);
         stat.executeUpdate("create table foo (col integer);");
         stat.executeUpdate("create trigger foo_trigger after insert on foo begin"
-                + " select func(new.rowid, new.col); end;");
+            + " select func(new.rowid, new.col); end;");
         int times = 1000;
         List<Thread> threads = new LinkedList<Thread>();
         for (int tn = 0; tn < times; tn++) {
@@ -462,17 +468,18 @@ public class UDFTest
                         Statement s = conn.createStatement();
                         s.executeUpdate("insert into foo values (1);");
                         s.close();
-                    }
-                    catch (SQLException e) {
+                    } catch (SQLException e) {
                         e.printStackTrace();
                     }
                 }
             });
         }
-        for (Thread thread : threads)
+        for (Thread thread : threads) {
             thread.start();
-        for (Thread thread : threads)
+        }
+        for (Thread thread : threads) {
             thread.join();
+        }
 
         // check that all of the threads successfully executed
         ResultSet rs = stat.executeQuery("select sum(col) from foo;");
@@ -488,7 +495,8 @@ public class UDFTest
         assertNotNull(a);
         assertNotNull(b);
         assertEquals(a.length, b.length);
-        for (int i = 0; i < a.length; i++)
+        for (int i = 0; i < a.length; i++) {
             assertEquals(a[i], b[i]);
+        }
     }
 }
diff --git a/src/test/java/org/sqlite/util/OSInfoTest.java b/src/test/java/org/sqlite/util/OSInfoTest.java
index 3376a70b..b5122c61 100644
--- a/src/test/java/org/sqlite/util/OSInfoTest.java
+++ b/src/test/java/org/sqlite/util/OSInfoTest.java
@@ -9,16 +9,16 @@
 //--------------------------------------
 package org.sqlite.util;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import java.io.ByteArrayOutputStream;
 import java.io.PrintStream;
 import java.util.logging.Logger;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 public class OSInfoTest {
-    private static Logger logger = Logger.getLogger(OSInfoTest.class.getName());
+    private static final Logger logger = Logger.getLogger(OSInfoTest.class.getName());
 
     @Test
     public void osName() {
@@ -65,10 +65,9 @@ public class OSInfoTest {
             ByteArrayOutputStream buf = new ByteArrayOutputStream();
             PrintStream tmpOut = new PrintStream(buf);
             System.setOut(tmpOut);
-            OSInfo.main(new String[]{"--os"});
+            OSInfo.main(new String[] {"--os"});
             assertEquals(OSInfo.getOSName(), buf.toString());
-        }
-        finally {
+        } finally {
             // reset STDOUT
             System.setOut(out);
         }
@@ -85,10 +84,9 @@ public class OSInfoTest {
             ByteArrayOutputStream buf = new ByteArrayOutputStream();
             PrintStream tmpOut = new PrintStream(buf);
             System.setOut(tmpOut);
-            OSInfo.main(new String[]{"--arch"});
+            OSInfo.main(new String[] {"--arch"});
             assertEquals(OSInfo.getArchName(), buf.toString());
-        }
-        finally {
+        } finally {
             // reset STDOUT
             System.setOut(out);
         }