File tree Expand file tree Collapse file tree 1 file changed +27
-4
lines changed
Examples/runtimes/java/DynamoDbEncryption/src/test/java/software/amazon/cryptography/examples Expand file tree Collapse file tree 1 file changed +27
-4
lines changed Original file line number Diff line number Diff line change 11package software .amazon .cryptography .examples ;
22
3+ import java .util .UUID ;
34import org .testng .annotations .Test ;
45
56public class TestGetEncryptedDataKeyDescriptionExample {
67
78 @ Test
89 public void TestGetEncryptedDataKeyDescription () {
10+ final String partitionKeyValue =
11+ "GetEncryptedDataKeyDescriptionExample" + UUID .randomUUID ();
12+ final String partitionKeyName = "partition_key" ;
13+ final String sortKeyValue = "0" ;
14+ final String sortKeyName = "sort_key" ;
15+ // `getEncryptedDataKeyDescription` assumes that there is already existing item in dynamodb.
16+ // So, we need to run `PutItemGetItem` before `getEncryptedDataKeyDescription`
17+ BasicPutGetExample .PutItemGetItem (
18+ TestUtils .TEST_KMS_KEY_ID ,
19+ TestUtils .TEST_DDB_TABLE_NAME ,
20+ partitionKeyName ,
21+ sortKeyName ,
22+ partitionKeyValue ,
23+ sortKeyValue
24+ );
925 GetEncryptedDataKeyDescriptionExample .getEncryptedDataKeyDescription (
1026 TestUtils .TEST_DDB_TABLE_NAME ,
11- "partition_key" ,
12- "BasicPutGetExample" ,
13- "sort_key" ,
14- "0" ,
27+ partitionKeyName ,
28+ partitionKeyValue ,
29+ sortKeyName ,
30+ sortKeyValue ,
1531 "aws-kms" ,
1632 TestUtils .TEST_KMS_KEY_ID ,
1733 null ,
1834 null
1935 );
36+ TestUtils .cleanUpDDBItem (
37+ TestUtils .TEST_DDB_TABLE_NAME ,
38+ partitionKeyName ,
39+ sortKeyName ,
40+ partitionKeyValue ,
41+ sortKeyValue
42+ );
2043 }
2144}
You can’t perform that action at this time.
0 commit comments