use of com.redhat.service.smartevents.manager.api.models.responses.ProcessorListResponse in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class ProcessorAPITest method listProcessors.
@Test
@TestSecurity(user = TestConstants.DEFAULT_CUSTOMER_ID)
public void listProcessors() {
BridgeResponse bridgeResponse = createAndDeployBridge();
ProcessorResponse p = TestUtils.addProcessorToBridge(bridgeResponse.getId(), new ProcessorRequest("myProcessor", TestUtils.createKafkaAction())).as(ProcessorResponse.class);
ProcessorResponse p2 = TestUtils.addProcessorToBridge(bridgeResponse.getId(), new ProcessorRequest("myProcessor2", TestUtils.createKafkaAction())).as(ProcessorResponse.class);
ProcessorListResponse listResponse = TestUtils.listProcessors(bridgeResponse.getId(), 0, 100).as(ProcessorListResponse.class);
assertThat(listResponse.getPage()).isZero();
assertThat(listResponse.getSize()).isEqualTo(2L);
assertThat(listResponse.getTotal()).isEqualTo(2L);
listResponse.getItems().forEach((i) -> assertThat(i.getId()).isIn(p.getId(), p2.getId()));
}
use of com.redhat.service.smartevents.manager.api.models.responses.ProcessorListResponse in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class ProcessorAPITest method listProcessorsFilterByType.
@Test
@TestSecurity(user = TestConstants.DEFAULT_CUSTOMER_ID)
public void listProcessorsFilterByType() {
BridgeResponse bridgeResponse = createAndDeployBridge();
TestUtils.addProcessorToBridge(bridgeResponse.getId(), new ProcessorRequest("myProcessor", TestUtils.createKafkaAction())).as(ProcessorResponse.class);
ProcessorResponse p2 = TestUtils.addProcessorToBridge(bridgeResponse.getId(), new ProcessorRequest("myProcessor2", TestUtils.createSlackSource())).as(ProcessorResponse.class);
ProcessorListResponse listResponse = TestUtils.listProcessorsFilterByType(bridgeResponse.getId(), SOURCE).as(ProcessorListResponse.class);
assertThat(listResponse.getPage()).isZero();
assertThat(listResponse.getSize()).isEqualTo(1L);
assertThat(listResponse.getTotal()).isEqualTo(1L);
assertThat(listResponse.getItems().get(0).getId()).isEqualTo(p2.getId());
}
use of com.redhat.service.smartevents.manager.api.models.responses.ProcessorListResponse in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class ProcessorAPITest method listProcessorsFilterByStatusAndType.
@Test
@TestSecurity(user = TestConstants.DEFAULT_CUSTOMER_ID)
public void listProcessorsFilterByStatusAndType() {
BridgeResponse bridgeResponse = createAndDeployBridge();
ProcessorResponse p1 = TestUtils.addProcessorToBridge(bridgeResponse.getId(), new ProcessorRequest("myProcessor", TestUtils.createKafkaAction())).as(ProcessorResponse.class);
ProcessorResponse p2 = TestUtils.addProcessorToBridge(bridgeResponse.getId(), new ProcessorRequest("myProcessor2", TestUtils.createSlackSource())).as(ProcessorResponse.class);
setProcessorStatus(p1.getId(), READY);
setProcessorStatus(p2.getId(), READY);
ProcessorListResponse listResponse = TestUtils.listProcessorsFilterByStatusAndType(bridgeResponse.getId(), READY, SOURCE).as(ProcessorListResponse.class);
assertThat(listResponse.getPage()).isZero();
assertThat(listResponse.getSize()).isEqualTo(1L);
assertThat(listResponse.getTotal()).isEqualTo(1L);
assertThat(listResponse.getItems().get(0).getId()).isEqualTo(p2.getId());
}
use of com.redhat.service.smartevents.manager.api.models.responses.ProcessorListResponse in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class ProcessorAPITest method listProcessors_pageOffset.
@Test
@TestSecurity(user = TestConstants.DEFAULT_CUSTOMER_ID)
public void listProcessors_pageOffset() {
BridgeResponse bridgeResponse = createAndDeployBridge();
TestUtils.addProcessorToBridge(bridgeResponse.getId(), new ProcessorRequest("myProcessor", TestUtils.createKafkaAction())).as(ProcessorResponse.class);
ProcessorResponse p2 = TestUtils.addProcessorToBridge(bridgeResponse.getId(), new ProcessorRequest("myProcessor2", TestUtils.createKafkaAction())).as(ProcessorResponse.class);
ProcessorListResponse listResponse = TestUtils.listProcessors(bridgeResponse.getId(), 1, 1).as(ProcessorListResponse.class);
assertThat(listResponse.getPage()).isEqualTo(1L);
assertThat(listResponse.getSize()).isEqualTo(1L);
assertThat(listResponse.getTotal()).isEqualTo(2L);
assertThat(listResponse.getItems().get(0).getId()).isEqualTo(p2.getId());
assertRequestedAction(listResponse.getItems().get(0));
}
use of com.redhat.service.smartevents.manager.api.models.responses.ProcessorListResponse in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class ProcessorAPITest method listProcessorsFilterByNameAndStatus.
@Test
@TestSecurity(user = TestConstants.DEFAULT_CUSTOMER_ID)
public void listProcessorsFilterByNameAndStatus() {
BridgeResponse bridgeResponse = createAndDeployBridge();
ProcessorResponse p1 = TestUtils.addProcessorToBridge(bridgeResponse.getId(), new ProcessorRequest("myProcessor", TestUtils.createKafkaAction())).as(ProcessorResponse.class);
ProcessorResponse p2 = TestUtils.addProcessorToBridge(bridgeResponse.getId(), new ProcessorRequest("myProcessor2", TestUtils.createKafkaAction())).as(ProcessorResponse.class);
setProcessorStatus(p1.getId(), ACCEPTED);
setProcessorStatus(p2.getId(), READY);
ProcessorListResponse listResponse = TestUtils.listProcessorsFilterByNameAndStatus(bridgeResponse.getId(), "myProcessor", READY).as(ProcessorListResponse.class);
assertThat(listResponse.getPage()).isZero();
assertThat(listResponse.getSize()).isEqualTo(1L);
assertThat(listResponse.getTotal()).isEqualTo(1L);
assertThat(listResponse.getItems().get(0).getId()).isEqualTo(p2.getId());
}
Aggregations