Search in sources :

Example 6 with RemoteProcessGroupDTO

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

the class TestRemoteProcessGroupAuditor method testConfigureProxyPort.

@Test
public void testConfigureProxyPort() throws Throwable {
    final RemoteProcessGroup existingRPG = defaultRemoteProcessGroup();
    final RemoteProcessGroupDTO inputRPGDTO = defaultInput();
    inputRPGDTO.setProxyPort(3128);
    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 7 with RemoteProcessGroupDTO

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

the class TestRemoteProcessGroupAuditor method testConfigureTransportProtocol.

@Test
public void testConfigureTransportProtocol() throws Throwable {
    final RemoteProcessGroup existingRPG = defaultRemoteProcessGroup();
    when(existingRPG.getTransportProtocol()).thenReturn(SiteToSiteTransportProtocol.RAW);
    final RemoteProcessGroupDTO inputRPGDTO = defaultInput();
    inputRPGDTO.setTransportProtocol("HTTP");
    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(), "Transport Protocol", existingRPG.getTransportProtocol().name(), inputRPGDTO.getTransportProtocol());
}
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 8 with RemoteProcessGroupDTO

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

the class TestRemoteProcessGroupAuditor method testDisableTransmission.

@Test
public void testDisableTransmission() throws Throwable {
    final RemoteProcessGroup existingRPG = defaultRemoteProcessGroup();
    when(existingRPG.isTransmitting()).thenReturn(true);
    final RemoteProcessGroupDTO inputRPGDTO = defaultInput();
    inputRPGDTO.setTransmitting(false);
    final Collection<Action> actions = updateProcessGroupConfiguration(inputRPGDTO, existingRPG);
    assertEquals(1, actions.size());
    final Action action = actions.iterator().next();
    assertEquals(Operation.Stop, action.getOperation());
    assertNull(action.getActionDetails());
}
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 9 with RemoteProcessGroupDTO

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

the class TestRemoteProcessGroupAuditor method testEnableTransmission.

@Test
public void testEnableTransmission() throws Throwable {
    final RemoteProcessGroup existingRPG = defaultRemoteProcessGroup();
    when(existingRPG.isTransmitting()).thenReturn(false);
    final RemoteProcessGroupDTO inputRPGDTO = defaultInput();
    inputRPGDTO.setTransmitting(true);
    final Collection<Action> actions = updateProcessGroupConfiguration(inputRPGDTO, existingRPG);
    assertEquals(1, actions.size());
    final Action action = actions.iterator().next();
    assertEquals(Operation.Start, action.getOperation());
    assertNull(action.getActionDetails());
}
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 10 with RemoteProcessGroupDTO

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

the class TestRemoteProcessGroupAuditor method testConfigureYieldDuration.

@Test
public void testConfigureYieldDuration() throws Throwable {
    final RemoteProcessGroup existingRPG = defaultRemoteProcessGroup();
    when(existingRPG.getYieldDuration()).thenReturn("10 sec");
    final RemoteProcessGroupDTO inputRPGDTO = defaultInput();
    inputRPGDTO.setYieldDuration("11 sec");
    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(), "Yield Duration", existingRPG.getYieldDuration(), inputRPGDTO.getYieldDuration());
}
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