mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-05-21 04:01:27 +00:00
cleanup, attempt to fix test
This commit is contained in:
@@ -68,15 +68,4 @@ class FifoParallelDataProcessor<T> {
|
||||
return processedData.take().get();
|
||||
}
|
||||
|
||||
/**
|
||||
* Stops work in progress immediatley.
|
||||
*/
|
||||
@Deprecated
|
||||
void cancelAllPendingJobs() {
|
||||
Future<T> job;
|
||||
while ((job = processedData.poll()) != null) {
|
||||
job.cancel(true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user