1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2025-09-12 19:59:38 +02:00

Reinstate integrity-protection and fix tests

Integrity Protection is now checked when reading from the stream,
not only when closing.
This commit is contained in:
Paul Schaub 2022-10-16 19:12:17 +02:00
parent 654493dfcc
commit fbcde13df3
3 changed files with 46 additions and 15 deletions

View file

@ -238,8 +238,10 @@ public class ModificationDetectionTests {
);
ByteArrayOutputStream out = new ByteArrayOutputStream();
Streams.pipeAll(decryptionStream, out);
assertThrows(ModificationDetectionException.class, decryptionStream::close);
assertThrows(ModificationDetectionException.class, () -> {
Streams.pipeAll(decryptionStream, out);
decryptionStream.close();
});
}
@TestTemplate
@ -269,8 +271,10 @@ public class ModificationDetectionTests {
);
ByteArrayOutputStream out = new ByteArrayOutputStream();
Streams.pipeAll(decryptionStream, out);
assertThrows(ModificationDetectionException.class, decryptionStream::close);
assertThrows(ModificationDetectionException.class, () -> {
Streams.pipeAll(decryptionStream, out);
decryptionStream.close();
});
}
@TestTemplate
@ -313,8 +317,10 @@ public class ModificationDetectionTests {
);
ByteArrayOutputStream out = new ByteArrayOutputStream();
Streams.pipeAll(decryptionStream, out);
assertThrows(ModificationDetectionException.class, decryptionStream::close);
assertThrows(ModificationDetectionException.class, () -> {
Streams.pipeAll(decryptionStream, out);
decryptionStream.close();
});
}
@TestTemplate
@ -344,8 +350,10 @@ public class ModificationDetectionTests {
);
ByteArrayOutputStream out = new ByteArrayOutputStream();
Streams.pipeAll(decryptionStream, out);
assertThrows(ModificationDetectionException.class, decryptionStream::close);
assertThrows(ModificationDetectionException.class, () -> {
Streams.pipeAll(decryptionStream, out);
decryptionStream.close();
});
}
@TestTemplate