Search in sources :

Example 1 with TransactWriteItemsResponse

use of software.amazon.awssdk.services.dynamodb.model.TransactWriteItemsResponse in project aws-sdk-java-v2 by aws.

the class TransactWriteItemsOperationTest method transformResponse_doesNothing.

@Test
public void transformResponse_doesNothing() {
    TransactWriteItemsOperation operation = TransactWriteItemsOperation.create(emptyRequest());
    TransactWriteItemsResponse response = TransactWriteItemsResponse.builder().build();
    operation.transformResponse(response, mockDynamoDbEnhancedClientExtension);
    verifyNoMoreInteractions(mockDynamoDbEnhancedClientExtension);
}
Also used : TransactWriteItemsResponse(software.amazon.awssdk.services.dynamodb.model.TransactWriteItemsResponse) Test(org.junit.Test)

Example 2 with TransactWriteItemsResponse

use of software.amazon.awssdk.services.dynamodb.model.TransactWriteItemsResponse in project aws-sdk-java-v2 by aws.

the class TransactWriteItemsOperationTest method getServiceCall_callsServiceAndReturnsResult.

@Test
public void getServiceCall_callsServiceAndReturnsResult() {
    TransactWriteItemsOperation operation = TransactWriteItemsOperation.create(emptyRequest());
    TransactWriteItemsRequest request = TransactWriteItemsRequest.builder().transactItems(singletonList(fakeTransactWriteItem1)).build();
    TransactWriteItemsResponse expectedResponse = TransactWriteItemsResponse.builder().build();
    when(mockDynamoDbClient.transactWriteItems(any(TransactWriteItemsRequest.class))).thenReturn(expectedResponse);
    TransactWriteItemsResponse actualResponse = operation.serviceCall(mockDynamoDbClient).apply(request);
    assertThat(actualResponse, is(sameInstance(expectedResponse)));
    verify(mockDynamoDbClient).transactWriteItems(request);
    verifyNoMoreInteractions(mockDynamoDbEnhancedClientExtension);
}
Also used : TransactWriteItemsRequest(software.amazon.awssdk.services.dynamodb.model.TransactWriteItemsRequest) TransactWriteItemsResponse(software.amazon.awssdk.services.dynamodb.model.TransactWriteItemsResponse) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 TransactWriteItemsResponse (software.amazon.awssdk.services.dynamodb.model.TransactWriteItemsResponse)2 TransactWriteItemsRequest (software.amazon.awssdk.services.dynamodb.model.TransactWriteItemsRequest)1