You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2022/07/29 20:36:04 UTC
[GitHub] [accumulo] DomGarguilo commented on a diff in pull request #2197: Per table crypto + other crypto improvements
DomGarguilo commented on code in PR #2197:
URL: https://github.com/apache/accumulo/pull/2197#discussion_r933600529
##########
core/src/test/java/org/apache/accumulo/core/crypto/CryptoTest.java:
##########
@@ -289,10 +319,20 @@ public void testRFileEncrypted() throws Exception {
}
}
- Scanner iter =
- RFile.newScanner().from(file).withFileSystem(fs).withTableProperties(cryptoOnConf).build();
+ // test to make sure the RFile is encrypted
ArrayList<Key> keysRead = new ArrayList<>();
- iter.forEach(e -> keysRead.add(e.getKey()));
+ try (Scanner iter = RFile.newScanner().from(file).withFileSystem(fs).build()) {
+ iter.forEach(e -> keysRead.add(e.getKey()));
+ fail("File was not encrypted.");
+ } catch (UncheckedIOException e) {
Review Comment:
```suggestion
assertThrows(UncheckedIOException.class, () -> iter.forEach(e -> keysRead.add(e.getKey())),
"The file was expected to be encrypted but was not");
```
This might be a better place for `assertThrows` than try-catch
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org