exceptionfactory commented on a change in pull request #4572:
URL: https://github.com/apache/nifi/pull/4572#discussion_r500690543



##########
File path: 
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestUnpackContent.java
##########
@@ -221,6 +226,32 @@ public void testInvalidZip() throws IOException {
         }
     }
 
+    @Test
+    public void testZipEncryptionZipStandard() throws IOException {
+        runZipEncryptionMethod(EncryptionMethod.ZIP_STANDARD);
+    }
+
+    @Test
+    public void testZipEncryptionAes() throws IOException {
+        runZipEncryptionMethod(EncryptionMethod.AES);
+    }
+
+    @Test
+    public void testZipEncryptionNoPasswordConfigured() throws IOException {
+        final TestRunner runner = TestRunners.newTestRunner(new 
UnpackContent());
+        runner.setProperty(UnpackContent.PACKAGING_FORMAT, 
UnpackContent.PackageFormat.ZIP_FORMAT.toString());
+
+        final String password = String.class.getSimpleName();
+        final char[] streamPassword = password.toCharArray();
+        final String contents = TestRunner.class.getCanonicalName();
+
+        final byte[] zipEncrypted = createZipEncrypted(EncryptionMethod.AES, 
streamPassword, contents);

Review comment:
       Further review of Zip4j indicates that the only notable improvement to 
processing unsupported algorithms would be better exception messages from that 
library.  Since there a number of possible unsupported algorithms that would 
result in some kind of ZipException or other exception from Zip4j, there 
doesn't seem to be much value to exercising the same path through the code with 
unsupported binary inputs.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to