Search in sources :

Example 16 with RemoteProcessGroupPortDTO

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

the class TestRemoteProcessGroupAuditor method testConfigurePortConcurrency.

@Test
public void testConfigurePortConcurrency() throws Throwable {
    final RemoteGroupPort existingRPGPort = defaultRemoteGroupPort();
    when(existingRPGPort.getName()).thenReturn("input-port-1");
    final RemoteProcessGroupPortDTO inputRPGPortDTO = defaultRemoteProcessGroupPortDTO();
    inputRPGPortDTO.setConcurrentlySchedulableTaskCount(2);
    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.Concurrent Tasks", "1", "2");
}
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)

Example 17 with RemoteProcessGroupPortDTO

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

the class TestRemoteProcessGroupAuditor method testConfigurePortCompression.

@Test
public void testConfigurePortCompression() throws Throwable {
    final RemoteGroupPort existingRPGPort = defaultRemoteGroupPort();
    when(existingRPGPort.getName()).thenReturn("input-port-1");
    final RemoteProcessGroupPortDTO inputRPGPortDTO = defaultRemoteProcessGroupPortDTO();
    inputRPGPortDTO.setUseCompression(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.Compressed", "false", "true");
}
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)

Example 18 with RemoteProcessGroupPortDTO

use of org.apache.nifi.web.api.dto.RemoteProcessGroupPortDTO 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

RemoteProcessGroupPortDTO (org.apache.nifi.web.api.dto.RemoteProcessGroupPortDTO)18 Test (org.junit.Test)7 RemoteGroupPort (org.apache.nifi.remote.RemoteGroupPort)6 HashMap (java.util.HashMap)5 Action (org.apache.nifi.action.Action)5 RemoteProcessGroupContentsDTO (org.apache.nifi.web.api.dto.RemoteProcessGroupContentsDTO)5 RemoteProcessGroupDTO (org.apache.nifi.web.api.dto.RemoteProcessGroupDTO)4 RevisionDTO (org.apache.nifi.web.api.dto.RevisionDTO)4 HashSet (java.util.HashSet)3 RemoteProcessGroup (org.apache.nifi.groups.RemoteProcessGroup)3 BatchSettingsDTO (org.apache.nifi.web.api.dto.BatchSettingsDTO)3 PermissionsDTO (org.apache.nifi.web.api.dto.PermissionsDTO)3 ApiOperation (io.swagger.annotations.ApiOperation)2 ApiResponses (io.swagger.annotations.ApiResponses)2 Map (java.util.Map)2 Set (java.util.Set)2 Consumes (javax.ws.rs.Consumes)2 PUT (javax.ws.rs.PUT)2 Path (javax.ws.rs.Path)2 Produces (javax.ws.rs.Produces)2