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