diff --git a/ssh/src/test/java/ch/cyberduck/core/sftp/SFTPMoveFeatureTest.java b/ssh/src/test/java/ch/cyberduck/core/sftp/SFTPMoveFeatureTest.java index 11ed3cc10f1..eb8f2a6ea83 100644 --- a/ssh/src/test/java/ch/cyberduck/core/sftp/SFTPMoveFeatureTest.java +++ b/ssh/src/test/java/ch/cyberduck/core/sftp/SFTPMoveFeatureTest.java @@ -17,6 +17,7 @@ * Bug fixes, suggestions and comments should be sent to feedback@cyberduck.ch */ +import ch.cyberduck.core.AlphanumericRandomStringService; import ch.cyberduck.core.DisabledConnectionCallback; import ch.cyberduck.core.DisabledLoginCallback; import ch.cyberduck.core.Path; @@ -63,6 +64,18 @@ public void testMoveOverride() throws Exception { new SFTPDeleteFeature(session).delete(Collections.singletonList(target), new DisabledLoginCallback(), new Delete.DisabledCallback()); } + @Test + public void testMoveOverrideDirectory() throws Exception { + final Path workdir = new SFTPHomeDirectoryService(session).find(); + final Path test = new SFTPDirectoryFeature(session).mkdir(new Path(workdir, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory)), new TransferStatus()); + final Path target = new SFTPDirectoryFeature(session).mkdir(new Path(workdir, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory)), new TransferStatus()); + new SFTPTouchFeature(session).touch(new Path(target, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)), new TransferStatus()); + new SFTPMoveFeature(session).move(test, target, new TransferStatus().exists(true), new Delete.DisabledCallback(), new DisabledConnectionCallback()); + assertFalse(new SFTPFindFeature(session).find(test)); + assertTrue(new SFTPFindFeature(session).find(target)); + new SFTPDeleteFeature(session).delete(Collections.singletonList(target), new DisabledLoginCallback(), new Delete.DisabledCallback()); + } + @Test(expected = NotfoundException.class) public void testMoveNotFound() throws Exception { final Path workdir = new SFTPHomeDirectoryService(session).find();