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());
}
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());
}
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());
}
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());
}
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());
}
Aggregations