@Test
void curateFile_move_deleteTgt() {
SimplePendingActionFactory actionFactory = new SimplePendingActionFactory(REF_A1);
PendingActionCurator curator = new PendingActionCurator(actionFactory);
Map<String, MockVirtualFile> fs = MockVirtualFileSystem.createTree(
"a.txt", "abc",
"b.txt", "def"
);
MockVirtualFile srcFile = fs.get("a.txt");
MockVirtualFile tgtFile = fs.get("b.txt");
List<ActionStore.PendingAction> actions = new ArrayList<>();
P4ChangelistIdImpl cl1 = new P4ChangelistIdImpl(100, REF_A1);
P4ChangelistIdImpl cl2 = new P4ChangelistIdImpl(100, REF_A1);
ActionStore.PendingAction moveFile = ActionStore.createPendingAction(REF_A1,
new MoveFileAction(srcFile.asFilePath(), tgtFile.asFilePath(), cl1));
actions.add(moveFile);
ActionStore.PendingAction deleteFile = ActionStore.createPendingAction(REF_A1,
new DeleteFileAction(tgtFile.asFilePath(), cl2));
curator.curateActionList(deleteFile, actions);
assertSize(1, actionFactory.created);
ActionStore.PendingAction created = actionFactory.created.get(0);
assertContainsExactly(actions, created);
assertNull(created.serverAction);
assertNotNull(created.clientAction);
assertEquals(created.clientAction.getClass(), DeleteFileAction.class);
DeleteFileAction createdDelete = (DeleteFileAction) created.clientAction;
assertEquals(cl1, createdDelete.getChangelistId());
}