Skip to content

Commit

Permalink
Add test.
Browse files Browse the repository at this point in the history
  • Loading branch information
dkocher committed May 1, 2024
1 parent 8584871 commit fc2b4f7
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import ch.cyberduck.core.dav.DAVDirectoryFeature;
import ch.cyberduck.core.dav.DAVTouchFeature;
import ch.cyberduck.core.exception.AccessDeniedException;
import ch.cyberduck.core.exception.NotfoundException;
import ch.cyberduck.core.features.Delete;
import ch.cyberduck.core.features.Share;
import ch.cyberduck.core.transfer.TransferStatus;
Expand Down Expand Up @@ -118,6 +119,13 @@ public Credentials prompt(final Host bookmark, final String title, final String
new DAVDeleteFeature(session).delete(Collections.singletonList(file), new DisabledPasswordCallback(), new Delete.DisabledCallback());
}

@Test
public void testToDownloadNotfound() throws Exception {
final Path home = new NextcloudHomeFeature(session.getHost()).find();
final Path file = new Path(home, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file));
assertThrows(NotfoundException.class, () -> new NextcloudShareFeature(session).toDownloadUrl(file, Share.Sharee.world, null, new DisabledPasswordCallback()));
}

@Test
public void testToDownloadShareRoot() throws Exception {
final Path home = new NextcloudHomeFeature(session.getHost()).find();
Expand Down

0 comments on commit fc2b4f7

Please sign in to comment.