Search in sources :

Example 1 with KsqlRestConfig

use of io.confluent.ksql.rest.server.KsqlRestConfig in project ksql by confluentinc.

the class CliTest method setUp.

@BeforeClass
public static void setUp() throws Exception {
    KsqlRestClient restClient = new KsqlRestClient(LOCAL_REST_SERVER_ADDR);
    // TODO: Fix Properties Setup in Local().getCli()
    // Local local =  new Local().getCli();
    // LocalCli localCli = local.getCli(restClient, terminal);
    // TODO: add remote cli test cases
    terminal = new TestTerminal(CLI_OUTPUT_FORMAT, restClient);
    KsqlRestConfig restServerConfig = new KsqlRestConfig(defaultServerProperties());
    commandTopicName = restServerConfig.getCommandTopic(KsqlConfig.KSQL_SERVICE_ID_DEFAULT);
    orderDataProvider = new OrderDataProvider();
    CLUSTER.createTopic(orderDataProvider.topicName());
    KsqlRestApplication restServer = KsqlRestApplication.buildApplication(restServerConfig, false, EasyMock.mock(VersionCheckerAgent.class));
    restServer.start();
    localCli = new Cli(STREAMED_QUERY_ROW_LIMIT, STREAMED_QUERY_TIMEOUT_MS, restClient, terminal);
    TestRunner.setup(localCli, terminal);
    topicProducer = new TopicProducer(CLUSTER);
    topicConsumer = new TopicConsumer(CLUSTER);
    testListOrShowCommands();
    produceInputStream(orderDataProvider);
}
Also used : KsqlRestClient(io.confluent.ksql.rest.client.KsqlRestClient) KsqlRestApplication(io.confluent.ksql.rest.server.KsqlRestApplication) Cli(io.confluent.ksql.cli.Cli) KsqlRestConfig(io.confluent.ksql.rest.server.KsqlRestConfig) VersionCheckerAgent(io.confluent.ksql.version.metrics.VersionCheckerAgent) BeforeClass(org.junit.BeforeClass)

Example 2 with KsqlRestConfig

use of io.confluent.ksql.rest.server.KsqlRestConfig in project ksql by confluentinc.

the class KsqlResourceTest method setUp.

@Before
public void setUp() throws IOException, RestClientException {
    SchemaRegistryClient schemaRegistryClient = new MockSchemaRegistryClient();
    registerSchema(schemaRegistryClient);
    ksqlRestConfig = new KsqlRestConfig(TestKsqlResourceUtil.getDefaultKsqlConfig());
    KsqlConfig ksqlConfig = new KsqlConfig(ksqlRestConfig.getKsqlConfigProperties());
    ksqlEngine = new KsqlEngine(ksqlConfig, new MockKafkaTopicClient(), schemaRegistryClient, new MetaStoreImpl());
}
Also used : KsqlEngine(io.confluent.ksql.KsqlEngine) MockSchemaRegistryClient(io.confluent.kafka.schemaregistry.client.MockSchemaRegistryClient) KsqlRestConfig(io.confluent.ksql.rest.server.KsqlRestConfig) MockKafkaTopicClient(io.confluent.ksql.rest.server.mock.MockKafkaTopicClient) MetaStoreImpl(io.confluent.ksql.metastore.MetaStoreImpl) KsqlConfig(io.confluent.ksql.util.KsqlConfig) SchemaRegistryClient(io.confluent.kafka.schemaregistry.client.SchemaRegistryClient) MockSchemaRegistryClient(io.confluent.kafka.schemaregistry.client.MockSchemaRegistryClient) Before(org.junit.Before)

Example 3 with KsqlRestConfig

use of io.confluent.ksql.rest.server.KsqlRestConfig in project ksql by confluentinc.

the class KsqlRestClientTest method init.

@Before
public void init() throws Exception {
    final int port = TestUtils.randomFreeLocalPort();
    Map<String, Object> props = new HashMap<>();
    props.put(KsqlRestConfig.LISTENERS_CONFIG, "http://localhost:" + port);
    props.put(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, "localhost:9092");
    props.put(StreamsConfig.APPLICATION_ID_CONFIG, "ksql_config_test");
    ksqlRestConfig = new KsqlRestConfig(props);
    mockApplication = new MockApplication(ksqlRestConfig);
    mockApplication.start();
    ksqlRestClient = new KsqlRestClient("http://localhost:" + port);
}
Also used : MockApplication(io.confluent.ksql.rest.server.mock.MockApplication) HashMap(java.util.HashMap) KsqlRestConfig(io.confluent.ksql.rest.server.KsqlRestConfig) Before(org.junit.Before)

Aggregations

KsqlRestConfig (io.confluent.ksql.rest.server.KsqlRestConfig)3 Before (org.junit.Before)2 MockSchemaRegistryClient (io.confluent.kafka.schemaregistry.client.MockSchemaRegistryClient)1 SchemaRegistryClient (io.confluent.kafka.schemaregistry.client.SchemaRegistryClient)1 KsqlEngine (io.confluent.ksql.KsqlEngine)1 Cli (io.confluent.ksql.cli.Cli)1 MetaStoreImpl (io.confluent.ksql.metastore.MetaStoreImpl)1 KsqlRestClient (io.confluent.ksql.rest.client.KsqlRestClient)1 KsqlRestApplication (io.confluent.ksql.rest.server.KsqlRestApplication)1 MockApplication (io.confluent.ksql.rest.server.mock.MockApplication)1 MockKafkaTopicClient (io.confluent.ksql.rest.server.mock.MockKafkaTopicClient)1 KsqlConfig (io.confluent.ksql.util.KsqlConfig)1 VersionCheckerAgent (io.confluent.ksql.version.metrics.VersionCheckerAgent)1 HashMap (java.util.HashMap)1 BeforeClass (org.junit.BeforeClass)1