Search in sources :

Example 1 with FakeItemWithSort

use of software.amazon.awssdk.enhanced.dynamodb.functionaltests.models.FakeItemWithSort in project aws-sdk-java-v2 by aws.

the class VersionedRecordExtensionTest method beforeWrite_returnsNoOpModification_ifVersionAttributeNotDefined.

@Test
public void beforeWrite_returnsNoOpModification_ifVersionAttributeNotDefined() {
    FakeItemWithSort fakeItemWithSort = createUniqueFakeItemWithSort();
    Map<String, AttributeValue> itemMap = new HashMap<>(FakeItemWithSort.getTableSchema().itemToMap(fakeItemWithSort, true));
    WriteModification writeModification = versionedRecordExtension.beforeWrite(DefaultDynamoDbExtensionContext.builder().items(itemMap).operationContext(PRIMARY_CONTEXT).tableMetadata(FakeItemWithSort.getTableMetadata()).build());
    assertThat(writeModification, is(WriteModification.builder().build()));
}
Also used : AttributeValue(software.amazon.awssdk.services.dynamodb.model.AttributeValue) FakeItemWithSort(software.amazon.awssdk.enhanced.dynamodb.functionaltests.models.FakeItemWithSort) FakeItemWithSort.createUniqueFakeItemWithSort(software.amazon.awssdk.enhanced.dynamodb.functionaltests.models.FakeItemWithSort.createUniqueFakeItemWithSort) HashMap(java.util.HashMap) Test(org.junit.Test)

Example 2 with FakeItemWithSort

use of software.amazon.awssdk.enhanced.dynamodb.functionaltests.models.FakeItemWithSort in project aws-sdk-java-v2 by aws.

the class UpdateItemOperationTest method generateRequest_multipleDeletes.

