use of com.redhat.service.smartevents.infra.models.processors.ProcessorDefinition in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class ConnectorsServiceTest method processorWith.
private static Processor processorWith(Gateway gateway) {
Processor processor = new Processor();
processor.setBridge(new Bridge());
ProcessorDefinition processorDefinition = new ProcessorDefinition();
if (gateway instanceof Action) {
processorDefinition.setRequestedAction((Action) gateway);
processor.setType(ProcessorType.SINK);
} else {
processorDefinition.setRequestedSource((Source) gateway);
processor.setType(ProcessorType.SOURCE);
}
processor.setId(TEST_PROCESSOR_ID);
processor.setName(TEST_PROCESSOR_NAME);
processor.setDefinition(processorDefinition);
return processor;
}
use of com.redhat.service.smartevents.infra.models.processors.ProcessorDefinition in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class ConnectorsDAOTest method createPersistProcessor.
private Processor createPersistProcessor(Bridge bridge) {
Processor p = Fixtures.createProcessor(bridge, ManagedResourceStatus.ACCEPTED);
Action a = new Action();
a.setType(KafkaTopicAction.TYPE);
Map<String, String> params = new HashMap<>();
params.put(KafkaTopicAction.TOPIC_PARAM, TestConstants.DEFAULT_KAFKA_TOPIC);
a.setMapParameters(params);
ProcessorDefinition definition = new ProcessorDefinition(Collections.emptySet(), null, a);
p.setDefinition(definition);
processorDAO.persist(p);
return p;
}
use of com.redhat.service.smartevents.infra.models.processors.ProcessorDefinition in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class ProcessorDAOTest method createProcessor.
private Processor createProcessor(Bridge bridge, String name, ProcessorType type) {
Processor p = new Processor();
p.setType(type);
p.setBridge(bridge);
p.setName(name);
p.setStatus(ManagedResourceStatus.ACCEPTED);
p.setSubmittedAt(ZonedDateTime.now());
p.setPublishedAt(ZonedDateTime.now());
p.setShardId(TestConstants.SHARD_ID);
p.setOwner(TestConstants.DEFAULT_USER_NAME);
Action a = new Action();
a.setType(KafkaTopicAction.TYPE);
Map<String, String> params = new HashMap<>();
params.put(KafkaTopicAction.TOPIC_PARAM, TestConstants.DEFAULT_KAFKA_TOPIC);
a.setMapParameters(params);
ProcessorDefinition definition = new ProcessorDefinition(Collections.emptySet(), null, a);
p.setDefinition(definition);
processorDAO.persist(p);
return p;
}
use of com.redhat.service.smartevents.infra.models.processors.ProcessorDefinition in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class Fixtures method createProcessor.
public static Processor createProcessor(Bridge b, ManagedResourceStatus status) {
Processor p = new Processor();
p.setType(ProcessorType.SINK);
p.setName(TestConstants.DEFAULT_PROCESSOR_NAME);
p.setStatus(status);
p.setPublishedAt(ZonedDateTime.now());
p.setSubmittedAt(ZonedDateTime.now());
p.setBridge(b);
p.setShardId(TestConstants.SHARD_ID);
p.setOwner(TestConstants.DEFAULT_USER_NAME);
p.setDefinition(new ProcessorDefinition());
return p;
}
use of com.redhat.service.smartevents.infra.models.processors.ProcessorDefinition in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class KafkaTopicActionInvokerBuilderTest method createProcessorWithActionForTopic.
private ProcessorDTO createProcessorWithActionForTopic(String topicName) {
Action b = new Action();
b.setType(KafkaTopicAction.TYPE);
Map<String, String> params = new HashMap<>();
params.put(KafkaTopicAction.TOPIC_PARAM, topicName);
b.setMapParameters(params);
ProcessorDTO p = new ProcessorDTO();
p.setType(ProcessorType.SINK);
p.setId("myProcessor");
p.setDefinition(new ProcessorDefinition(null, null, b));
p.setBridgeId("myBridge");
return p;
}
Aggregations