Ejemplo n.º 1
0
  @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")));
  }
Ejemplo n.º 2
0
 public void execute(FileCopyDetails fileCopyDetails) {
   RelativePath path = fileCopyDetails.getRelativePath();
   path = path.replaceLastName(transformer.transform(path.getLastName()));
   fileCopyDetails.setRelativePath(path);
 }