Search in sources :

Example 1 with DeregisterStreamConsumerResponse

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

the class KinesisProxyV2Test method testDeregisterStreamConsumer.

@Test
public void testDeregisterStreamConsumer() throws Exception {
    KinesisAsyncClient client = mock(KinesisAsyncClient.class);
    KinesisProxyV2 proxy = new KinesisProxyV2(client, mock(SdkAsyncHttpClient.class), createConfiguration(), mock(FullJitterBackoff.class));
    DeregisterStreamConsumerResponse expected = DeregisterStreamConsumerResponse.builder().build();
    ArgumentCaptor<DeregisterStreamConsumerRequest> requestCaptor = ArgumentCaptor.forClass(DeregisterStreamConsumerRequest.class);
    when(client.deregisterStreamConsumer(requestCaptor.capture())).thenReturn(CompletableFuture.completedFuture(expected));
    DeregisterStreamConsumerResponse actual = proxy.deregisterStreamConsumer("arn");
    assertEquals(expected, actual);
    DeregisterStreamConsumerRequest request = requestCaptor.getValue();
    assertEquals("arn", request.consumerARN());
}
Also used : KinesisAsyncClient(software.amazon.awssdk.services.kinesis.KinesisAsyncClient) DeregisterStreamConsumerResponse(software.amazon.awssdk.services.kinesis.model.DeregisterStreamConsumerResponse) DeregisterStreamConsumerRequest(software.amazon.awssdk.services.kinesis.model.DeregisterStreamConsumerRequest) SdkAsyncHttpClient(software.amazon.awssdk.http.async.SdkAsyncHttpClient) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 SdkAsyncHttpClient (software.amazon.awssdk.http.async.SdkAsyncHttpClient)1 KinesisAsyncClient (software.amazon.awssdk.services.kinesis.KinesisAsyncClient)1 DeregisterStreamConsumerRequest (software.amazon.awssdk.services.kinesis.model.DeregisterStreamConsumerRequest)1 DeregisterStreamConsumerResponse (software.amazon.awssdk.services.kinesis.model.DeregisterStreamConsumerResponse)1