use of com.redhat.service.smartevents.manager.models.Processor in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class ProcessorServiceTest method testGetProcessorWithReadyDependencies.
@Test
void testGetProcessorWithReadyDependencies() {
String processor1Name = NEW_PROCESSOR_NAME;
Processor processor1 = new Processor();
processor1.setType(SINK);
processor1.setName(processor1Name);
processor1.setShardId(TestConstants.SHARD_ID);
processor1.setStatus(ACCEPTED);
processor1.setDependencyStatus(READY);
String processor2Name = "My Processor 2";
Processor processor2 = new Processor();
processor2.setType(SINK);
processor2.setName(processor2Name);
processor2.setShardId(TestConstants.SHARD_ID);
processor2.setStatus(DEPROVISION);
processor2.setDependencyStatus(DELETED);
when(processorDAO.findByShardIdWithReadyDependencies(TestConstants.SHARD_ID)).thenReturn(List.of(processor1, processor2));
List<Processor> processors = processorService.findByShardIdWithReadyDependencies(TestConstants.SHARD_ID);
assertThat(processors).hasSize(2);
processors.forEach((px) -> assertThat(px.getName()).isIn(processor1Name, processor2Name));
}
use of com.redhat.service.smartevents.manager.models.Processor in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class ProcessorServiceTest method createReadyProcessor.
private static Processor createReadyProcessor() {
Processor processor = Fixtures.createProcessor(createReadyBridge(), READY);
processor.setId(DEFAULT_PROCESSOR_ID);
return processor;
}
use of com.redhat.service.smartevents.manager.models.Processor in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class ProcessorServiceTest method createProvisioningProcessor.
private static Processor createProvisioningProcessor() {
Processor processor = Fixtures.createProcessor(createReadyBridge(), PROVISIONING);
processor.setId(PROVISIONING_PROCESSOR_ID);
processor.setName(PROVISIONING_PROCESSOR_NAME);
processor.setPublishedAt(null);
return processor;
}
use of com.redhat.service.smartevents.manager.models.Processor in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class ProcessorServiceTest method testCreateErrorHandlerProcessor.
@Test
void testCreateErrorHandlerProcessor() {
ProcessorRequest processorRequest = new ProcessorRequest(ERROR_HANDLER_PROCESSOR_NAME, TestUtils.createWebhookAction());
Processor processor = processorService.createErrorHandlerProcessor(DEFAULT_BRIDGE_ID, DEFAULT_CUSTOMER_ID, DEFAULT_USER_NAME, processorRequest);
doAssertProcessorCreation(processor, processorRequest, ERROR_HANDLER);
}
use of com.redhat.service.smartevents.manager.models.Processor in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class ProcessorDAOTest method testGetProcessorsFilterByName.
@Test
void testGetProcessorsFilterByName() {
Bridge b = createBridge();
Processor p = createProcessor(b, "foo");
createProcessor(b, "bar");
ListResult<Processor> results = processorDAO.findByBridgeIdAndCustomerId(b.getId(), b.getCustomerId(), new QueryProcessorResourceInfo(0, 100, filter().by(p.getName()).build()));
assertThat(results.getPage()).isZero();
assertThat(results.getSize()).isEqualTo(1L);
assertThat(results.getTotal()).isEqualTo(1L);
assertThat(results.getItems().get(0).getId()).isEqualTo(p.getId());
}
Aggregations