diff --git a/main/filesystem-crypto/src/main/java/org/cryptomator/crypto/engine/impl/FifoParallelDataProcessor.java b/main/filesystem-crypto/src/main/java/org/cryptomator/crypto/engine/impl/FifoParallelDataProcessor.java index 3a502ca30..dba921b82 100644 --- a/main/filesystem-crypto/src/main/java/org/cryptomator/crypto/engine/impl/FifoParallelDataProcessor.java +++ b/main/filesystem-crypto/src/main/java/org/cryptomator/crypto/engine/impl/FifoParallelDataProcessor.java @@ -68,15 +68,4 @@ class FifoParallelDataProcessor { return processedData.take().get(); } - /** - * Stops work in progress immediatley. - */ - @Deprecated - void cancelAllPendingJobs() { - Future job; - while ((job = processedData.poll()) != null) { - job.cancel(true); - } - } - } diff --git a/main/filesystem-crypto/src/test/java/org/cryptomator/crypto/engine/impl/FileContentDecryptorImplTest.java b/main/filesystem-crypto/src/test/java/org/cryptomator/crypto/engine/impl/FileContentDecryptorImplTest.java index bce1ef2ac..78937bd93 100644 --- a/main/filesystem-crypto/src/test/java/org/cryptomator/crypto/engine/impl/FileContentDecryptorImplTest.java +++ b/main/filesystem-crypto/src/test/java/org/cryptomator/crypto/engine/impl/FileContentDecryptorImplTest.java @@ -60,7 +60,7 @@ public class FileContentDecryptorImplTest { } } - @Test + @Test(timeout = 2000) public void testPartialDecryption() throws InterruptedException { final byte[] keyBytes = new byte[32]; final SecretKey encryptionKey = new SecretKeySpec(keyBytes, "AES"); @@ -90,10 +90,9 @@ public class FileContentDecryptorImplTest { for (int i = 3; i >= 0; i--) { int ciphertextPos = (int) cryptor.toCiphertextPos(i * 32768); try (FileContentDecryptor decryptor = cryptor.createFileContentDecryptor(header, ciphertextPos)) { - ByteBuffer intBuf = ByteBuffer.allocate(32768); - intBuf.clear(); ciphertext.position(ciphertextPos); decryptor.append(ciphertext); + decryptor.append(FileContentCryptor.EOF); ByteBuffer decrypted = decryptor.cleartext(); Assert.assertEquals(i, decrypted.getInt()); }