use of com.redhat.service.bridge.manager.models.Processor in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class ConnectorsDAOTest method createProcessor.
private Processor createProcessor(Bridge bridge, String name) {
Processor p = new Processor();
p.setBridge(bridge);
p.setName(name);
p.setStatus(ManagedResourceStatus.ACCEPTED);
p.setSubmittedAt(ZonedDateTime.now());
p.setPublishedAt(ZonedDateTime.now());
BaseAction a = new BaseAction();
a.setType(KafkaTopicAction.TYPE);
Map<String, String> params = new HashMap<>();
params.put(KafkaTopicAction.TOPIC_PARAM, TestConstants.DEFAULT_KAFKA_TOPIC);
a.setParameters(params);
ProcessorDefinition definition = new ProcessorDefinition(Collections.emptySet(), null, a);
p.setDefinition(mapper.valueToTree(definition));
processorDAO.persist(p);
return p;
}
use of com.redhat.service.bridge.manager.models.Processor in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class ConnectorsDAOTest method findByProcessorIdName.
@Test
public void findByProcessorIdName() {
Bridge b = createBridge();
Processor p = createProcessor(b, "foo");
ConnectorEntity c = createPersistConnector(p, "connector", ManagedResourceStatus.READY);
assertThat(connectorsDAO.findByProcessorIdAndName(p.getId(), c.getName())).isEqualTo(c);
}
use of com.redhat.service.bridge.manager.models.Processor in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class ProcessorDAOTest method findByIdBridgeIdAndCustomerId.
@Test
public void findByIdBridgeIdAndCustomerId() {
Bridge b = createBridge();
Processor p = createProcessor(b, "foo");
Processor found = processorDAO.findByIdBridgeIdAndCustomerId(p.getId(), b.getId(), b.getCustomerId());
assertThat(found).isNotNull();
assertThat(found.getId()).isEqualTo(p.getId());
}
use of com.redhat.service.bridge.manager.models.Processor in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class ProcessorDAOTest method findByBridgeIdAndName.
@Test
public void findByBridgeIdAndName() {
Bridge b = createBridge();
Processor p = createProcessor(b, "foo");
Processor byBridgeIdAndName = processorDAO.findByBridgeIdAndName(b.getId(), p.getName());
assertThat(byBridgeIdAndName).isNotNull();
assertThat(byBridgeIdAndName.getName()).isEqualTo(p.getName());
assertThat(byBridgeIdAndName.getBridge().getId()).isEqualTo(b.getId());
}
use of com.redhat.service.bridge.manager.models.Processor in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class ProcessorDAOTest method findByBridgeIdAndName_noMatchingBridgeId.
@Test
public void findByBridgeIdAndName_noMatchingBridgeId() {
Bridge b = createBridge();
Processor p = createProcessor(b, "foo");
assertThat(processorDAO.findByBridgeIdAndName("doesNotExist", p.getName())).isNull();
}
Aggregations