Search in sources :

Example 16 with BatchedQueryResult

use of io.confluent.ksql.api.client.BatchedQueryResult in project ksql by confluentinc.

the class ConsistencyOffsetVectorFunctionalTest method shouldRoundTripCVWhenExecutePullQuery.

@Test
public void shouldRoundTripCVWhenExecutePullQuery() throws Exception {
    // When
    final BatchedQueryResult batchedQueryResult = consistencClient.executeQuery(PULL_QUERY_ON_TABLE);
    final List<Row> rows = batchedQueryResult.get();
    // Then
    assertThat(rows, hasSize(1));
    assertThat(batchedQueryResult.queryID().get(), is(notNullValue()));
    assertThatEventually(() -> ((ClientImpl) consistencClient).getSerializedConsistencyVector(), is(notNullValue()));
    final String serializedCV = ((ClientImpl) consistencClient).getSerializedConsistencyVector();
    verifyConsistencyVector(serializedCV);
}
Also used : ClientImpl(io.confluent.ksql.api.client.impl.ClientImpl) Row(io.confluent.ksql.api.client.Row) StreamedRow(io.confluent.ksql.rest.entity.StreamedRow) Matchers.isEmptyString(org.hamcrest.Matchers.isEmptyString) BatchedQueryResult(io.confluent.ksql.api.client.BatchedQueryResult) Test(org.junit.Test)

Aggregations

BatchedQueryResult (io.confluent.ksql.api.client.BatchedQueryResult)16 Test (org.junit.Test)9 Row (io.confluent.ksql.api.client.Row)8 IntegrationTest (io.confluent.common.utils.IntegrationTest)7 ExecutionException (java.util.concurrent.ExecutionException)5 MigrationException (io.confluent.ksql.tools.migrations.MigrationException)3 Matchers.containsString (org.hamcrest.Matchers.containsString)3 KsqlArray (io.confluent.ksql.api.client.KsqlArray)2 KsqlObject (io.confluent.ksql.api.client.KsqlObject)2 KsqlClientException (io.confluent.ksql.api.client.exception.KsqlClientException)2 List (java.util.List)2 ZooKeeperClientException (kafka.zookeeper.ZooKeeperClientException)2 ImmutableList (com.google.common.collect.ImmutableList)1 Client (io.confluent.ksql.api.client.Client)1 ServerInfo (io.confluent.ksql.api.client.ServerInfo)1 ClientImpl (io.confluent.ksql.api.client.impl.ClientImpl)1 ConnectorList (io.confluent.ksql.rest.entity.ConnectorList)1 StreamedRow (io.confluent.ksql.rest.entity.StreamedRow)1 MigrationConfig (io.confluent.ksql.tools.migrations.MigrationConfig)1 ServerVersionUtil.getServerInfo (io.confluent.ksql.tools.migrations.util.ServerVersionUtil.getServerInfo)1