Search in sources :

Example 1 with InternalSimpleKsqlClientFactory

use of io.confluent.ksql.rest.server.services.TestRestServiceContextFactory.InternalSimpleKsqlClientFactory in project ksql by confluentinc.

the class TestKsqlRestApp method initialize.

protected void initialize() {
    if (ksqlRestApplication != null) {
        after();
    }
    ksqlRestConfig = buildConfig(bootstrapServers, baseConfig);
    try {
        Vertx vertx = Vertx.vertx();
        ksqlRestApplication = KsqlRestApplication.buildApplication(metricsPrefix, ksqlRestConfig, (booleanSupplier) -> mock(VersionCheckerAgent.class), 3, serviceContext.get(), () -> serviceContext.get().getSchemaRegistryClient(), (authHeader, requestHeaders, userPrincipal) -> serviceContext.get().getConnectClient(), vertx, InternalKsqlClientFactory.createInternalClient(PropertiesUtil.toMapStrings(ksqlRestConfig.originals()), SocketAddress::inetSocketAddress, vertx), TestRestServiceContextFactory.createDefault(internalSimpleKsqlClientFactory), TestRestServiceContextFactory.createUser(internalSimpleKsqlClientFactory), new MetricCollectors());
    } catch (final Exception e) {
        throw new RuntimeException("Failed to initialise", e);
    }
}
Also used : Arrays(java.util.Arrays) StreamsList(io.confluent.ksql.rest.entity.StreamsList) URL(java.net.URL) RunningQuery(io.confluent.ksql.rest.entity.RunningQuery) InternalKsqlClientFactory(io.confluent.ksql.rest.server.services.InternalKsqlClientFactory) BiFunction(java.util.function.BiFunction) ServiceContext(io.confluent.ksql.services.ServiceContext) KsqlQueryType(io.confluent.ksql.util.KsqlConstants.KsqlQueryType) RestResponse(io.confluent.ksql.rest.client.RestResponse) KsqlErrorMessage(io.confluent.ksql.rest.entity.KsqlErrorMessage) NetworkState(io.confluent.ksql.rest.server.NetworkDisruptorClient.NetworkState) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Map(java.util.Map) QueryId(io.confluent.ksql.query.QueryId) URI(java.net.URI) ImmutableMap(com.google.common.collect.ImmutableMap) PropertiesUtil(io.confluent.ksql.properties.PropertiesUtil) Set(java.util.Set) ConsumerConfig(org.apache.kafka.clients.consumer.ConsumerConfig) KsqlConfig(io.confluent.ksql.util.KsqlConfig) Collectors(java.util.stream.Collectors) SimpleKsqlClient(io.confluent.ksql.services.SimpleKsqlClient) TestRestServiceContextFactory(io.confluent.ksql.rest.server.services.TestRestServiceContextFactory) DisabledKsqlClient(io.confluent.ksql.services.DisabledKsqlClient) CountDownLatch(java.util.concurrent.CountDownLatch) ConsistencyLevel(io.confluent.ksql.util.ClientConfig.ConsistencyLevel) List(java.util.List) ExternalResource(org.junit.rules.ExternalResource) VersionCheckerAgent(io.confluent.ksql.version.metrics.VersionCheckerAgent) KsqlExecutionContext(io.confluent.ksql.KsqlExecutionContext) Optional(java.util.Optional) Mockito.mock(org.mockito.Mockito.mock) Iterables(com.google.common.collect.Iterables) InternalSimpleKsqlClientFactory(io.confluent.ksql.rest.server.services.TestRestServiceContextFactory.InternalSimpleKsqlClientFactory) EmbeddedSingleNodeKafkaCluster(io.confluent.ksql.test.util.EmbeddedSingleNodeKafkaCluster) KsqlEntityList(io.confluent.ksql.rest.entity.KsqlEntityList) HashMap(java.util.HashMap) MetricCollectors(io.confluent.ksql.metrics.MetricCollectors) ReservedInternalTopics(io.confluent.ksql.util.ReservedInternalTopics) Supplier(java.util.function.Supplier) Stack(java.util.Stack) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) KsqlRestClient(io.confluent.ksql.rest.client.KsqlRestClient) TestDefaultKsqlClientFactory(io.confluent.ksql.rest.server.services.TestDefaultKsqlClientFactory) Objects.requireNonNull(java.util.Objects.requireNonNull) SourceDescriptionEntity(io.confluent.ksql.rest.entity.SourceDescriptionEntity) Queries(io.confluent.ksql.rest.entity.Queries) TablesList(io.confluent.ksql.rest.entity.TablesList) LinkedList(java.util.LinkedList) LinkedHashSet(java.util.LinkedHashSet) SocketAddress(io.vertx.core.net.SocketAddress) Iterator(java.util.Iterator) Vertx(io.vertx.core.Vertx) CommandStatusEntity(io.confluent.ksql.rest.entity.CommandStatusEntity) BasicCredentials(io.confluent.ksql.rest.client.BasicCredentials) SourceInfo(io.confluent.ksql.rest.entity.SourceInfo) ServiceContextFactory(io.confluent.ksql.services.ServiceContextFactory) Collections(java.util.Collections) MetricCollectors(io.confluent.ksql.metrics.MetricCollectors) Vertx(io.vertx.core.Vertx) SocketAddress(io.vertx.core.net.SocketAddress)

Aggregations

ImmutableMap (com.google.common.collect.ImmutableMap)1 Iterables (com.google.common.collect.Iterables)1 KsqlExecutionContext (io.confluent.ksql.KsqlExecutionContext)1 MetricCollectors (io.confluent.ksql.metrics.MetricCollectors)1 PropertiesUtil (io.confluent.ksql.properties.PropertiesUtil)1 QueryId (io.confluent.ksql.query.QueryId)1 BasicCredentials (io.confluent.ksql.rest.client.BasicCredentials)1 KsqlRestClient (io.confluent.ksql.rest.client.KsqlRestClient)1 RestResponse (io.confluent.ksql.rest.client.RestResponse)1 CommandStatusEntity (io.confluent.ksql.rest.entity.CommandStatusEntity)1 KsqlEntityList (io.confluent.ksql.rest.entity.KsqlEntityList)1 KsqlErrorMessage (io.confluent.ksql.rest.entity.KsqlErrorMessage)1 Queries (io.confluent.ksql.rest.entity.Queries)1 RunningQuery (io.confluent.ksql.rest.entity.RunningQuery)1 SourceDescriptionEntity (io.confluent.ksql.rest.entity.SourceDescriptionEntity)1 SourceInfo (io.confluent.ksql.rest.entity.SourceInfo)1 StreamsList (io.confluent.ksql.rest.entity.StreamsList)1 TablesList (io.confluent.ksql.rest.entity.TablesList)1 NetworkState (io.confluent.ksql.rest.server.NetworkDisruptorClient.NetworkState)1 InternalKsqlClientFactory (io.confluent.ksql.rest.server.services.InternalKsqlClientFactory)1