pvillard31 commented on code in PR #11631:
URL: https://github.com/apache/nifi/pull/11631#discussion_r3941218175


##########
nifi-extension-bundles/nifi-email-bundle/nifi-email-processors/src/test/java/org/apache/nifi/processors/email/TestExtractEmailAttachments.java:
##########
@@ -102,4 +108,12 @@ public void testInvalidEmail() {
         runner.assertTransferCount(ExtractEmailAttachments.REL_FAILURE, 1);
         runner.assertTransferCount(ExtractEmailAttachments.REL_ATTACHMENTS, 0);
     }
+
+    private void assertAttachmentHeaderAttributes(MockFlowFile split) {

Review Comment:
   Can the tests assert the exact header attribute names and values, and cover 
body, inline image, and attachment parts to verify the behavior described in 
NIFI-16195?



##########
nifi-extension-bundles/nifi-email-bundle/nifi-email-processors/src/main/java/org/apache/nifi/processors/email/ExtractEmailAttachments.java:
##########
@@ -131,6 +136,13 @@ public void onTrigger(final ProcessContext context, final 
ProcessSession session
                         if (contentType != null && !contentType.isBlank()) {
                             attributes.put(CoreAttributes.MIME_TYPE.key(), 
contentType);
                         }
+
+                        for (Map.Entry<String, String> entry : 
attachment.headers().entrySet()) {
+                            final String headerAttributeName = 
ATTACHMENT_HEADER_ATTRIBUTE_PREFIX + entry.getKey();

Review Comment:
   Should the header name be lowercased when building the attribute name, as 
ExtractEmailHeaders does, so downstream flows can rely on stable attribute 
names?



-- 
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: [email protected]

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

Reply via email to