public static async Task ClassInitialize(TestContext context)
    {
        RestApiProvider = KSqlDbRestApiProvider.Create();

        var response = await RestApiProvider.CreateTypeAsync <TestState>();

        response = await RestApiProvider.CreateTypeAsync <TestCity>();

        response = await RestApiProvider.CreateTableAsync <TestCity>(new EntityCreationMetadata { EntityName = CitiesTableName, KafkaTopic = CitiesTableName, Partitions = 1 });

        var c = await response.Content.ReadAsStringAsync();

        response = await RestApiProvider.InsertIntoAsync(new TestCity
                                                         { RegionCode = "sk", State = State1 }, new InsertProperties { EntityName = CitiesTableName });
    }
Exemple #2
0
    public static async Task ClassInitialize(TestContext context)
    {
        RestApiProvider = KSqlDbRestApiProvider.Create();

        var statement =
            new KSqlDbStatement(
                @"CREATE STREAM stream2 (id INT, lambda_arr ARRAY<INTEGER>) WITH (kafka_topic = 'stream2', partitions = 1, value_format = 'json');");

        var response = await RestApiProvider.ExecuteStatementAsync(statement);

        var statement2 =
            new KSqlDbStatement(
                @"CREATE OR REPLACE STREAM stream4 (id INT, lambda_map MAP<STRING,ARRAY<INTEGER>>) WITH (kafka_topic = 'stream4', partitions = 1, value_format = 'json');");

        response = await RestApiProvider.ExecuteStatementAsync(statement2);

        string insertIntoStream3 = "insert into stream4 (id, lambda_map) values (1, MAP('hello':= ARRAY [1,2,3], 'goodbye':= ARRAY [-1,-2,-3]) );";

        response = await RestApiProvider.ExecuteStatementAsync(
            new KSqlDbStatement("insert into stream2 (id, lambda_arr) values (1, ARRAY [1,2,3]);"));

        response = await RestApiProvider.ExecuteStatementAsync(
            new KSqlDbStatement(insertIntoStream3));
    }
Exemple #3
0
 public new static async Task ClassCleanup()
 {
     var result = await RestApiProvider.DropStreamAndTopic(StreamName);
 }