ExperimentAdditionalTableLoader { public static void executeStatementsFromDirectory(final String folder, final SQLAdapter adapter) throws IOException { try (Stream<Path> paths = Files.walk(Paths.get(folder))) { paths.filter(f -> f.toFile().isFile()).forEach(file -> { try { logger.info("Execute_Statement"); executeStatementInFile(file, adapter); } catch (IOException e) { logger.warn("Could not load sql file {} for creating tables for the experimenter: {}", file.getFileName(), e.getMessage()); } catch (SQLException e) { logger.warn("Could not execute sql in the file {} and not create the table for the experimenter: {}", file.getFileName(), e.getMessage()); } }); } } private  ExperimentAdditionalTableLoader(); static void executeStatementsFromDirectory(final String folder, final SQLAdapter adapter);  }
@Test public void testCreateTables() throws IOException, SQLException { SQLAdapter adapter = new SQLAdapter(DB_CONFIG); ExperimentAdditionalTableLoader.executeStatementsFromDirectory("test_resource", adapter); adapter.update("DROP TABLE IF EXISTS test"); adapter.update("DROP TABLE IF EXISTS test2"); }