File tree Expand file tree Collapse file tree 1 file changed +26
-4
lines changed
Examples/runtimes/java/DynamoDbEncryption/src/test/java/software/amazon/cryptography/examples Expand file tree Collapse file tree 1 file changed +26
-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 = "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}
You can’t perform that action at this time.
0 commit comments