ijokarumawak commented on a change in pull request #3438: NIFI-6220: If 
FlowFile is created by cloning a relationship, do not c…
URL: https://github.com/apache/nifi/pull/3438#discussion_r276913184
 
 

 ##########
 File path: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/integration/provenance/ProvenanceEventsIT.java
 ##########
 @@ -420,4 +420,62 @@ public void testForkAutoGenerated() throws 
ExecutionException, InterruptedExcept
         final ProvenanceEventRecord thirdEvent = provRepo.getEvent(2L);
         assertEquals(ProvenanceEventType.DROP, thirdEvent.getEventType());
     }
+
+    @Test
+    public void testCloneOnMultipleConnectionsForRelationship() throws 
ExecutionException, InterruptedException, IOException {
+        final ProcessorNode generateProcessor = createGenerateProcessor(0);
+        final ProcessorNode passThroughProcessor = 
createProcessorNode((context, session) -> {
+            FlowFile original = session.get();
+            session.transfer(original, REL_SUCCESS);
+        }, REL_SUCCESS);
+
+        connect(generateProcessor, passThroughProcessor, REL_SUCCESS);
+        connect(passThroughProcessor, getTerminateProcessor(), REL_SUCCESS);
+        connect(passThroughProcessor, getTerminateAllProcessor(), REL_SUCCESS);
+
+        triggerOnce(generateProcessor);
+        triggerOnce(passThroughProcessor);
+
+        final ProvenanceEventRepository provRepo = getProvenanceRepository();
+        assertEquals(1L, provRepo.getMaxEventId().longValue());
+
+        final ProvenanceEventRecord firstEvent = provRepo.getEvent(0L);
+        assertEquals(ProvenanceEventType.CREATE, firstEvent.getEventType());
+
+        final ProvenanceEventRecord secondEvent = provRepo.getEvent(1L);
+        assertEquals(ProvenanceEventType.CLONE, secondEvent.getEventType());
+        assertEquals(1, secondEvent.getParentUuids().size());
+        assertEquals(1, secondEvent.getChildUuids().size());
+    }
+
+    @Test
+    public void 
testCloneOnMultipleConnectionsForRelationshipIncludesUpToDateAttributes() 
throws ExecutionException, InterruptedException, IOException {
 
 Review comment:
   I wonder if the method name should be `...IncludesUpdateAttributes` instead 
of `UpToDate`.

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


With regards,
Apache Git Services

Reply via email to