Skip to content

Commit

Permalink
Merge pull request #137 from nemecec/rename-entries
Browse files Browse the repository at this point in the history
Unit test for issue #135
  • Loading branch information
toomasr authored Sep 17, 2020
2 parents f3eab4c + 90e41e4 commit 01f2dcb
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/test/java/org/zeroturnaround/zip/ZipsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -602,4 +602,19 @@ protected boolean preserveTimestamps() {
FileUtils.deleteQuietly(dest);
}
}

public void testRenameInPlace() throws IOException {
File original = new File(MainExamplesTest.DEMO_ZIP);
final File src = File.createTempFile("renameInPlace", null);
FileUtils.copyFile(original, src);
Zips.get(src).nameMapper(new NameMapper() {
@Override
public String map(String name) {
return name.replace("foo", "123");
}
}).process();
ZipUtil.explode(src);
assertTrue((new File(src, "123.txt")).exists());
}

}

0 comments on commit 01f2dcb

Please sign in to comment.