@Test public void copyActionCanChangeFileDestinationPath() { FileCopyDetails copyDetails = expectActionExecutedWhenFileVisited(); RelativePath newPath = new RelativePath(true, "new"); copyDetails.setRelativePath(newPath); assertThat(copyDetails.getRelativePath(), equalTo(newPath)); copyDetails.setPath("/a/b"); assertThat(copyDetails.getRelativePath(), equalTo(new RelativePath(true, "a", "b"))); copyDetails.setName("new name"); assertThat(copyDetails.getRelativePath(), equalTo(new RelativePath(true, "a", "new name"))); }
public void execute(FileCopyDetails fileCopyDetails) { RelativePath path = fileCopyDetails.getRelativePath(); path = path.replaceLastName(transformer.transform(path.getLastName())); fileCopyDetails.setRelativePath(path); }