SQLReader { public void read(TableReader tableReader, String fileName, String tableName) { try (SQLiteConnection conn = SQLiteConnection.create(fileName)) { ResultConsumer rowConsumer = new ResultConsumer(tableReader, tableName); conn.consumeTable(tableName, rowConsumer); } catch (SQLException e) { logger.error("Failed to read SQL from table: " + tableName, e); } tableReader.fileFinished(); }  void read(TableReader tableReader, String fileName, String tableName);  }
@Test void testReadingFile() { TestTableReader tableReader = new TestTableReader(); reader.read(tableReader, FILE.getAbsolutePath(), TABLE_NAME); Assertions.assertEquals(writable.getLines(), tableReader.getLines()); }
@Test void testFileFinishedIsCalled() { TestTableReader tableReader = new TestTableReader(); reader.read(tableReader, FILE.getAbsolutePath(), TABLE_NAME); Assertions.assertTrue(tableReader.hasFileFinishedBeenCalled()); }