lordgamez commented on a change in pull request #1141:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1141#discussion_r680018840



##########
File path: docker/test/integration/features/hashcontent.feature
##########
@@ -0,0 +1,40 @@
+Feature: Hash value is added to Flowfiles by HashContent processor
+  In order to avoid duplication of content of Flowfiles
+  As a user of MiNiFi
+  I need to have HashContent processor to calculate and add hash value
+
+  Background:
+    Given the content of "/tmp/output" is monitored
+
+  Scenario Outline: HashContent adds hash attribute to flowfiles
+    Given a GetFile processor with the "Input Directory" property set to 
"/tmp/input"
+    And a file with the content <content> is present in "/tmp/input"
+    And a HashContent processor with the "Hash Attribute" property set to 
"hash"
+    And the "Hash Algorithm" property of the HashContent processor is set to 
"<hash_algorithm>"
+    And a LogAttribute processor
+    And the "success" relationship of the GetFile processor is connected to 
the HashContent
+    And the "success" relationship of the HashContent processor is connected 
to the LogAttribute
+    When the MiNiFi instance starts up
+    Then the minifi log contains "key:hash value:<hash_value>"
+
+    Examples:
+      | content  | hash_algorithm | hash_value                                 
                      |
+      | "test"   | MD5            | 098F6BCD4621D373CADE4E832627B4F6           
                      |
+      | "test"   | SHA1           | A94A8FE5CCB19BA61C4C0873D391E987982FBBD3   
                      |
+      | "test"   | SHA256         | 
9F86D081884C7D659A2FEAA0C55AD015A3BF4F1B2B0B822CD15D6C15B0F00A08 |
+      | "coffee" | MD5            | 24EB05D18318AC2DB8B2B959315D10F2           
                      |
+      | "coffee" | SHA1           | 44213F9F4D59B557314FADCD233232EEBCAC8012   
                      |
+      | "coffee" | SHA256         | 
37290D74AC4D186E3A8E5785D259D2EC04FAC91AE28092E7620EC8BC99E830AA |

Review comment:
       I'm not sure we need to check with both `test` and `coffee` content with 
each hash algorithm, I don't think it makes a difference, but it doubles the 
execution time. Maybe we could have different content for each algorithm just 
to prove it works with different file contents so 3 examples would be enough.




-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to