Search in sources :

Example 41 with RemoteGroupPort

use of org.apache.nifi.remote.RemoteGroupPort in project nifi by apache.

the class TestRemoteProcessGroupAuditor method testEnablePort.

@Test
public void testEnablePort() throws Throwable {
    final RemoteGroupPort existingRPGPort = defaultRemoteGroupPort();
    when(existingRPGPort.getName()).thenReturn("input-port-1");
    when(existingRPGPort.isRunning()).thenReturn(false);
    final RemoteProcessGroupPortDTO inputRPGPortDTO = defaultRemoteProcessGroupPortDTO();
    inputRPGPortDTO.setTransmitting(true);
    final Collection<Action> actions = updateProcessGroupInputPortConfiguration(inputRPGPortDTO, existingRPGPort);
    assertEquals(1, actions.size());
    final Action action = actions.iterator().next();
    assertEquals(Operation.Configure, action.getOperation());
    assertConfigureDetails(action.getActionDetails(), "input-port-1.Transmission", "disabled", "enabled");
}
Also used : Action(org.apache.nifi.action.Action) RemoteGroupPort(org.apache.nifi.remote.RemoteGroupPort) RemoteProcessGroupPortDTO(org.apache.nifi.web.api.dto.RemoteProcessGroupPortDTO) Test(org.junit.Test)

Aggregations

RemoteGroupPort (org.apache.nifi.remote.RemoteGroupPort)41 RemoteProcessGroup (org.apache.nifi.groups.RemoteProcessGroup)22 ProcessGroup (org.apache.nifi.groups.ProcessGroup)11 ArrayList (java.util.ArrayList)9 Connectable (org.apache.nifi.connectable.Connectable)9 Action (org.apache.nifi.action.Action)8 Port (org.apache.nifi.connectable.Port)8 Connection (org.apache.nifi.connectable.Connection)7 RootGroupPort (org.apache.nifi.remote.RootGroupPort)7 RemoteProcessGroupPortDTO (org.apache.nifi.web.api.dto.RemoteProcessGroupPortDTO)7 Test (org.junit.Test)7 HashSet (java.util.HashSet)6 Funnel (org.apache.nifi.connectable.Funnel)6 Authorizable (org.apache.nifi.authorization.resource.Authorizable)5 VersionedProcessGroup (org.apache.nifi.registry.flow.VersionedProcessGroup)5 ResourceNotFoundException (org.apache.nifi.web.ResourceNotFoundException)5 Collection (java.util.Collection)4 Position (org.apache.nifi.connectable.Position)4 Element (org.w3c.dom.Element)4 IOException (java.io.IOException)3