use of org.apache.nifi.web.api.entity.ProcessGroupFlowEntity in project nifi by apache.
the class ITInputPortAccessControl method getRandomInputPort.
private PortEntity getRandomInputPort(final NiFiTestUser user) throws Exception {
final String url = helper.getBaseUrl() + "/flow/process-groups/root";
// get the input ports
final Response response = user.testGet(url);
// ensure the response was successful
assertEquals(200, response.getStatus());
// unmarshal
final ProcessGroupFlowEntity flowEntity = response.readEntity(ProcessGroupFlowEntity.class);
final FlowDTO flowDto = flowEntity.getProcessGroupFlow().getFlow();
final Set<PortEntity> inputPorts = flowDto.getInputPorts();
// ensure the correct number of input ports
assertFalse(inputPorts.isEmpty());
// use the first input port as the target
Iterator<PortEntity> inputPortIter = inputPorts.iterator();
assertTrue(inputPortIter.hasNext());
return inputPortIter.next();
}
use of org.apache.nifi.web.api.entity.ProcessGroupFlowEntity in project nifi by apache.
the class ITProcessorAccessControl method getRandomProcessor.
private ProcessorEntity getRandomProcessor(final NiFiTestUser user) throws Exception {
final String url = helper.getBaseUrl() + "/flow/process-groups/root";
// get the processors
final Response response = user.testGet(url);
// ensure the response was successful
assertEquals(200, response.getStatus());
// unmarshal
final ProcessGroupFlowEntity flowEntity = response.readEntity(ProcessGroupFlowEntity.class);
final FlowDTO flowDto = flowEntity.getProcessGroupFlow().getFlow();
final Set<ProcessorEntity> processors = flowDto.getProcessors();
// ensure the correct number of processors
assertFalse(processors.isEmpty());
// use the first processor as the target
Iterator<ProcessorEntity> processorIter = processors.iterator();
assertTrue(processorIter.hasNext());
return processorIter.next();
}
Aggregations