use of io.micronaut.rxjava2.http.client.sse.RxSseClient in project kestra by kestra-io.
the class ExecutionControllerTest method triggerAndFollow.
@Test
void triggerAndFollow() {
Execution result = triggerInputsFlowExecution();
RxSseClient sseClient = embeddedServer.getApplicationContext().createBean(RxSseClient.class, embeddedServer.getURL());
List<Event<Execution>> results = sseClient.eventStream("/api/v1/executions/" + result.getId() + "/follow", Execution.class).toList().blockingGet();
assertThat(results.size(), is(greaterThan(0)));
assertThat(results.get(results.size() - 1).getData().getState().getCurrent(), is(State.Type.SUCCESS));
}
use of io.micronaut.rxjava2.http.client.sse.RxSseClient in project akhq by tchiotludo.
the class SseControllerTest method searchApi.
@Test
void searchApi() {
RxSseClient sseClient = embeddedServer.getApplicationContext().createBean(RxSseClient.class, embeddedServer.getURL());
List<Record> results = sseClient.eventStream(BASE_URL + "/" + KafkaTestCluster.TOPIC_HUGE + "/data/search?searchByKey=key_100_C", TopicController.SearchRecord.class).toList().blockingGet().stream().flatMap(r -> r.getData() != null && r.getData().getRecords() != null ? r.getData().getRecords().stream() : Stream.empty()).collect(Collectors.toList());
assertThat(results.size(), is(3));
}
Aggregations