Skip to content

Commit a8ad400

Browse files
auto commit
1 parent 8cae1fe commit a8ad400

File tree

1 file changed

+26
-4
lines changed

1 file changed

+26
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,43 @@
11
package software.amazon.cryptography.examples;
22

3+
import java.util.UUID;
34
import org.testng.annotations.Test;
45

56
public class TestGetEncryptedDataKeyDescriptionExample {
67

78
@Test
89
public void TestGetEncryptedDataKeyDescription() {
10+
final String partitionKeyValue = "BasicPutGetExample" + UUID.randomUUID();
11+
final String partitionKeyName = "partition_key";
12+
final String sortKeyValue = "0";
13+
final String sortKeyName = "sort_key";
14+
// `getEncryptedDataKeyDescription` assumes that there is already existing item in dynamodb.
15+
// So, we need to run `PutItemGetItem` before `getEncryptedDataKeyDescription`
16+
BasicPutGetExample.PutItemGetItem(
17+
TestUtils.TEST_KMS_KEY_ID,
18+
TestUtils.TEST_DDB_TABLE_NAME,
19+
partitionKeyName,
20+
sortKeyName,
21+
partitionKeyValue,
22+
sortKeyValue
23+
);
924
GetEncryptedDataKeyDescriptionExample.getEncryptedDataKeyDescription(
1025
TestUtils.TEST_DDB_TABLE_NAME,
11-
"partition_key",
12-
"BasicPutGetExample",
13-
"sort_key",
14-
"0",
26+
partitionKeyName,
27+
partitionKeyValue,
28+
sortKeyName,
29+
sortKeyValue,
1530
"aws-kms",
1631
TestUtils.TEST_KMS_KEY_ID,
1732
null,
1833
null
1934
);
35+
TestUtils.cleanUpDDBItem(
36+
TestUtils.TEST_DDB_TABLE_NAME,
37+
partitionKeyName,
38+
sortKeyName,
39+
partitionKeyValue,
40+
sortKeyValue
41+
);
2042
}
2143
}

0 commit comments

Comments
 (0)