Search in sources :

Example 1 with ResourceNotFoundException

use of software.amazon.awssdk.services.kinesis.model.ResourceNotFoundException in project flink by apache.

the class FanOutRecordPublisherTest method testShardConsumerCompletesIfResourceNotFoundExceptionThrownFromSubscription.

@Test
public void testShardConsumerCompletesIfResourceNotFoundExceptionThrownFromSubscription() throws Exception {
    ResourceNotFoundException exception = ResourceNotFoundException.builder().build();
    SubscriptionErrorKinesisV2 kinesis = FakeKinesisFanOutBehavioursFactory.errorDuringSubscription(exception);
    RecordPublisher recordPublisher = createRecordPublisher(kinesis);
    TestConsumer consumer = new TestConsumer();
    assertEquals(COMPLETE, recordPublisher.run(consumer));
    // Will exit on the first subscription
    assertEquals(1, kinesis.getNumberOfSubscribeToShardInvocations());
}
Also used : RecordPublisher(org.apache.flink.streaming.connectors.kinesis.internals.publisher.RecordPublisher) ResourceNotFoundException(software.amazon.awssdk.services.kinesis.model.ResourceNotFoundException) SubscriptionErrorKinesisV2(org.apache.flink.streaming.connectors.kinesis.testutils.FakeKinesisFanOutBehavioursFactory.SubscriptionErrorKinesisV2) TestConsumer(org.apache.flink.streaming.connectors.kinesis.testutils.TestUtils.TestConsumer) Test(org.junit.Test)

Aggregations

RecordPublisher (org.apache.flink.streaming.connectors.kinesis.internals.publisher.RecordPublisher)1 SubscriptionErrorKinesisV2 (org.apache.flink.streaming.connectors.kinesis.testutils.FakeKinesisFanOutBehavioursFactory.SubscriptionErrorKinesisV2)1 TestConsumer (org.apache.flink.streaming.connectors.kinesis.testutils.TestUtils.TestConsumer)1 Test (org.junit.Test)1 ResourceNotFoundException (software.amazon.awssdk.services.kinesis.model.ResourceNotFoundException)1