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 1
1
package software .amazon .cryptography .examples ;
2
2
3
+ import java .util .UUID ;
3
4
import org .testng .annotations .Test ;
4
5
5
6
public class TestGetEncryptedDataKeyDescriptionExample {
6
7
7
8
@ Test
8
9
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
+ );
9
25
GetEncryptedDataKeyDescriptionExample .getEncryptedDataKeyDescription (
10
26
TestUtils .TEST_DDB_TABLE_NAME ,
11
- "partition_key" ,
12
- "BasicPutGetExample" ,
13
- "sort_key" ,
14
- "0" ,
27
+ partitionKeyName ,
28
+ partitionKeyValue ,
29
+ sortKeyName ,
30
+ sortKeyValue ,
15
31
"aws-kms" ,
16
32
TestUtils .TEST_KMS_KEY_ID ,
17
33
null ,
18
34
null
19
35
);
36
+ TestUtils .cleanUpDDBItem (
37
+ TestUtils .TEST_DDB_TABLE_NAME ,
38
+ partitionKeyName ,
39
+ sortKeyName ,
40
+ partitionKeyValue ,
41
+ sortKeyValue
42
+ );
20
43
}
21
44
}
You can’t perform that action at this time.
0 commit comments