@Test
public void testRunOptimize() throws Exception {

    String outputFile = "exportkeys_test.keys";
    try {
        String splitPoint = "splitpoint";
        splitTable(splitPoint.getBytes());
        String[] argsParam = {"zookeeper", tableName, outputFile, "--optimize=1g"};
        Args args = new ManagerArgs(argsParam);
        assertEquals("zookeeper", args.getZookeeperQuorum());
        ExportKeys command = new ExportKeys(admin, args);
        waitForSplitting(2);
        command.run();
        List<Triple<String, String, String>> results = new ArrayList<>();
        for (String keys : Files.readAllLines(Paths.get(outputFile), Constant.CHARSET)) {
            String[] split = keys.split(ExportKeys.DELIMITER);
            results.add(new ImmutableTriple<>(split[0], split[1], split[2]));
        }
        assertEquals(0, results.size());
    } finally {
        Files.delete(Paths.get(outputFile));
    }
}