Search in sources :

Example 66 with ConnectionDTO

use of org.apache.nifi.web.api.dto.ConnectionDTO in project nifi-minifi by apache.

the class ConnectionSchemaTest method setup.

@Before
public void setup() {
    ConnectableDTO source = new ConnectableDTO();
    source.setId(testSourceId);
    ConnectableDTO destination = new ConnectableDTO();
    destination.setId(testDestinationId);
    dto = new ConnectionDTO();
    dto.setId(testId);
    dto.setName(testName);
    dto.setSource(source);
    dto.setSelectedRelationships(Arrays.asList(testSelectedRelationship).stream().collect(Collectors.toSet()));
    dto.setDestination(destination);
    dto.setBackPressureObjectThreshold(testMaxWorkQueueSize);
    dto.setBackPressureDataSizeThreshold(testMaxWorkQueueDataSize);
    dto.setFlowFileExpiration(testFlowfileExpiration);
    dto.setPrioritizers(Arrays.asList(testQueuePrioritizerClass));
    map = new HashMap<>();
    map.put(CommonPropertyKeys.ID_KEY, testId);
    map.put(CommonPropertyKeys.NAME_KEY, testName);
    map.put(ConnectionSchema.SOURCE_ID_KEY, testSourceId);
    map.put(ConnectionSchema.SOURCE_RELATIONSHIP_NAMES_KEY, new ArrayList<>(Arrays.asList(testSelectedRelationship)));
    map.put(ConnectionSchema.DESTINATION_ID_KEY, testDestinationId);
    map.put(ConnectionSchema.MAX_WORK_QUEUE_SIZE_KEY, testMaxWorkQueueSize);
    map.put(ConnectionSchema.MAX_WORK_QUEUE_DATA_SIZE_KEY, testMaxWorkQueueDataSize);
    map.put(ConnectionSchema.FLOWFILE_EXPIRATION__KEY, testFlowfileExpiration);
    map.put(ConnectionSchema.QUEUE_PRIORITIZER_CLASS_KEY, testQueuePrioritizerClass);
}
Also used : ConnectionDTO(org.apache.nifi.web.api.dto.ConnectionDTO) ConnectableDTO(org.apache.nifi.web.api.dto.ConnectableDTO) Before(org.junit.Before)

Aggregations

ConnectionDTO (org.apache.nifi.web.api.dto.ConnectionDTO)66 ProcessGroupDTO (org.apache.nifi.web.api.dto.ProcessGroupDTO)35 ArrayList (java.util.ArrayList)32 ConnectableDTO (org.apache.nifi.web.api.dto.ConnectableDTO)32 HashSet (java.util.HashSet)30 PortDTO (org.apache.nifi.web.api.dto.PortDTO)28 ProcessorDTO (org.apache.nifi.web.api.dto.ProcessorDTO)25 List (java.util.List)24 HashMap (java.util.HashMap)20 Set (java.util.Set)20 Collectors (java.util.stream.Collectors)18 RemoteProcessGroupDTO (org.apache.nifi.web.api.dto.RemoteProcessGroupDTO)17 Logger (org.slf4j.Logger)17 LoggerFactory (org.slf4j.LoggerFactory)17 Map (java.util.Map)16 NifiClientRuntimeException (com.thinkbiganalytics.nifi.rest.client.NifiClientRuntimeException)15 Inject (javax.inject.Inject)15 NifiConnectionUtil (com.thinkbiganalytics.nifi.rest.support.NifiConnectionUtil)14 Optional (java.util.Optional)13 StringUtils (org.apache.commons.lang3.StringUtils)13