use of software.amazon.awssdk.services.kinesis.model.DescribeStreamConsumerRequest in project flink by apache.
the class KinesisProxyV2Test method testDescribeStreamConsumerWithStreamConsumerArn.
@Test
public void testDescribeStreamConsumerWithStreamConsumerArn() throws Exception {
KinesisAsyncClient client = mock(KinesisAsyncClient.class);
KinesisProxyV2 proxy = new KinesisProxyV2(client, mock(SdkAsyncHttpClient.class), createConfiguration(), mock(FullJitterBackoff.class));
DescribeStreamConsumerResponse expected = DescribeStreamConsumerResponse.builder().build();
ArgumentCaptor<DescribeStreamConsumerRequest> requestCaptor = ArgumentCaptor.forClass(DescribeStreamConsumerRequest.class);
when(client.describeStreamConsumer(requestCaptor.capture())).thenReturn(CompletableFuture.completedFuture(expected));
DescribeStreamConsumerResponse actual = proxy.describeStreamConsumer("arn");
assertEquals(expected, actual);
DescribeStreamConsumerRequest request = requestCaptor.getValue();
assertEquals("arn", request.consumerARN());
}
use of software.amazon.awssdk.services.kinesis.model.DescribeStreamConsumerRequest in project flink by apache.
the class KinesisProxyV2Test method testDescribeStreamConsumerWithStreamArnAndConsumerName.
@Test
public void testDescribeStreamConsumerWithStreamArnAndConsumerName() throws Exception {
KinesisAsyncClient client = mock(KinesisAsyncClient.class);
KinesisProxyV2 proxy = new KinesisProxyV2(client, mock(SdkAsyncHttpClient.class), createConfiguration(), mock(FullJitterBackoff.class));
DescribeStreamConsumerResponse expected = DescribeStreamConsumerResponse.builder().build();
ArgumentCaptor<DescribeStreamConsumerRequest> requestCaptor = ArgumentCaptor.forClass(DescribeStreamConsumerRequest.class);
when(client.describeStreamConsumer(requestCaptor.capture())).thenReturn(CompletableFuture.completedFuture(expected));
DescribeStreamConsumerResponse actual = proxy.describeStreamConsumer("arn", "name");
assertEquals(expected, actual);
DescribeStreamConsumerRequest request = requestCaptor.getValue();
assertEquals("arn", request.streamARN());
assertEquals("name", request.consumerName());
}
Aggregations