Search in sources :

Example 6 with KsqlConfig

use of io.confluent.ksql.util.KsqlConfig in project ksql by confluentinc.

the class KsqlBareOutputNodeTest method build.

private SchemaKStream build() {
    final String simpleSelectFilter = "SELECT col0, col2, col3 FROM test1 WHERE col0 > 100;";
    final KsqlBareOutputNode planNode = (KsqlBareOutputNode) planBuilder.buildLogicalPlan(simpleSelectFilter);
    return planNode.buildStream(builder, new KsqlConfig(Collections.emptyMap()), new FakeKafkaTopicClient(), new FunctionRegistry(), new HashMap<>(), new MockSchemaRegistryClient());
}
Also used : FunctionRegistry(io.confluent.ksql.function.FunctionRegistry) MockSchemaRegistryClient(io.confluent.kafka.schemaregistry.client.MockSchemaRegistryClient) FakeKafkaTopicClient(io.confluent.ksql.util.FakeKafkaTopicClient) KsqlConfig(io.confluent.ksql.util.KsqlConfig)

Example 7 with KsqlConfig

use of io.confluent.ksql.util.KsqlConfig in project ksql by confluentinc.

the class KsqlSchemaRegistryClientFactoryTest method shouldPickUpPrefixedSslConfig.

@Test
public void shouldPickUpPrefixedSslConfig() {
    // Given:
    final KsqlConfig config = config("ksql.schema.registry." + SslConfigs.SSL_PROTOCOL_CONFIG, "SSLv3");
    final Map<String, Object> expectedConfigs = defaultConfigs();
    expectedConfigs.put(SslConfigs.SSL_PROTOCOL_CONFIG, "SSLv3");
    setUpMocksWithExpectedConfig(expectedConfigs);
    // When:
    final SchemaRegistryClient client = new KsqlSchemaRegistryClientFactory(config, restServiceSupplier, sslFactory).create();
    // Then:
    assertThat(client, is(notNullValue()));
    EasyMock.verify(restService);
}
Also used : KsqlConfig(io.confluent.ksql.util.KsqlConfig) SchemaRegistryClient(io.confluent.kafka.schemaregistry.client.SchemaRegistryClient) Test(org.junit.Test)

Example 8 with KsqlConfig

use of io.confluent.ksql.util.KsqlConfig in project ksql by confluentinc.

the class KsqlSchemaRegistryClientFactoryTest method shouldSetSocketFactoryWhenNoSpecificSslConfig.

@Test
public void shouldSetSocketFactoryWhenNoSpecificSslConfig() {
    // Given:
    final KsqlConfig config = config();
    final Map<String, Object> expectedConfigs = defaultConfigs();
    setUpMocksWithExpectedConfig(expectedConfigs);
    // When:
    final SchemaRegistryClient client = new KsqlSchemaRegistryClientFactory(config, restServiceSupplier, sslFactory).create();
    // Then:
    assertThat(client, is(notNullValue()));
    EasyMock.verify(restService);
}
Also used : KsqlConfig(io.confluent.ksql.util.KsqlConfig) SchemaRegistryClient(io.confluent.kafka.schemaregistry.client.SchemaRegistryClient) Test(org.junit.Test)

Example 9 with KsqlConfig

use of io.confluent.ksql.util.KsqlConfig in project ksql by confluentinc.

the class KsqlSchemaRegistryClientFactoryTest method shouldPickUpNonPrefixedSslConfig.

@Test
public void shouldPickUpNonPrefixedSslConfig() {
    // Given:
    final KsqlConfig config = config(SslConfigs.SSL_PROTOCOL_CONFIG, "SSLv3");
    final Map<String, Object> expectedConfigs = defaultConfigs();
    expectedConfigs.put(SslConfigs.SSL_PROTOCOL_CONFIG, "SSLv3");
    setUpMocksWithExpectedConfig(expectedConfigs);
    // When:
    final SchemaRegistryClient client = new KsqlSchemaRegistryClientFactory(config, restServiceSupplier, sslFactory).create();
    // Then:
    assertThat(client, is(notNullValue()));
    EasyMock.verify(restService);
}
Also used : KsqlConfig(io.confluent.ksql.util.KsqlConfig) SchemaRegistryClient(io.confluent.kafka.schemaregistry.client.SchemaRegistryClient) Test(org.junit.Test)

Example 10 with KsqlConfig

use of io.confluent.ksql.util.KsqlConfig in project ksql by confluentinc.

the class SchemaKStreamTest method init.

@Before
public void init() {
    functionRegistry = new FunctionRegistry();
    ksqlStream = (KsqlStream) metaStore.getSource("TEST1");
    StreamsBuilder builder = new StreamsBuilder();
    kStream = builder.stream(ksqlStream.getKsqlTopic().getKafkaTopicName(), Consumed.with(Serdes.String(), ksqlStream.getKsqlTopic().getKsqlTopicSerDe().getGenericRowSerde(null, new KsqlConfig(Collections.emptyMap()), false, new MockSchemaRegistryClient())));
}
Also used : StreamsBuilder(org.apache.kafka.streams.StreamsBuilder) FunctionRegistry(io.confluent.ksql.function.FunctionRegistry) MockSchemaRegistryClient(io.confluent.kafka.schemaregistry.client.MockSchemaRegistryClient) KsqlConfig(io.confluent.ksql.util.KsqlConfig) Before(org.junit.Before)

Aggregations

KsqlConfig (io.confluent.ksql.util.KsqlConfig)29 HashMap (java.util.HashMap)13 MockSchemaRegistryClient (io.confluent.kafka.schemaregistry.client.MockSchemaRegistryClient)11 SchemaRegistryClient (io.confluent.kafka.schemaregistry.client.SchemaRegistryClient)9 Before (org.junit.Before)9 Test (org.junit.Test)9 KafkaTopicClientImpl (io.confluent.ksql.util.KafkaTopicClientImpl)8 KsqlEngine (io.confluent.ksql.KsqlEngine)7 FunctionRegistry (io.confluent.ksql.function.FunctionRegistry)6 List (java.util.List)5 StreamsBuilder (org.apache.kafka.streams.StreamsBuilder)5 GenericRow (io.confluent.ksql.GenericRow)4 KafkaTopicClient (io.confluent.ksql.util.KafkaTopicClient)4 Map (java.util.Map)4 KafkaAvroDeserializer (io.confluent.kafka.serializers.KafkaAvroDeserializer)2 KsqlTopic (io.confluent.ksql.metastore.KsqlTopic)2 MetaStoreImpl (io.confluent.ksql.metastore.MetaStoreImpl)2 MockKafkaTopicClient (io.confluent.ksql.rest.server.mock.MockKafkaTopicClient)2 KsqlException (io.confluent.ksql.util.KsqlException)2 GenericData (org.apache.avro.generic.GenericData)2