3232import ch .cyberduck .core .b2 .B2VersionIdProvider ;
3333import ch .cyberduck .core .b2 .B2WriteFeature ;
3434import ch .cyberduck .core .cryptomator .features .CryptoBulkFeature ;
35- import ch .cyberduck .core .cryptomator .features .CryptoFindV6Feature ;
3635import ch .cyberduck .core .cryptomator .features .CryptoReadFeature ;
3736import ch .cyberduck .core .cryptomator .features .CryptoTouchFeature ;
3837import ch .cyberduck .core .cryptomator .features .CryptoWriteFeature ;
@@ -90,8 +89,8 @@ public void testCopyFile() throws Exception {
9089 assertTrue (cryptomator .getFeature (session , Find .class , new DefaultFindFeature (session )).find (source ));
9190 final CopyWorker worker = new CopyWorker (Collections .singletonMap (source , target ), new SessionPool .SingleSessionPool (session , registry ), PathCache .empty (), new DisabledProgressListener (), new DisabledConnectionCallback ());
9291 worker .run (session );
93- assertTrue (new CryptoFindV6Feature (session , new B2FindFeature (session , fileid ), cryptomator ).find (source ));
94- assertTrue (new CryptoFindV6Feature (session , new B2FindFeature (session , fileid ), cryptomator ).find (target ));
92+ assertTrue (cryptomator . getFeature (session , Find . class , new B2FindFeature (session , fileid )).find (source ));
93+ assertTrue (cryptomator . getFeature (session , Find . class , new B2FindFeature (session , fileid )).find (target ));
9594 final ByteArrayOutputStream out = new ByteArrayOutputStream (content .length );
9695 assertEquals (content .length , IOUtils .copy (new CryptoReadFeature (session , new B2ReadFeature (session , fileid ), cryptomator ).read (target , new TransferStatus ().withLength (content .length ), new DisabledConnectionCallback ()), out ));
9796 assertArrayEquals (content , out .toByteArray ());
@@ -168,13 +167,13 @@ public void testCopyFolder() throws Exception {
168167 // copy file
169168 final Path fileRenamed = new Path (folder , "f1" , EnumSet .of (Path .Type .file ));
170169 new CopyWorker (Collections .singletonMap (file , fileRenamed ), new SessionPool .SingleSessionPool (session , registry ), PathCache .empty (), new DisabledProgressListener (), new DisabledConnectionCallback ()).run (session );
171- assertTrue (new CryptoFindV6Feature (session , new B2FindFeature (session , fileid ), cryptomator ).find (file ));
172- assertTrue (new CryptoFindV6Feature (session , new B2FindFeature (session , fileid ), cryptomator ).find (fileRenamed ));
170+ assertTrue (cryptomator . getFeature (session , Find . class , new B2FindFeature (session , fileid )).find (file ));
171+ assertTrue (cryptomator . getFeature (session , Find . class , new B2FindFeature (session , fileid )).find (fileRenamed ));
173172 // copy folder
174173 final Path folderRenamed = new Path (vault , new AlphanumericRandomStringService ().random (), EnumSet .of (Path .Type .directory ));
175174 new CopyWorker (Collections .singletonMap (folder , folderRenamed ), new SessionPool .SingleSessionPool (session , registry ), PathCache .empty (), new DisabledProgressListener (), new DisabledConnectionCallback ()).run (session );
176- assertTrue (new CryptoFindV6Feature (session , new B2FindFeature (session , fileid ), cryptomator ).find (folder ));
177- assertTrue (new CryptoFindV6Feature (session , new B2FindFeature (session , fileid ), cryptomator ).find (folderRenamed ));
175+ assertTrue (cryptomator . getFeature (session , Find . class , new B2FindFeature (session , fileid )).find (folder ));
176+ assertTrue (cryptomator . getFeature (session , Find . class , new B2FindFeature (session , fileid )).find (folderRenamed ));
178177 final Path fileRenamedInRenamedFolder = new Path (folderRenamed , "f1" , EnumSet .of (Path .Type .file ));
179178 assertTrue (cryptomator .getFeature (session , Find .class , new DefaultFindFeature (session )).find (fileRenamedInRenamedFolder ));
180179 registry .clear ();
@@ -201,7 +200,7 @@ public void testCopyFileIntoVault() throws Exception {
201200 final CopyWorker worker = new CopyWorker (Collections .singletonMap (cleartextFile , encryptedFile ), new SessionPool .SingleSessionPool (session , registry ), PathCache .empty (), new DisabledProgressListener (), new DisabledConnectionCallback ());
202201 worker .run (session );
203202 assertTrue (new B2FindFeature (session , fileid ).find (cleartextFile ));
204- assertTrue (new CryptoFindV6Feature (session , new B2FindFeature (session , fileid ), cryptomator ).find (encryptedFile ));
203+ assertTrue (cryptomator . getFeature (session , Find . class , new B2FindFeature (session , fileid )).find (encryptedFile ));
205204 registry .clear ();
206205 new DeleteWorker (new DisabledLoginCallback (), Collections .singletonList (vault ), new DisabledProgressListener ()).run (session );
207206 }
@@ -256,7 +255,7 @@ public void testCopyFileOutsideVault() throws Exception {
256255 final Path cleartextFile = new Path (clearFolder , new AlphanumericRandomStringService ().random (), EnumSet .of (Path .Type .file ));
257256 final CopyWorker worker = new CopyWorker (Collections .singletonMap (encryptedFile , cleartextFile ), new SessionPool .SingleSessionPool (session , registry ), PathCache .empty (), new DisabledProgressListener (), new DisabledConnectionCallback ());
258257 worker .run (session );
259- assertTrue (new CryptoFindV6Feature (session , new B2FindFeature (session , fileid ), cryptomator ).find (encryptedFile ));
258+ assertTrue (cryptomator . getFeature (session , Find . class , new B2FindFeature (session , fileid )).find (encryptedFile ));
260259 assertTrue (new B2FindFeature (session , fileid ).find (cleartextFile ));
261260 registry .clear ();
262261 new DeleteWorker (new DisabledLoginCallback (), Arrays .asList (vault , clearFolder ), new DisabledProgressListener ()).run (session );
@@ -282,8 +281,8 @@ public void testCopyDirectoryOutsideVault() throws Exception {
282281 final Path cleartextFolder = new Path (home , new AlphanumericRandomStringService ().random (), EnumSet .of (Path .Type .directory ));
283282 final CopyWorker worker = new CopyWorker (Collections .singletonMap (encryptedFolder , cleartextFolder ), new SessionPool .SingleSessionPool (session , registry ), PathCache .empty (), new DisabledProgressListener (), new DisabledConnectionCallback ());
284283 worker .run (session );
285- assertTrue (new CryptoFindV6Feature (session , new B2FindFeature (session , fileid ), cryptomator ).find (encryptedFolder ));
286- assertTrue (new CryptoFindV6Feature (session , new B2FindFeature (session , fileid ), cryptomator ).find (encryptedFile ));
284+ assertTrue (cryptomator . getFeature (session , Find . class , new B2FindFeature (session , fileid )).find (encryptedFolder ));
285+ assertTrue (cryptomator . getFeature (session , Find . class , new B2FindFeature (session , fileid )).find (encryptedFile ));
287286 assertTrue (new B2FindFeature (session , fileid ).find (cleartextFolder ));
288287 final Path fileRenamed = new Path (cleartextFolder , encryptedFile .getName (), EnumSet .of (Path .Type .file ));
289288 assertTrue (new B2FindFeature (session , fileid ).find (fileRenamed ));
0 commit comments