tpalfy commented on code in PR #5931:
URL: https://github.com/apache/nifi/pull/5931#discussion_r845086854
##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/integration/versioned/ImportFlowIT.java:
##########
@@ -431,18 +431,18 @@ public void
testUpdateFlowWithInputPortMovedFromGroupAToGroupB() {
assertTrue(groupA.getProcessors().isEmpty());
assertTrue(groupA.getConnections().isEmpty());
assertEquals(1, groupA.getInputPorts().size());
- assertEquals(port.getVersionedComponentId(),
groupA.getInputPorts().stream().findFirst().get().getVersionedComponentId());
+ assertEquals(port.getName(),
groupA.getInputPorts().stream().findFirst().get().getName());
//Change Process Group A version to Version 2
groupA.updateFlow(version2, null, false, true, true);
//Process Group A should have a Process Group, a Processor and a
Connection and no Input Ports
assertEquals(1, groupA.getProcessGroups().size());
- assertEquals(groupB.getVersionedComponentId(),
groupA.getProcessGroups().stream().findFirst().get().getVersionedComponentId());
+ assertEquals(groupB.getName(),
groupA.getProcessGroups().stream().findFirst().get().getName());
assertEquals(1, groupA.getProcessors().size());
- assertEquals(processor.getVersionedComponentId(),
groupA.getProcessors().stream().findFirst().get().getVersionedComponentId());
+ assertEquals(processor.getName(),
groupA.getProcessors().stream().findFirst().get().getName());
assertEquals(1, groupA.getConnections().size());
- assertEquals(connection.getVersionedComponentId(),
groupA.getConnections().stream().findFirst().get().getVersionedComponentId());
+ assertEquals(connection.getName(),
groupA.getConnections().stream().findFirst().get().getName());
Review Comment:
The problem is that the `versionedComponentId` was _not_ handled by the
production code. That part is not in the scope of this test.
Before this change the test code itself copied those ids over. Basically the
test simulated what the production code does somewhere sometime and checked
_its own behaviour_.
The test tries to correlate the mapped- and their corresponding in-memory
objects. The `name` property is perfectly for this.
##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/integration/versioned/ImportFlowIT.java:
##########
@@ -431,18 +431,18 @@ public void
testUpdateFlowWithInputPortMovedFromGroupAToGroupB() {
assertTrue(groupA.getProcessors().isEmpty());
assertTrue(groupA.getConnections().isEmpty());
assertEquals(1, groupA.getInputPorts().size());
- assertEquals(port.getVersionedComponentId(),
groupA.getInputPorts().stream().findFirst().get().getVersionedComponentId());
+ assertEquals(port.getName(),
groupA.getInputPorts().stream().findFirst().get().getName());
//Change Process Group A version to Version 2
groupA.updateFlow(version2, null, false, true, true);
//Process Group A should have a Process Group, a Processor and a
Connection and no Input Ports
assertEquals(1, groupA.getProcessGroups().size());
- assertEquals(groupB.getVersionedComponentId(),
groupA.getProcessGroups().stream().findFirst().get().getVersionedComponentId());
+ assertEquals(groupB.getName(),
groupA.getProcessGroups().stream().findFirst().get().getName());
assertEquals(1, groupA.getProcessors().size());
- assertEquals(processor.getVersionedComponentId(),
groupA.getProcessors().stream().findFirst().get().getVersionedComponentId());
+ assertEquals(processor.getName(),
groupA.getProcessors().stream().findFirst().get().getName());
assertEquals(1, groupA.getConnections().size());
- assertEquals(connection.getVersionedComponentId(),
groupA.getConnections().stream().findFirst().get().getVersionedComponentId());
+ assertEquals(connection.getName(),
groupA.getConnections().stream().findFirst().get().getName());
Review Comment:
The problem is that the `versionedComponentId` was _not_ handled by the
production code. That part is not in the scope of this test.
Before this change the test code itself copied those ids over. Basically the
test simulated what the production code does somewhere sometime and checked
_its own behaviour_.
The test tries to correlate the mapped- and their corresponding in-memory
objects. The `name` property is perfectly for this.
--
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]