Skip to content

Commit f9ed141

Browse files
committed
Use setWritable for folder, setExecutable(false) in filePermissions
1 parent af0a680 commit f9ed141

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

core/src/test/java/org/testcontainers/containers/ReusabilityUnitTests.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,7 @@ public void folderAndFile() throws Exception {
407407
@Test
408408
public void filePermissions() throws Exception {
409409
Path path = File.createTempFile("reusable_test", ".txt").toPath();
410+
path.toFile().setExecutable(false);
410411
MountableFile mountableFile = MountableFile.forHostPath(path);
411412
container.withCopyFileToContainer(mountableFile, "/foo/bar");
412413

@@ -424,12 +425,12 @@ public void folderPermissions() throws Exception {
424425
MountableFile mountableFile = MountableFile.forHostPath(tempDirectory);
425426
assertThat(new File(mountableFile.getResolvedPath())).isDirectory();
426427
Path subDir = Files.createDirectory(tempDirectory.resolve("sub"));
427-
subDir.toFile().setExecutable(false);
428+
subDir.toFile().setWritable(false);
428429
container.withCopyFileToContainer(mountableFile, "/foo/bar/");
429430

430431
long hash1 = container.hashCopiedFiles().getValue();
431432

432-
subDir.toFile().setExecutable(true);
433+
subDir.toFile().setWritable(true);
433434

434435
assertThat(container.hashCopiedFiles().getValue()).isNotEqualTo(hash1);
435436
}

0 commit comments

Comments
 (0)