@Test
public void generateRequest_multipleDeletes() {
    FakeItemWithSort item = createUniqueFakeItemWithSort();
    UpdateItemOperation<FakeItemWithSort> updateItemOperation = UpdateItemOperation.create(requestFakeItemWithSort(item, b -> b.ignoreNulls(false)));
    UpdateItemRequest request = updateItemOperation.generateRequest(FakeItemWithSort.getTableSchema(), PRIMARY_CONTEXT, null);
    UpdateItemRequest.Builder expectedRequestBuilder = ddbRequestBuilder(ddbKey(item.getId(), item.getSort()));
    expectedRequestBuilder.expressionAttributeNames(expressionNamesFor(OTHER_ATTRIBUTE_1_NAME, OTHER_ATTRIBUTE_2_NAME));
    String updateExpression1 = "REMOVE " + OTHER_ATTRIBUTE_1_NAME + ", " + OTHER_ATTRIBUTE_2_NAME;
    UpdateItemRequest expectedRequest1 = expectedRequestBuilder.updateExpression(updateExpression1).build();
    String updateExpression2 = "REMOVE " + OTHER_ATTRIBUTE_2_NAME + ", " + OTHER_ATTRIBUTE_1_NAME;
    UpdateItemRequest expectedRequest2 = expectedRequestBuilder.updateExpression(updateExpression2).build();
    assertThat(request, either(is(expectedRequest1)).or(is(expectedRequest2)));
}
Also used : ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) Matchers.either(org.hamcrest.Matchers.either) AttributeValues.numberValue(software.amazon.awssdk.enhanced.dynamodb.internal.AttributeValues.numberValue) Mock(org.mockito.Mock) UpdateItemRequest(software.amazon.awssdk.services.dynamodb.model.UpdateItemRequest) RunWith(org.junit.runner.RunWith) FakeItemWithSort(software.amazon.awssdk.enhanced.dynamodb.functionaltests.models.FakeItemWithSort) HashMap(java.util.HashMap) Expression(software.amazon.awssdk.enhanced.dynamodb.Expression) Collections.singletonList(java.util.Collections.singletonList) UpdateExpression(software.amazon.awssdk.enhanced.dynamodb.update.UpdateExpression) FakeItem.createUniqueFakeItem(software.amazon.awssdk.enhanced.dynamodb.functionaltests.models.FakeItem.createUniqueFakeItem) Matchers.nullValue(org.hamcrest.Matchers.nullValue) Map(java.util.Map) Collections.singletonMap(java.util.Collections.singletonMap) Assert.fail(org.junit.Assert.fail) FakeItem(software.amazon.awssdk.enhanced.dynamodb.functionaltests.models.FakeItem) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) Matchers.hasEntry(org.hamcrest.Matchers.hasEntry) DynamoDbClient(software.amazon.awssdk.services.dynamodb.DynamoDbClient) ReadModification(software.amazon.awssdk.enhanced.dynamodb.extensions.ReadModification) ReturnConsumedCapacity(software.amazon.awssdk.services.dynamodb.model.ReturnConsumedCapacity) Test(org.junit.Test) Mockito.when(org.mockito.Mockito.when) UUID(java.util.UUID) WriteModification(software.amazon.awssdk.enhanced.dynamodb.extensions.WriteModification) Collectors(java.util.stream.Collectors) Mockito.verify(org.mockito.Mockito.verify) UpdateItemEnhancedRequest(software.amazon.awssdk.enhanced.dynamodb.model.UpdateItemEnhancedRequest) Consumer(java.util.function.Consumer) DefaultDynamoDbExtensionContext(software.amazon.awssdk.enhanced.dynamodb.internal.extensions.DefaultDynamoDbExtensionContext) DynamoDbEnhancedClientExtension(software.amazon.awssdk.enhanced.dynamodb.DynamoDbEnhancedClientExtension) TableMetadata(software.amazon.awssdk.enhanced.dynamodb.TableMetadata) Stream(java.util.stream.Stream) DeleteAction(software.amazon.awssdk.enhanced.dynamodb.update.DeleteAction) Matchers.sameInstance(org.hamcrest.Matchers.sameInstance) OperationContext(software.amazon.awssdk.enhanced.dynamodb.OperationContext) FakeItemWithSort.createUniqueFakeItemWithSort(software.amazon.awssdk.enhanced.dynamodb.functionaltests.models.FakeItemWithSort.createUniqueFakeItemWithSort) AttributeValue(software.amazon.awssdk.services.dynamodb.model.AttributeValue) Matchers.is(org.hamcrest.Matchers.is) DynamoDbExtensionContext(software.amazon.awssdk.enhanced.dynamodb.DynamoDbExtensionContext) Matchers.containsString(org.hamcrest.Matchers.containsString) Collections(java.util.Collections) MockitoJUnitRunner(org.mockito.junit.MockitoJUnitRunner) ReturnValue(software.amazon.awssdk.services.dynamodb.model.ReturnValue) ReturnItemCollectionMetrics(software.amazon.awssdk.services.dynamodb.model.ReturnItemCollectionMetrics) UpdateItemResponse(software.amazon.awssdk.services.dynamodb.model.UpdateItemResponse) UpdateItemRequest(software.amazon.awssdk.services.dynamodb.model.UpdateItemRequest) FakeItemWithSort(software.amazon.awssdk.enhanced.dynamodb.functionaltests.models.FakeItemWithSort) FakeItemWithSort.createUniqueFakeItemWithSort(software.amazon.awssdk.enhanced.dynamodb.functionaltests.models.FakeItemWithSort.createUniqueFakeItemWithSort) Matchers.containsString(org.hamcrest.Matchers.containsString) Test(org.junit.Test)

Example 3 with FakeItemWithSort

use of software.amazon.awssdk.enhanced.dynamodb.functionaltests.models.FakeItemWithSort in project aws-sdk-java-v2 by aws.

the class UpdateItemOperationTest method generateRequest_nullValuesNotIgnoredByDefault.

