Search in sources :

Example 31 with RemoteProcessGroupDTO

use of org.apache.nifi.web.api.dto.RemoteProcessGroupDTO in project nifi by apache.

the class TestRemoteProcessGroupAuditor method testConfigureProxyPortClear.

@Test
public void testConfigureProxyPortClear() throws Throwable {
    final RemoteProcessGroup existingRPG = defaultRemoteProcessGroup();
    when(existingRPG.getProxyPort()).thenReturn(3128);
    final RemoteProcessGroupDTO inputRPGDTO = defaultInput();
    inputRPGDTO.setProxyPort(null);
    final Collection<Action> actions = updateProcessGroupConfiguration(inputRPGDTO, existingRPG);
    assertEquals(1, actions.size());
    final Action action = actions.iterator().next();
    assertEquals(Operation.Configure, action.getOperation());
    assertConfigureDetails(action.getActionDetails(), "Proxy Port", existingRPG.getProxyPort(), inputRPGDTO.getProxyPort());
}
Also used : RemoteProcessGroup(org.apache.nifi.groups.RemoteProcessGroup) Action(org.apache.nifi.action.Action) RemoteProcessGroupDTO(org.apache.nifi.web.api.dto.RemoteProcessGroupDTO) Test(org.junit.Test)

Example 32 with RemoteProcessGroupDTO

use of org.apache.nifi.web.api.dto.RemoteProcessGroupDTO in project nifi by apache.

the class TestRemoteProcessGroupAuditor method defaultInput.

private RemoteProcessGroupDTO defaultInput() {
    final RemoteProcessGroupDTO inputRPGDTO = new RemoteProcessGroupDTO();
    inputRPGDTO.setTransportProtocol("RAW");
    inputRPGDTO.setTransmitting(false);
    return inputRPGDTO;
}
Also used : RemoteProcessGroupDTO(org.apache.nifi.web.api.dto.RemoteProcessGroupDTO)

Example 33 with RemoteProcessGroupDTO

use of org.apache.nifi.web.api.dto.RemoteProcessGroupDTO in project nifi by apache.

the class TestRemoteProcessGroupAuditor method testConfigureProxyHostUpdate.

@Test
public void testConfigureProxyHostUpdate() throws Throwable {
    final RemoteProcessGroup existingRPG = defaultRemoteProcessGroup();
    when(existingRPG.getProxyHost()).thenReturn("proxy1.example.com");
    final RemoteProcessGroupDTO inputRPGDTO = defaultInput();
    inputRPGDTO.setProxyHost("proxy2.example.com");
    final Collection<Action> actions = updateProcessGroupConfiguration(inputRPGDTO, existingRPG);
    assertEquals(1, actions.size());
    final Action action = actions.iterator().next();
    assertEquals(Operation.Configure, action.getOperation());
    assertConfigureDetails(action.getActionDetails(), "Proxy Host", existingRPG.getProxyHost(), inputRPGDTO.getProxyHost());
}
Also used : RemoteProcessGroup(org.apache.nifi.groups.RemoteProcessGroup) Action(org.apache.nifi.action.Action) RemoteProcessGroupDTO(org.apache.nifi.web.api.dto.RemoteProcessGroupDTO) Test(org.junit.Test)

Example 34 with RemoteProcessGroupDTO

use of org.apache.nifi.web.api.dto.RemoteProcessGroupDTO in project nifi by apache.

the class TestRemoteProcessGroupAuditor method testConfigureProxyUser.

@Test
public void testConfigureProxyUser() throws Throwable {
    final RemoteProcessGroup existingRPG = defaultRemoteProcessGroup();
    final RemoteProcessGroupDTO inputRPGDTO = defaultInput();
    inputRPGDTO.setProxyUser("proxy-user");
    final Collection<Action> actions = updateProcessGroupConfiguration(inputRPGDTO, existingRPG);
    assertEquals(1, actions.size());
    final Action action = actions.iterator().next();
    assertEquals(Operation.Configure, action.getOperation());
    assertConfigureDetails(action.getActionDetails(), "Proxy User", existingRPG.getProxyUser(), inputRPGDTO.getProxyUser());
}
Also used : RemoteProcessGroup(org.apache.nifi.groups.RemoteProcessGroup) Action(org.apache.nifi.action.Action) RemoteProcessGroupDTO(org.apache.nifi.web.api.dto.RemoteProcessGroupDTO) Test(org.junit.Test)

Example 35 with RemoteProcessGroupDTO

use of org.apache.nifi.web.api.dto.RemoteProcessGroupDTO in project nifi by apache.

the class TestRemoteProcessGroupAuditor method testConfigureProxyHostClear.

@Test
public void testConfigureProxyHostClear() throws Throwable {
    final RemoteProcessGroup existingRPG = defaultRemoteProcessGroup();
    when(existingRPG.getProxyHost()).thenReturn("proxy.example.com");
    final RemoteProcessGroupDTO inputRPGDTO = defaultInput();
    inputRPGDTO.setProxyHost("");
    final Collection<Action> actions = updateProcessGroupConfiguration(inputRPGDTO, existingRPG);
    assertEquals(1, actions.size());
    final Action action = actions.iterator().next();
    assertEquals(Operation.Configure, action.getOperation());
    assertConfigureDetails(action.getActionDetails(), "Proxy Host", existingRPG.getProxyHost(), inputRPGDTO.getProxyHost());
}
Also used : RemoteProcessGroup(org.apache.nifi.groups.RemoteProcessGroup) Action(org.apache.nifi.action.Action) RemoteProcessGroupDTO(org.apache.nifi.web.api.dto.RemoteProcessGroupDTO) Test(org.junit.Test)

Aggregations

RemoteProcessGroupDTO (org.apache.nifi.web.api.dto.RemoteProcessGroupDTO)36 RemoteProcessGroup (org.apache.nifi.groups.RemoteProcessGroup)22 Action (org.apache.nifi.action.Action)17 Test (org.junit.Test)15 ProcessorDTO (org.apache.nifi.web.api.dto.ProcessorDTO)12 PortDTO (org.apache.nifi.web.api.dto.PortDTO)11 HashMap (java.util.HashMap)10 HashSet (java.util.HashSet)10 ConnectionDTO (org.apache.nifi.web.api.dto.ConnectionDTO)10 ProcessGroupDTO (org.apache.nifi.web.api.dto.ProcessGroupDTO)10 ArrayList (java.util.ArrayList)9 RemoteProcessGroupPortDTO (org.apache.nifi.web.api.dto.RemoteProcessGroupPortDTO)9 FunnelDTO (org.apache.nifi.web.api.dto.FunnelDTO)8 LabelDTO (org.apache.nifi.web.api.dto.LabelDTO)8 FlowSnippetDTO (org.apache.nifi.web.api.dto.FlowSnippetDTO)7 Map (java.util.Map)6 ConnectableDTO (org.apache.nifi.web.api.dto.ConnectableDTO)6 ControllerServiceDTO (org.apache.nifi.web.api.dto.ControllerServiceDTO)6 PositionDTO (org.apache.nifi.web.api.dto.PositionDTO)6 LinkedHashSet (java.util.LinkedHashSet)5