Skip to content

Commit 8f312b4

Browse files
authored
Avoid clobbering already configured path (#2957)
1 parent b88d136 commit 8f312b4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

core/src/main/java/org/testcontainers/containers/GenericContainer.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1284,6 +1284,9 @@ public SELF withWorkingDirectory(String workDir) {
12841284
*/
12851285
@Override
12861286
public SELF withCopyFileToContainer(MountableFile mountableFile, String containerPath) {
1287+
if (copyToFileContainerPathMap.containsKey(mountableFile)) {
1288+
throw new IllegalStateException("Path already configured for copy: " + mountableFile);
1289+
}
12871290
copyToFileContainerPathMap.put(mountableFile, containerPath);
12881291
return self();
12891292
}

0 commit comments

Comments
 (0)