@Test
public void generateRequest_nullValuesNotIgnoredByDefault() {
    FakeItemWithSort item = createUniqueFakeItemWithSort();
    item.setOtherAttribute1("value-1");
    UpdateItemOperation<FakeItemWithSort> updateItemOperation = UpdateItemOperation.create(requestFakeItemWithSort(item, b -> {
    }));
    UpdateItemRequest request = updateItemOperation.generateRequest(FakeItemWithSort.getTableSchema(), PRIMARY_CONTEXT, null);
    String expectedUpdateExpression = "SET " + OTHER_ATTRIBUTE_1_NAME + " = " + OTHER_ATTRIBUTE_1_VALUE + " REMOVE " + OTHER_ATTRIBUTE_2_NAME;
    UpdateItemRequest.Builder expectedRequestBuilder = ddbRequestBuilder(ddbKey(item.getId(), item.getSort()));
    expectedRequestBuilder.expressionAttributeValues(expressionValuesFor(OTHER_ATTRIBUTE_1_VALUE));
    expectedRequestBuilder.expressionAttributeNames(expressionNamesFor(OTHER_ATTRIBUTE_1_NAME, OTHER_ATTRIBUTE_2_NAME));
    expectedRequestBuilder.updateExpression(expectedUpdateExpression);
    assertThat(request, is(expectedRequestBuilder.build()));
}
Also used : ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) Matchers.either(org.hamcrest.Matchers.either) AttributeValues.numberValue(software.amazon.awssdk.enhanced.dynamodb.internal.AttributeValues.numberValue) Mock(org.mockito.Mock) UpdateItemRequest(software.amazon.awssdk.services.dynamodb.model.UpdateItemRequest) RunWith(org.junit.runner.RunWith) FakeItemWithSort(software.amazon.awssdk.enhanced.dynamodb.functionaltests.models.FakeItemWithSort) HashMap(java.util.HashMap) Expression(software.amazon.awssdk.enhanced.dynamodb.Expression) Collections.singletonList(java.util.Collections.singletonList) UpdateExpression(software.amazon.awssdk.enhanced.dynamodb.update.UpdateExpression) FakeItem.createUniqueFakeItem(software.amazon.awssdk.enhanced.dynamodb.functionaltests.models.FakeItem.createUniqueFakeItem) Matchers.nullValue(org.hamcrest.Matchers.nullValue) Map(java.util.Map) Collections.singletonMap(java.util.Collections.singletonMap) Assert.fail(org.junit.Assert.fail) FakeItem(software.amazon.awssdk.enhanced.dynamodb.functionaltests.models.FakeItem) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) Matchers.hasEntry(org.hamcrest.Matchers.hasEntry) DynamoDbClient(software.amazon.awssdk.services.dynamodb.DynamoDbClient) ReadModification(software.amazon.awssdk.enhanced.dynamodb.extensions.ReadModification) ReturnConsumedCapacity(software.amazon.awssdk.services.dynamodb.model.ReturnConsumedCapacity) Test(org.junit.Test) Mockito.when(org.mockito.Mockito.when) UUID(java.util.UUID) WriteModification(software.amazon.awssdk.enhanced.dynamodb.extensions.WriteModification) Collectors(java.util.stream.Collectors) Mockito.verify(org.mockito.Mockito.verify) UpdateItemEnhancedRequest(software.amazon.awssdk.enhanced.dynamodb.model.UpdateItemEnhancedRequest) Consumer(java.util.function.Consumer) DefaultDynamoDbExtensionContext(software.amazon.awssdk.enhanced.dynamodb.internal.extensions.DefaultDynamoDbExtensionContext) DynamoDbEnhancedClientExtension(software.amazon.awssdk.enhanced.dynamodb.DynamoDbEnhancedClientExtension) TableMetadata(software.amazon.awssdk.enhanced.dynamodb.TableMetadata) Stream(java.util.stream.Stream) DeleteAction(software.amazon.awssdk.enhanced.dynamodb.update.DeleteAction) Matchers.sameInstance(org.hamcrest.Matchers.sameInstance) OperationContext(software.amazon.awssdk.enhanced.dynamodb.OperationContext) FakeItemWithSort.createUniqueFakeItemWithSort(software.amazon.awssdk.enhanced.dynamodb.functionaltests.models.FakeItemWithSort.createUniqueFakeItemWithSort) AttributeValue(software.amazon.awssdk.services.dynamodb.model.AttributeValue) Matchers.is(org.hamcrest.Matchers.is) DynamoDbExtensionContext(software.amazon.awssdk.enhanced.dynamodb.DynamoDbExtensionContext) Matchers.containsString(org.hamcrest.Matchers.containsString) Collections(java.util.Collections) MockitoJUnitRunner(org.mockito.junit.MockitoJUnitRunner) ReturnValue(software.amazon.awssdk.services.dynamodb.model.ReturnValue) ReturnItemCollectionMetrics(software.amazon.awssdk.services.dynamodb.model.ReturnItemCollectionMetrics) UpdateItemResponse(software.amazon.awssdk.services.dynamodb.model.UpdateItemResponse) UpdateItemRequest(software.amazon.awssdk.services.dynamodb.model.UpdateItemRequest) FakeItemWithSort(software.amazon.awssdk.enhanced.dynamodb.functionaltests.models.FakeItemWithSort) FakeItemWithSort.createUniqueFakeItemWithSort(software.amazon.awssdk.enhanced.dynamodb.functionaltests.models.FakeItemWithSort.createUniqueFakeItemWithSort) Matchers.containsString(org.hamcrest.Matchers.containsString) Test(org.junit.Test)

