dumpDir.delete();
}
dumpDir.mkdir();
// initial dump to target directory
ExportResponse response = executeDumpRequest(
"{\"directory\": \"/tmp/forceDump\"}");
List<Map<String, Object>> infos = getExports(response);
assertEquals(2, infos.size());
assertEquals(0, response.getShardFailures().length);
// second attempt to dump will fail
response = executeDumpRequest(
"{\"directory\": \"/tmp/forceDump\"}");
infos = getExports(response);
assertEquals(0, infos.size());
assertEquals(2, response.getShardFailures().length);
// if force_overwrite == true a second dump will succeed
response = executeDumpRequest(
"{\"directory\": \"/tmp/forceDump\", \"force_overwrite\":true}");
infos = getExports(response);
assertEquals(2, infos.size());
assertEquals(0, response.getShardFailures().length);
}