Search in sources :

Example 11 with ProcessorListResponse

use of com.redhat.service.smartevents.manager.api.models.responses.ProcessorListResponse in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.

the class ProcessorAPITest method listProcessorsFilterByStatus.

@Test
@TestSecurity(user = TestConstants.DEFAULT_CUSTOMER_ID)
public void listProcessorsFilterByStatus() {
    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.listProcessorsFilterByStatus(bridgeResponse.getId(), 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());
}
Also used : ProcessorResponse(com.redhat.service.smartevents.manager.api.models.responses.ProcessorResponse) ProcessorListResponse(com.redhat.service.smartevents.manager.api.models.responses.ProcessorListResponse) ProcessorRequest(com.redhat.service.smartevents.manager.api.models.requests.ProcessorRequest) BridgeResponse(com.redhat.service.smartevents.manager.api.models.responses.BridgeResponse) TestSecurity(io.quarkus.test.security.TestSecurity) Test(org.junit.jupiter.api.Test) QuarkusTest(io.quarkus.test.junit.QuarkusTest)

Aggregations

ProcessorListResponse (com.redhat.service.smartevents.manager.api.models.responses.ProcessorListResponse)11 BridgeResponse (com.redhat.service.smartevents.manager.api.models.responses.BridgeResponse)10 ProcessorRequest (com.redhat.service.smartevents.manager.api.models.requests.ProcessorRequest)9 ProcessorResponse (com.redhat.service.smartevents.manager.api.models.responses.ProcessorResponse)9 QuarkusTest (io.quarkus.test.junit.QuarkusTest)9 TestSecurity (io.quarkus.test.security.TestSecurity)9 Test (org.junit.jupiter.api.Test)9 ManagedResourceStatus (com.redhat.service.smartevents.infra.models.dto.ManagedResourceStatus)1 BridgeUtils (com.redhat.service.smartevents.integration.tests.common.BridgeUtils)1 Utils (com.redhat.service.smartevents.integration.tests.common.Utils)1 BridgeContext (com.redhat.service.smartevents.integration.tests.context.BridgeContext)1 ProcessorContext (com.redhat.service.smartevents.integration.tests.context.ProcessorContext)1 TestContext (com.redhat.service.smartevents.integration.tests.context.TestContext)1 BridgeResource (com.redhat.service.smartevents.integration.tests.resources.BridgeResource)1 ProcessorResource (com.redhat.service.smartevents.integration.tests.resources.ProcessorResource)1 WebhookSiteQuerySorting (com.redhat.service.smartevents.integration.tests.resources.webhook.site.WebhookSiteQuerySorting)1 WebhookSiteResource (com.redhat.service.smartevents.integration.tests.resources.webhook.site.WebhookSiteResource)1 After (io.cucumber.java.After)1 Before (io.cucumber.java.Before)1 BeforeAll (io.cucumber.java.BeforeAll)1