Example 4 with FakeItemWithSort

use of software.amazon.awssdk.enhanced.dynamodb.functionaltests.models.FakeItemWithSort in project aws-sdk-java-v2 by aws.

the class UpdateItemOperationTest method generateRequest_multipleSetters.

@Test
public void generateRequest_multipleSetters() {
    FakeItemWithSort item = createUniqueFakeItemWithSort();
    item.setOtherAttribute1("value-1");
    item.setOtherAttribute2("value-2");
    UpdateItemOperation<FakeItemWithSort> updateItemOperation = UpdateItemOperation.create(requestFakeItemWithSort(item, b -> b.ignoreNulls(false)));
    UpdateItemRequest request = updateItemOperation.generateRequest(FakeItemWithSort.getTableSchema(), PRIMARY_CONTEXT, null);
    UpdateItemRequest.Builder expectedRequestBuilder = ddbRequestBuilder(ddbKey(item.getId(), item.getSort()));
    expectedRequestBuilder.expressionAttributeValues(expressionValuesFor(OTHER_ATTRIBUTE_1_VALUE, OTHER_ATTRIBUTE_2_VALUE));
    expectedRequestBuilder.expressionAttributeNames(expressionNamesFor(OTHER_ATTRIBUTE_1_NAME, OTHER_ATTRIBUTE_2_NAME));
    String updateExpression1 = "SET " + OTHER_ATTRIBUTE_1_NAME + " = " + OTHER_ATTRIBUTE_1_VALUE + ", " + OTHER_ATTRIBUTE_2_NAME + " = " + OTHER_ATTRIBUTE_2_VALUE;
    UpdateItemRequest expectedRequest1 = expectedRequestBuilder.updateExpression(updateExpression1).build();
    String updateExpression2 = "SET " + OTHER_ATTRIBUTE_2_NAME + " = " + OTHER_ATTRIBUTE_2_VALUE + ", " + OTHER_ATTRIBUTE_1_NAME + " = " + OTHER_ATTRIBUTE_1_VALUE;
    UpdateItemRequest expectedRequest2 = expectedRequestBuilder.updateExpression(updateExpression2).build();
    assertThat(request, either(is(expectedRequest1)).or(is(expectedRequest2)));
}
Also used : ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) Matchers.either(org.hamcrest.Matchers.either) AttributeValues.numberValue(software.amazon.awssdk.enhanced.dynamodb.internal.AttributeValues.numberValue) Mock(org.mockito.Mock) UpdateItemRequest(software.amazon.awssdk.services.dynamodb.model.UpdateItemRequest) RunWith(org.junit.runner.RunWith) FakeItemWithSort(software.amazon.awssdk.enhanced.dynamodb.functionaltests.models.FakeItemWithSort) HashMap(java.util.HashMap) Expression(software.amazon.awssdk.enhanced.dynamodb.Expression) Collections.singletonList(java.util.Collections.singletonList) UpdateExpression(software.amazon.awssdk.enhanced.dynamodb.update.UpdateExpression) FakeItem.createUniqueFakeItem(software.amazon.awssdk.enhanced.dynamodb.functionaltests.models.FakeItem.createUniqueFakeItem) Matchers.nullValue(org.hamcrest.Matchers.nullValue) Map(java.util.Map) Collections.singletonMap(java.util.Collections.singletonMap) Assert.fail(org.junit.Assert.fail) FakeItem(software.amazon.awssdk.enhanced.dynamodb.functionaltests.models.FakeItem) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) Matchers.hasEntry(org.hamcrest.Matchers.hasEntry) DynamoDbClient(software.amazon.awssdk.services.dynamodb.DynamoDbClient) ReadModification(software.amazon.awssdk.enhanced.dynamodb.extensions.ReadModification) ReturnConsumedCapacity(software.amazon.awssdk.services.dynamodb.model.ReturnConsumedCapacity) Test(org.junit.Test) Mockito.when(org.mockito.Mockito.when) UUID(java.util.UUID) WriteModification(software.amazon.awssdk.enhanced.dynamodb.extensions.WriteModification) Collectors(java.util.stream.Collectors) Mockito.verify(org.mockito.Mockito.verify) UpdateItemEnhancedRequest(software.amazon.awssdk.enhanced.dynamodb.model.UpdateItemEnhancedRequest) Consumer(java.util.function.Consumer) DefaultDynamoDbExtensionContext(software.amazon.awssdk.enhanced.dynamodb.internal.extensions.DefaultDynamoDbExtensionContext) DynamoDbEnhancedClientExtension(software.amazon.awssdk.enhanced.dynamodb.DynamoDbEnhancedClientExtension) TableMetadata(software.amazon.awssdk.enhanced.dynamodb.TableMetadata) Stream(java.util.stream.Stream) DeleteAction(software.amazon.awssdk.enhanced.dynamodb.update.DeleteAction) Matchers.sameInstance(org.hamcrest.Matchers.sameInstance) OperationContext(software.amazon.awssdk.enhanced.dynamodb.OperationContext) FakeItemWithSort.createUniqueFakeItemWithSort(software.amazon.awssdk.enhanced.dynamodb.functionaltests.models.FakeItemWithSort.createUniqueFakeItemWithSort) AttributeValue(software.amazon.awssdk.services.dynamodb.model.AttributeValue) Matchers.is(org.hamcrest.Matchers.is) DynamoDbExtensionContext(software.amazon.awssdk.enhanced.dynamodb.DynamoDbExtensionContext) Matchers.containsString(org.hamcrest.Matchers.containsString) Collections(java.util.Collections) MockitoJUnitRunner(org.mockito.junit.MockitoJUnitRunner) ReturnValue(software.amazon.awssdk.services.dynamodb.model.ReturnValue) ReturnItemCollectionMetrics(software.amazon.awssdk.services.dynamodb.model.ReturnItemCollectionMetrics) UpdateItemResponse(software.amazon.awssdk.services.dynamodb.model.UpdateItemResponse) UpdateItemRequest(software.amazon.awssdk.services.dynamodb.model.UpdateItemRequest) FakeItemWithSort(software.amazon.awssdk.enhanced.dynamodb.functionaltests.models.FakeItemWithSort) FakeItemWithSort.createUniqueFakeItemWithSort(software.amazon.awssdk.enhanced.dynamodb.functionaltests.models.FakeItemWithSort.createUniqueFakeItemWithSort) Matchers.containsString(org.hamcrest.Matchers.containsString) Test(org.junit.Test)

