@Test
public void testImportWithSqlFile() throws Exception {

    MetadataStore metadataStore = new DefaultMetadataStore();
    File testFolder = getTestResource("test-schema");
    CreateSchemaForCsvFilesApp.fromParameters(
            metadataStore,
            Collections.singleton(testFolder.getAbsolutePath()),
            "test-schema",
            ";",
            "\"",
            false,
            getTestResource("test-schema.sql").getAbsolutePath()
    );
    Schema schema = metadataStore.getSchemaByName("test-schema");
    Assert.assertNotNull("test-schema");
    Assert.assertEquals(2, schema.getTables().size());
    Table table1 = metadataStore.getTableByName("test-schema.table1");
    Assert.assertNotNull(table1);
    Assert.assertEquals(3, table1.getColumns().size());
    List<Column> columns = new ArrayList<>(table1.getColumns());
    columns.sort(Comparator.comparingInt(c -> metadataStore.getIdUtils().getLocalColumnId(c.getId())));
    Assert.assertEquals("NAME", columns.get(0).getName());
    Assert.assertEquals("FIRST_NAME", columns.get(1).getName());
    Assert.assertEquals("PROFESSION", columns.get(2).getName());
    Table table2 = metadataStore.getTableByName("test-schema.table2.dat");
    Assert.assertNotNull(table2);
    Assert.assertEquals(3, table2.getColumns().size());
    columns = new ArrayList<>(table2.getColumns());
    columns.sort(Comparator.comparingInt(c -> metadataStore.getIdUtils().getLocalColumnId(c.getId())));
    Assert.assertEquals("PROFESSION", columns.get(0).getName());
    Assert.assertEquals("RECOGNITION", columns.get(1).getName());
    Assert.assertEquals("COMMENTS", columns.get(2).getName());
}