diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestLocalFSCopyFromLocal.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestLocalFSCopyFromLocal.java index 7acb39c6e1..15466af7c1 100644 --- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestLocalFSCopyFromLocal.java +++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestLocalFSCopyFromLocal.java @@ -27,8 +27,6 @@ import org.apache.hadoop.fs.contract.AbstractFSContract; import org.apache.hadoop.fs.contract.localfs.LocalFSContract; -import static org.apache.hadoop.test.LambdaTestUtils.intercept; - public class TestLocalFSCopyFromLocal extends AbstractContractCopyFromLocalTest { @Override protected AbstractFSContract createContract(Configuration conf) { @@ -37,14 +35,15 @@ protected AbstractFSContract createContract(Configuration conf) { @Test public void testDestinationFileIsToParentDirectory() throws Throwable { - describe("Source is a file and destination is its own parent directory"); + describe("Source is a file and destination is its own parent directory. " + + "Copying will cause the source file to be deleted."); File file = createTempFile("local"); Path dest = new Path(file.getParentFile().toURI()); Path src = new Path(file.toURI()); - intercept(PathOperationException.class, - () -> getFileSystem().copyFromLocalFile( true, true, src, dest)); + getFileSystem().copyFromLocalFile(true, true, src, dest); + assertPathDoesNotExist("Source found", src); } @Test