|
3 | 3 | import cloud.localstack.Constants;
|
4 | 4 | import cloud.localstack.LocalstackTestRunner;
|
5 | 5 |
|
| 6 | +import com.amazonaws.services.dynamodbv2.model.ListTablesResult; |
| 7 | +import org.assertj.core.api.Assertions; |
6 | 8 | import software.amazon.awssdk.core.SdkSystemSetting;
|
7 | 9 | import software.amazon.awssdk.services.cloudwatch.*;
|
8 | 10 | import software.amazon.awssdk.services.cloudwatch.model.*;
|
| 11 | +import software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClient; |
| 12 | +import software.amazon.awssdk.services.dynamodb.model.*; |
9 | 13 | import software.amazon.awssdk.services.kinesis.*;
|
10 | 14 | import software.amazon.awssdk.services.kinesis.model.*;
|
11 | 15 | import software.amazon.awssdk.services.s3.*;
|
@@ -78,6 +82,31 @@ public void testCreateKinesisRecordV2() throws Exception {
|
78 | 82 | Assert.assertNotNull(kinesisClient.putRecord(putRecordRequest.build()));
|
79 | 83 | }
|
80 | 84 |
|
| 85 | + @Test |
| 86 | + public void testCreateDynamoDBTable() throws Exception { |
| 87 | + DynamoDbAsyncClient dynamoDbAsyncClient = TestUtils.getClientDyanamoAsyncV2(); |
| 88 | + CreateTableRequest createTableRequest = CreateTableRequest.builder() |
| 89 | + .keySchema( |
| 90 | + KeySchemaElement.builder() |
| 91 | + .keyType(KeyType.HASH) |
| 92 | + .attributeName("test") |
| 93 | + .build() |
| 94 | + ) |
| 95 | + .attributeDefinitions(AttributeDefinition.builder() |
| 96 | + .attributeName("test") |
| 97 | + .attributeType(ScalarAttributeType.S) |
| 98 | + .build()) |
| 99 | + .provisionedThroughput( |
| 100 | + ProvisionedThroughput.builder() |
| 101 | + .readCapacityUnits(5L) |
| 102 | + .writeCapacityUnits(5L) |
| 103 | + .build()) |
| 104 | + .tableName("test") |
| 105 | + .build(); |
| 106 | + CreateTableResponse response = dynamoDbAsyncClient.createTable(createTableRequest).get(); |
| 107 | + Assert.assertNotNull(response); |
| 108 | + } |
| 109 | + |
81 | 110 | @Test
|
82 | 111 | public void testS3CreateListBuckets() throws Exception {
|
83 | 112 | String bucketName = "test-b-"+UUID.randomUUID().toString();
|
|
0 commit comments