Skip to content

Commit 08f4ceb

Browse files
fix(PerfTest): fix Hierarchy Test
1 parent e42c28f commit 08f4ceb

File tree

1 file changed

+12
-11
lines changed
  • PerfTest/runtimes/java/DynamoDbEncryption/src/main/java/software/aws/cryptography/performance/itemencryptor/v3

1 file changed

+12
-11
lines changed
Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,17 @@
3636
import static software.aws.cryptography.performance.itemencryptor.TestConstants.TEST_PK;
3737
import static software.aws.cryptography.performance.itemencryptor.TestConstants.UNAUTH_PREFIX;
3838

39-
public class HeirarchyKeyringTest extends TestBase {
39+
public class HierarchyKeyringTest extends TestBase {
4040
private static final String TEST_KEYSTORE_NAME = "KeyStoreTestTable";
4141
private static final String TEST_DDB_TABLE_NAME = "DynamoDbEncryptionInterceptorTestTable";
4242

4343
private DynamoDbEncryption ddbEnc;
4444
private DynamoDbClient ddb;
4545

46-
public HeirarchyKeyringTest() {
46+
public HierarchyKeyringTest() {
4747
}
4848

49-
HeirarchyKeyringTest(final String plainTextFile) {
49+
HierarchyKeyringTest(final String plainTextFile) {
5050
this.plainTextFile = plainTextFile;
5151
}
5252
@Override
@@ -56,6 +56,7 @@ protected IKeyring createKeyring() {
5656

5757
final KeyStoreConfig keyStoreConfig = KeyStoreConfig.builder()
5858
.ddbTableName(TEST_KEYSTORE_NAME)
59+
.logicalKeyStoreName(TEST_KEYSTORE_NAME)
5960
.kmsConfiguration(KMSConfiguration.builder()
6061
.kmsKeyArn(KMS_KEY_ARN)
6162
.build())
@@ -76,20 +77,20 @@ protected IKeyring createKeyring() {
7677
final IBranchKeyIdSupplier branchKeyIdSupplier = ddbEnc.CreateDynamoDbEncryptionBranchKeyIdSupplier(
7778
CreateDynamoDbEncryptionBranchKeyIdSupplierInput.builder()
7879
.ddbKeyBranchKeyIdSupplier((getBranchKeyIdFromDdbKeyInput) -> {
79-
String tenantKeyId = getBranchKeyIdFromDdbKeyInput.ddbKey().get(PARTITION_ATTRIBUTE).s();
80-
if (tenantKeyId.equals(TEST_PK)) {
81-
return GetBranchKeyIdFromDdbKeyOutput.builder().branchKeyId(tenant1BranchKey).build();
82-
}
83-
return GetBranchKeyIdFromDdbKeyOutput.builder().branchKeyId(tenant2BranchKey).build();
84-
})
80+
String tenantKeyId = getBranchKeyIdFromDdbKeyInput.ddbKey().get(PARTITION_ATTRIBUTE).s();
81+
if (tenantKeyId.equals(TEST_PK)) {
82+
return GetBranchKeyIdFromDdbKeyOutput.builder().branchKeyId(tenant1BranchKey).build();
83+
}
84+
return GetBranchKeyIdFromDdbKeyOutput.builder().branchKeyId(tenant2BranchKey).build();
85+
})
8586
.build())
8687
.branchKeyIdSupplier();
8788

8889

8990
CreateAwsKmsHierarchicalKeyringInput keyringInput = CreateAwsKmsHierarchicalKeyringInput.builder()
9091
.maxCacheSize(10)
9192
.keyStore(keystore)
92-
.branchKeyIdSupplier(branchKeyIdSupplier).ttlSeconds(60)
93+
.branchKeyIdSupplier(branchKeyIdSupplier).ttlSeconds(60)
9394
.maxCacheSize(100)
9495
.build();
9596
MaterialProviders matProv = MaterialProviders.builder().MaterialProvidersConfig(MaterialProvidersConfig.builder().build()).build();
@@ -169,7 +170,7 @@ public Map<String, AttributeValue> decrypt() {
169170
* @throws Exception
170171
*/
171172
public static void main(String[] args) throws Exception {
172-
TestBase testBase = new HeirarchyKeyringTest("single_attribute.json");
173+
TestBase testBase = new HierarchyKeyringTest("single_attribute.json");
173174
testBase.setup();
174175
testBase.decrypt();
175176

0 commit comments

Comments
 (0)