Search in sources :

Example 1 with DescribeStreamConsumerRequest

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());
}
Also used : KinesisAsyncClient(software.amazon.awssdk.services.kinesis.KinesisAsyncClient) DescribeStreamConsumerResponse(software.amazon.awssdk.services.kinesis.model.DescribeStreamConsumerResponse) DescribeStreamConsumerRequest(software.amazon.awssdk.services.kinesis.model.DescribeStreamConsumerRequest) SdkAsyncHttpClient(software.amazon.awssdk.http.async.SdkAsyncHttpClient) Test(org.junit.Test)

Example 2 with DescribeStreamConsumerRequest

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());
}
Also used : KinesisAsyncClient(software.amazon.awssdk.services.kinesis.KinesisAsyncClient) DescribeStreamConsumerResponse(software.amazon.awssdk.services.kinesis.model.DescribeStreamConsumerResponse) DescribeStreamConsumerRequest(software.amazon.awssdk.services.kinesis.model.DescribeStreamConsumerRequest) SdkAsyncHttpClient(software.amazon.awssdk.http.async.SdkAsyncHttpClient) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 SdkAsyncHttpClient (software.amazon.awssdk.http.async.SdkAsyncHttpClient)2 KinesisAsyncClient (software.amazon.awssdk.services.kinesis.KinesisAsyncClient)2 DescribeStreamConsumerRequest (software.amazon.awssdk.services.kinesis.model.DescribeStreamConsumerRequest)2 DescribeStreamConsumerResponse (software.amazon.awssdk.services.kinesis.model.DescribeStreamConsumerResponse)2