|
20 | 20 | import ch.cyberduck.core.features.AttributesFinder; |
21 | 21 | import ch.cyberduck.core.features.Bulk; |
22 | 22 | import ch.cyberduck.core.features.Delete; |
| 23 | +import ch.cyberduck.core.features.Move; |
23 | 24 | import ch.cyberduck.core.features.Read; |
24 | 25 | import ch.cyberduck.core.features.Write; |
25 | 26 | import ch.cyberduck.core.io.StatusOutputStream; |
|
41 | 42 | import org.apache.commons.lang3.RandomUtils; |
42 | 43 | import org.cryptomator.cryptolib.api.UVFMasterkey; |
43 | 44 | import org.jetbrains.annotations.NotNull; |
44 | | -import org.junit.AfterClass; |
45 | | -import org.junit.BeforeClass; |
46 | 45 | import org.junit.Test; |
47 | 46 | import org.junit.experimental.categories.Category; |
48 | 47 | import org.testcontainers.containers.ComposeContainer; |
@@ -80,15 +79,6 @@ public class UVFIntegrationTest { |
80 | 79 | ).collect(Collectors.toMap(AbstractMap.SimpleImmutableEntry::getKey, AbstractMap.SimpleImmutableEntry::getValue))) |
81 | 80 | .withExposedService("minio-1", 9000, Wait.forListeningPort()); |
82 | 81 |
|
83 | | - @BeforeClass |
84 | | - public static void start() { |
85 | | - container.start(); |
86 | | - } |
87 | | - |
88 | | - @AfterClass |
89 | | - public static void shutdown() { |
90 | | - container.stop(); |
91 | | - } |
92 | 82 |
|
93 | 83 | @Test |
94 | 84 | public void listMinio() throws BackgroundException, IOException { |
@@ -190,6 +180,28 @@ public Credentials prompt(final Host bookmark, final String title, final String |
190 | 180 |
|
191 | 181 | assertEquals(new String(expected), readFile(storage, new Path("/cyberduckbucket/subdir/alice.txt", EnumSet.of(AbstractPath.Type.file, AbstractPath.Type.decrypted)))); |
192 | 182 | } |
| 183 | + { |
| 184 | + storage.getFeature(Delete.class).delete(Collections.singletonList(new Path("/cyberduckbucket/subdir/bar.txt", EnumSet.of(AbstractPath.Type.file, AbstractPath.Type.decrypted))), new DisabledPasswordCallback(), new Delete.DisabledCallback()); |
| 185 | + final AttributedList<Path> list = storage.getFeature(ListService.class).list(new Path("/cyberduckbucket/subdir", EnumSet.of(AbstractPath.Type.directory, AbstractPath.Type.placeholder, AbstractPath.Type.decrypted)), new DisabledListProgressListener()); |
| 186 | + assertEquals(1, list.size()); |
| 187 | + assertTrue(Arrays.toString(list.toArray()), list.contains(new Path("/cyberduckbucket/subdir/alice.txt", EnumSet.of(AbstractPath.Type.file, AbstractPath.Type.decrypted)))); |
| 188 | + } |
| 189 | + { |
| 190 | + storage.getFeature(Move.class).move( |
| 191 | + new Path("/cyberduckbucket/foo.txt", EnumSet.of(AbstractPath.Type.file, AbstractPath.Type.decrypted)), |
| 192 | + new Path("/cyberduckbucket/subdir/Dave.txt", EnumSet.of(AbstractPath.Type.file, AbstractPath.Type.decrypted)), |
| 193 | + new TransferStatus(), new Delete.DisabledCallback(), new DisabledConnectionCallback() |
| 194 | + ); |
| 195 | + |
| 196 | + final AttributedList<Path> listSubDir = storage.getFeature(ListService.class).list(new Path("/cyberduckbucket/subdir", EnumSet.of(AbstractPath.Type.directory, AbstractPath.Type.placeholder, AbstractPath.Type.decrypted)), new DisabledListProgressListener()); |
| 197 | + assertEquals(2, listSubDir.size()); |
| 198 | + assertTrue(Arrays.toString(listSubDir.toArray()), listSubDir.contains(new Path("/cyberduckbucket/subdir/alice.txt", EnumSet.of(AbstractPath.Type.file, AbstractPath.Type.decrypted)))); |
| 199 | + assertTrue(Arrays.toString(listSubDir.toArray()), listSubDir.contains(new Path("/cyberduckbucket/subdir/Dave.txt", EnumSet.of(AbstractPath.Type.file, AbstractPath.Type.decrypted)))); |
| 200 | + final AttributedList<Path> listHome = storage.getFeature(ListService.class).list(new Path("/cyberduckbucket/", EnumSet.of(AbstractPath.Type.directory, AbstractPath.Type.placeholder, AbstractPath.Type.decrypted)), new DisabledListProgressListener()); |
| 201 | + assertEquals(2, listHome.size()); |
| 202 | + assertTrue(Arrays.toString(listHome.toArray()), listHome.contains(new Path("/cyberduckbucket/alice.txt", EnumSet.of(AbstractPath.Type.file, AbstractPath.Type.decrypted)))); |
| 203 | + assertTrue(Arrays.toString(listHome.toArray()), listHome.contains(new Path("/cyberduckbucket/subdir", EnumSet.of(AbstractPath.Type.directory, AbstractPath.Type.placeholder, AbstractPath.Type.decrypted)))); |
| 204 | + } |
193 | 205 | } |
194 | 206 | finally { |
195 | 207 | storage.withRegistry(new DefaultVaultRegistry(new DisabledPasswordCallback())); |
|
0 commit comments