Configuration params = Configuration.builder()
.addSimple("retentionStrategy", "Delete Older Than N days")
.addSimple("count", delOlderThan)
.build();
OperationServicesResult result = takeSnapshot(params);
printSnapshotDirsInfo();
assertEquals(result.getResultCode(), OperationServicesResultCode.SUCCESS, "The takeSnapshot operation failed.");
// takeSnapshotsKeepLastNAndMove left 1 snapshot so now there has to be 2 of them
assertSnaphotCount(getSnaphostDirs(), 2);
File moveLocation = new File(basedir, "snaphosts-moved-2");
delOlderThan = 1;
params = Configuration.builder()
.addSimple("retentionStrategy", "Delete Older Than N days")
.addSimple("count", delOlderThan)
.addSimple("deletionStrategy", "Move")
.addSimple("location", moveLocation.getAbsolutePath())
.build();
result = takeSnapshot(params);
printSnapshotDirsInfo();
assertEquals(result.getResultCode(), OperationServicesResultCode.SUCCESS, "The takeSnapshot operation failed.");
// 2 snapshots left 1 created, but 1 moved
assertSnaphotCount(getSnaphostDirs(), 2);
assertSnaphotsContain(getMovedSnapshotDirs(moveLocation), TAKE_SNAPSHOTS_MOVE_NAME);
}