Search in sources :

Example 1 with AbstractSingleShardFanOutKinesisV2

use of org.apache.flink.streaming.connectors.kinesis.testutils.FakeKinesisFanOutBehavioursFactory.AbstractSingleShardFanOutKinesisV2 in project flink by apache.

the class ShardConsumerFanOutTest method testStartFromLatestReceivesNoRecordsContinuesToUseTimestamp.

@Test
public void testStartFromLatestReceivesNoRecordsContinuesToUseTimestamp() throws Exception {
    AbstractSingleShardFanOutKinesisV2 kinesis = FakeKinesisFanOutBehavioursFactory.emptyBatchFollowedBySingleRecord();
    SequenceNumber sequenceNumber = SENTINEL_LATEST_SEQUENCE_NUM.get();
    // Fake behaviour defaults to 10 messages
    assertNumberOfMessagesReceivedFromKinesis(1, kinesis, sequenceNumber, efoProperties());
    // This fake Kinesis will give 2 subscriptions
    assertEquals(2, kinesis.getNumberOfSubscribeToShardInvocations());
    assertEquals(AT_TIMESTAMP, kinesis.getStartingPositionForSubscription(0).type());
    assertEquals(AT_TIMESTAMP, kinesis.getStartingPositionForSubscription(1).type());
}
Also used : AbstractSingleShardFanOutKinesisV2(org.apache.flink.streaming.connectors.kinesis.testutils.FakeKinesisFanOutBehavioursFactory.AbstractSingleShardFanOutKinesisV2) ShardConsumerTestUtils.fakeSequenceNumber(org.apache.flink.streaming.connectors.kinesis.internals.ShardConsumerTestUtils.fakeSequenceNumber) SequenceNumber(org.apache.flink.streaming.connectors.kinesis.model.SequenceNumber) Test(org.junit.Test)

Aggregations

ShardConsumerTestUtils.fakeSequenceNumber (org.apache.flink.streaming.connectors.kinesis.internals.ShardConsumerTestUtils.fakeSequenceNumber)1 SequenceNumber (org.apache.flink.streaming.connectors.kinesis.model.SequenceNumber)1 AbstractSingleShardFanOutKinesisV2 (org.apache.flink.streaming.connectors.kinesis.testutils.FakeKinesisFanOutBehavioursFactory.AbstractSingleShardFanOutKinesisV2)1 Test (org.junit.Test)1