@Test
public void testCopyToFile() throws Exception {
this.setup.groupBySetup();
String uriTemplate = Paths.get(folder.getRoot().toURI()).resolve("testCopyToFile%s.json").toAbsolutePath().toString();
SQLResponse response = execute("copy characters to format(?, sys.shards.id)", new Object[]{uriTemplate});
assertThat(response.rowCount(), is(7L));
List<String> lines = new ArrayList<>(7);
DirectoryStream<Path> stream = Files.newDirectoryStream(Paths.get(folder.getRoot().toURI()), "*.json");
for (Path entry: stream) {
lines.addAll(Files.readAllLines(entry, StandardCharsets.UTF_8));
}