Search in sources :

Example 1 with MockSerializationSchema

use of org.apache.flink.streaming.util.MockSerializationSchema in project flink by splunk.

the class FlinkKinesisProducerTest method testOpen.

@Test
public void testOpen() throws Exception {
    MockSerializationSchema<Object> serializationSchema = new MockSerializationSchema<>();
    Properties config = TestUtils.getStandardProperties();
    FlinkKinesisProducer<Object> producer = new FlinkKinesisProducer<>(serializationSchema, config);
    AbstractStreamOperatorTestHarness<Object> testHarness = new AbstractStreamOperatorTestHarness<>(new StreamSink<>(producer), 1, 1, 0);
    testHarness.open();
    assertThat("Open method was not called", serializationSchema.isOpenCalled(), is(true));
}
Also used : Properties(java.util.Properties) MockSerializationSchema(org.apache.flink.streaming.util.MockSerializationSchema) AbstractStreamOperatorTestHarness(org.apache.flink.streaming.util.AbstractStreamOperatorTestHarness) Test(org.junit.Test)

Example 2 with MockSerializationSchema

use of org.apache.flink.streaming.util.MockSerializationSchema in project flink by apache.

the class FlinkKinesisProducerTest method testOpen.

@Test
public void testOpen() throws Exception {
    MockSerializationSchema<Object> serializationSchema = new MockSerializationSchema<>();
    Properties config = TestUtils.getStandardProperties();
    FlinkKinesisProducer<Object> producer = new FlinkKinesisProducer<>(serializationSchema, config);
    AbstractStreamOperatorTestHarness<Object> testHarness = new AbstractStreamOperatorTestHarness<>(new StreamSink<>(producer), 1, 1, 0);
    testHarness.open();
    assertThat("Open method was not called", serializationSchema.isOpenCalled(), is(true));
}
Also used : Properties(java.util.Properties) MockSerializationSchema(org.apache.flink.streaming.util.MockSerializationSchema) AbstractStreamOperatorTestHarness(org.apache.flink.streaming.util.AbstractStreamOperatorTestHarness) Test(org.junit.Test)

Example 3 with MockSerializationSchema

use of org.apache.flink.streaming.util.MockSerializationSchema in project flink-mirror by flink-ci.

the class FlinkKinesisProducerTest method testOpen.

@Test
public void testOpen() throws Exception {
    MockSerializationSchema<Object> serializationSchema = new MockSerializationSchema<>();
    Properties config = TestUtils.getStandardProperties();
    FlinkKinesisProducer<Object> producer = new FlinkKinesisProducer<>(serializationSchema, config);
    AbstractStreamOperatorTestHarness<Object> testHarness = new AbstractStreamOperatorTestHarness<>(new StreamSink<>(producer), 1, 1, 0);
    testHarness.open();
    assertThat("Open method was not called", serializationSchema.isOpenCalled(), is(true));
}
Also used : Properties(java.util.Properties) MockSerializationSchema(org.apache.flink.streaming.util.MockSerializationSchema) AbstractStreamOperatorTestHarness(org.apache.flink.streaming.util.AbstractStreamOperatorTestHarness) Test(org.junit.Test)

Aggregations

Properties (java.util.Properties)3 AbstractStreamOperatorTestHarness (org.apache.flink.streaming.util.AbstractStreamOperatorTestHarness)3 MockSerializationSchema (org.apache.flink.streaming.util.MockSerializationSchema)3 Test (org.junit.Test)3