Search in sources :

Example 1 with StandardFlowDifference

use of org.apache.nifi.registry.flow.diff.StandardFlowDifference in project nifi by apache.

the class TestFlowDifferenceFilters method testFilterAddedRemotePortsWithNonRemoteInputPort.

@Test
public void testFilterAddedRemotePortsWithNonRemoteInputPort() {
    VersionedProcessor versionedProcessor = new VersionedProcessor();
    versionedProcessor.setComponentType(ComponentType.PROCESSOR);
    StandardFlowDifference flowDifference = new StandardFlowDifference(DifferenceType.COMPONENT_ADDED, null, versionedProcessor, null, null, "");
    // predicate should return true because we do want to include changes for adding a non-port
    Assert.assertTrue(FlowDifferenceFilters.FILTER_ADDED_REMOVED_REMOTE_PORTS.test(flowDifference));
}
Also used : StandardFlowDifference(org.apache.nifi.registry.flow.diff.StandardFlowDifference) VersionedProcessor(org.apache.nifi.registry.flow.VersionedProcessor) Test(org.junit.Test)

Example 2 with StandardFlowDifference

use of org.apache.nifi.registry.flow.diff.StandardFlowDifference in project nifi by apache.

the class TestFlowDifferenceFilters method testFilterAddedRemotePortsWithRemoteInputPortAsComponentA.

@Test
public void testFilterAddedRemotePortsWithRemoteInputPortAsComponentA() {
    VersionedRemoteGroupPort remoteGroupPort = new VersionedRemoteGroupPort();
    remoteGroupPort.setComponentType(ComponentType.REMOTE_INPUT_PORT);
    StandardFlowDifference flowDifference = new StandardFlowDifference(DifferenceType.COMPONENT_ADDED, remoteGroupPort, null, null, null, "");
    // predicate should return false because we don't want to include changes for adding a remote input port
    Assert.assertFalse(FlowDifferenceFilters.FILTER_ADDED_REMOVED_REMOTE_PORTS.test(flowDifference));
}
Also used : StandardFlowDifference(org.apache.nifi.registry.flow.diff.StandardFlowDifference) VersionedRemoteGroupPort(org.apache.nifi.registry.flow.VersionedRemoteGroupPort) Test(org.junit.Test)

Example 3 with StandardFlowDifference

use of org.apache.nifi.registry.flow.diff.StandardFlowDifference in project nifi by apache.

the class TestFlowDifferenceFilters method testFilterAddedRemotePortsWithRemoteOutputPort.

@Test
public void testFilterAddedRemotePortsWithRemoteOutputPort() {
    VersionedRemoteGroupPort remoteGroupPort = new VersionedRemoteGroupPort();
    remoteGroupPort.setComponentType(ComponentType.REMOTE_OUTPUT_PORT);
    StandardFlowDifference flowDifference = new StandardFlowDifference(DifferenceType.COMPONENT_ADDED, null, remoteGroupPort, null, null, "");
    // predicate should return false because we don't want to include changes for adding a remote input port
    Assert.assertFalse(FlowDifferenceFilters.FILTER_ADDED_REMOVED_REMOTE_PORTS.test(flowDifference));
}
Also used : StandardFlowDifference(org.apache.nifi.registry.flow.diff.StandardFlowDifference) VersionedRemoteGroupPort(org.apache.nifi.registry.flow.VersionedRemoteGroupPort) Test(org.junit.Test)

Example 4 with StandardFlowDifference

use of org.apache.nifi.registry.flow.diff.StandardFlowDifference in project nifi by apache.

the class TestFlowDifferenceFilters method testFilterAddedRemotePortsWithRemoteInputPortAsComponentB.

@Test
public void testFilterAddedRemotePortsWithRemoteInputPortAsComponentB() {
    VersionedRemoteGroupPort remoteGroupPort = new VersionedRemoteGroupPort();
    remoteGroupPort.setComponentType(ComponentType.REMOTE_INPUT_PORT);
    StandardFlowDifference flowDifference = new StandardFlowDifference(DifferenceType.COMPONENT_ADDED, null, remoteGroupPort, null, null, "");
    // predicate should return false because we don't want to include changes for adding a remote input port
    Assert.assertFalse(FlowDifferenceFilters.FILTER_ADDED_REMOVED_REMOTE_PORTS.test(flowDifference));
}
Also used : StandardFlowDifference(org.apache.nifi.registry.flow.diff.StandardFlowDifference) VersionedRemoteGroupPort(org.apache.nifi.registry.flow.VersionedRemoteGroupPort) Test(org.junit.Test)

Aggregations

StandardFlowDifference (org.apache.nifi.registry.flow.diff.StandardFlowDifference)4 Test (org.junit.Test)4 VersionedRemoteGroupPort (org.apache.nifi.registry.flow.VersionedRemoteGroupPort)3 VersionedProcessor (org.apache.nifi.registry.flow.VersionedProcessor)1