Example 5 with FakeItemWithSort

use of software.amazon.awssdk.enhanced.dynamodb.functionaltests.models.FakeItemWithSort in project aws-sdk-java-v2 by aws.

the class UpdateItemOperationTest method generateRequest_canIgnoreNullValues.

@Test
public void generateRequest_canIgnoreNullValues() {
    FakeItemWithSort item = createUniqueFakeItemWithSort();
    item.setOtherAttribute1("value-1");
    UpdateItemOperation<FakeItemWithSort> updateItemOperation = UpdateItemOperation.create(requestFakeItemWithSort(item, b -> b.ignoreNulls(true)));
    UpdateItemRequest request = updateItemOperation.generateRequest(FakeItemWithSort.getTableSchema(), PRIMARY_CONTEXT, null);
    String expectedUpdateExpression = "SET " + OTHER_ATTRIBUTE_1_NAME + " = " + OTHER_ATTRIBUTE_1_VALUE;
    UpdateItemRequest.Builder expectedRequestBuilder = ddbRequestBuilder(ddbKey(item.getId(), item.getSort()));
    expectedRequestBuilder.expressionAttributeValues(expressionValuesFor(OTHER_ATTRIBUTE_1_VALUE));
    expectedRequestBuilder.expressionAttributeNames(expressionNamesFor(OTHER_ATTRIBUTE_1_NAME));
    expectedRequestBuilder.updateExpression(expectedUpdateExpression);
    UpdateItemRequest expectedRequest = expectedRequestBuilder.build();
    assertThat(request, is(expectedRequest));
}
Also used : ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) Matchers.either(org.hamcrest.Matchers.either) AttributeValues.numberValue(software.amazon.awssdk.enhanced.dynamodb.internal.AttributeValues.numberValue) Mock(org.mockito.Mock) UpdateItemRequest(software.amazon.awssdk.services.dynamodb.model.UpdateItemRequest) RunWith(org.junit.runner.RunWith) FakeItemWithSort(software.amazon.awssdk.enhanced.dynamodb.functionaltests.models.FakeItemWithSort) HashMap(java.util.HashMap) Expression(software.amazon.awssdk.enhanced.dynamodb.Expression) Collections.singletonList(java.util.Collections.singletonList) UpdateExpression(software.amazon.awssdk.enhanced.dynamodb.update.UpdateExpression) FakeItem.createUniqueFakeItem(software.amazon.awssdk.enhanced.dynamodb.functionaltests.models.FakeItem.createUniqueFakeItem) Matchers.nullValue(org.hamcrest.Matchers.nullValue) Map(java.util.Map) Collections.singletonMap(java.util.Collections.singletonMap) Assert.fail(org.junit.Assert.fail) FakeItem(software.amazon.awssdk.enhanced.dynamodb.functionaltests.models.FakeItem) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) Matchers.hasEntry(org.hamcrest.Matchers.hasEntry) DynamoDbClient(software.amazon.awssdk.services.dynamodb.DynamoDbClient) ReadModification(software.amazon.awssdk.enhanced.dynamodb.extensions.ReadModification) ReturnConsumedCapacity(software.amazon.awssdk.services.dynamodb.model.ReturnConsumedCapacity) Test(org.junit.Test) Mockito.when(org.mockito.Mockito.when) UUID(java.util.UUID) WriteModification(software.amazon.awssdk.enhanced.dynamodb.extensions.WriteModification) Collectors(java.util.stream.Collectors) Mockito.verify(org.mockito.Mockito.verify) UpdateItemEnhancedRequest(software.amazon.awssdk.enhanced.dynamodb.model.UpdateItemEnhancedRequest) Consumer(java.util.function.Consumer) DefaultDynamoDbExtensionContext(software.amazon.awssdk.enhanced.dynamodb.internal.extensions.DefaultDynamoDbExtensionContext) DynamoDbEnhancedClientExtension(software.amazon.awssdk.enhanced.dynamodb.DynamoDbEnhancedClientExtension) TableMetadata(software.amazon.awssdk.enhanced.dynamodb.TableMetadata) Stream(java.util.stream.Stream) DeleteAction(software.amazon.awssdk.enhanced.dynamodb.update.DeleteAction) Matchers.sameInstance(org.hamcrest.Matchers.sameInstance) OperationContext(software.amazon.awssdk.enhanced.dynamodb.OperationContext) FakeItemWithSort.createUniqueFakeItemWithSort(software.amazon.awssdk.enhanced.dynamodb.functionaltests.models.FakeItemWithSort.createUniqueFakeItemWithSort) AttributeValue(software.amazon.awssdk.services.dynamodb.model.AttributeValue) Matchers.is(org.hamcrest.Matchers.is) DynamoDbExtensionContext(software.amazon.awssdk.enhanced.dynamodb.DynamoDbExtensionContext) Matchers.containsString(org.hamcrest.Matchers.containsString) Collections(java.util.Collections) MockitoJUnitRunner(org.mockito.junit.MockitoJUnitRunner) ReturnValue(software.amazon.awssdk.services.dynamodb.model.ReturnValue) ReturnItemCollectionMetrics(software.amazon.awssdk.services.dynamodb.model.ReturnItemCollectionMetrics) UpdateItemResponse(software.amazon.awssdk.services.dynamodb.model.UpdateItemResponse) UpdateItemRequest(software.amazon.awssdk.services.dynamodb.model.UpdateItemRequest) FakeItemWithSort(software.amazon.awssdk.enhanced.dynamodb.functionaltests.models.FakeItemWithSort) FakeItemWithSort.createUniqueFakeItemWithSort(software.amazon.awssdk.enhanced.dynamodb.functionaltests.models.FakeItemWithSort.createUniqueFakeItemWithSort) Matchers.containsString(org.hamcrest.Matchers.containsString) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)22 FakeItemWithSort (software.amazon.awssdk.enhanced.dynamodb.functionaltests.models.FakeItemWithSort)22 FakeItemWithSort.createUniqueFakeItemWithSort (software.amazon.awssdk.enhanced.dynamodb.functionaltests.models.FakeItemWithSort.createUniqueFakeItemWithSort)16 AttributeValue (software.amazon.awssdk.services.dynamodb.model.AttributeValue)15 HashMap (java.util.HashMap)13 Collections.singletonList (java.util.Collections.singletonList)10 FakeItem (software.amazon.awssdk.enhanced.dynamodb.functionaltests.models.FakeItem)10 FakeItem.createUniqueFakeItem (software.amazon.awssdk.enhanced.dynamodb.functionaltests.models.FakeItem.createUniqueFakeItem)10 Collections (java.util.Collections)9 Collections.singletonMap (java.util.Collections.singletonMap)9 Map (java.util.Map)9 MatcherAssert.assertThat (org.hamcrest.MatcherAssert.assertThat)9 Matchers.is (org.hamcrest.Matchers.is)9 Matchers.nullValue (org.hamcrest.Matchers.nullValue)9 Matchers.sameInstance (org.hamcrest.Matchers.sameInstance)9 RunWith (org.junit.runner.RunWith)9 ArgumentMatchers.any (org.mockito.ArgumentMatchers.any)9 Mock (org.mockito.Mock)9 Mockito.verify (org.mockito.Mockito.verify)9 Mockito.when (org.mockito.Mockito.when)9