Remove Subscriptions.C attribute

This commit is contained in:
Chris Eager
2023-01-03 12:54:08 -06:00
committed by Chris Eager
parent 60edf4835f
commit 010f88a2ad
2 changed files with 13 additions and 33 deletions

View File

@@ -56,30 +56,12 @@ class SubscriptionManagerTest {
attributeName(SubscriptionManager.KEY_USER).
attributeType(ScalarAttributeType.B).
build()).
attributeDefinition(AttributeDefinition.builder().
attributeName(SubscriptionManager.KEY_CUSTOMER_ID).
attributeType(ScalarAttributeType.S).
build()).
attributeDefinition(AttributeDefinition.builder().
attributeName(SubscriptionManager.KEY_PROCESSOR_ID_CUSTOMER_ID).
attributeType(ScalarAttributeType.S).
attributeType(ScalarAttributeType.B).
build()).
globalSecondaryIndex(GlobalSecondaryIndex.builder().
indexName("c_to_u").
keySchema(KeySchemaElement.builder().
attributeName(SubscriptionManager.KEY_CUSTOMER_ID).
keyType(KeyType.HASH).
build()).
projection(Projection.builder().
projectionType(ProjectionType.KEYS_ONLY).
build()).
provisionedThroughput(ProvisionedThroughput.builder().
readCapacityUnits(20L).
writeCapacityUnits(20L).
build()).
build()).
globalSecondaryIndex(GlobalSecondaryIndex.builder().
indexName("pc_to_u").
indexName(SubscriptionManager.INDEX_NAME).
keySchema(KeySchemaElement.builder().
attributeName(SubscriptionManager.KEY_PROCESSOR_ID_CUSTOMER_ID).
keyType(KeyType.HASH).
@@ -193,7 +175,8 @@ class SubscriptionManagerTest {
// TODO test new customer ID with new processor does change the customer ID, once there is another processor
assertThat(subscriptionManager.getSubscriberUserByStripeCustomerId(customer))
assertThat(subscriptionManager.getSubscriberUserByProcessorCustomer(
new ProcessorCustomer(customer, SubscriptionProcessor.STRIPE)))
.succeedsWithin(Duration.ofSeconds(3)).
isEqualTo(user);
}
@@ -210,7 +193,8 @@ class SubscriptionManagerTest {
assertThat(subscriptionManager.updateProcessorAndCustomerId(userRecord,
new ProcessorCustomer(customer, SubscriptionProcessor.STRIPE),
subscriptionUpdated)).succeedsWithin(Duration.ofSeconds(3));
assertThat(subscriptionManager.getSubscriberUserByStripeCustomerId(customer)).
assertThat(subscriptionManager.getSubscriberUserByProcessorCustomer(
new ProcessorCustomer(customer, SubscriptionProcessor.STRIPE))).
succeedsWithin(Duration.ofSeconds(3)).
isEqualTo(user);
}