From bb27feebd62080a1632bad45cfe2ba6ca1b5e4ac Mon Sep 17 00:00:00 2001 From: Rachel Guan Date: Thu, 5 May 2022 15:48:45 -0400 Subject: [PATCH] Add renewal logic in allocation token related commands (#1596) * Add renewal price behavior to allocation token related command * Add details to renewal price behavior --- .../GenerateAllocationTokensCommand.java | 13 +++ .../tools/UpdateAllocationTokensCommand.java | 15 +++ .../domain/token/AllocationTokenTest.java | 6 +- .../GenerateAllocationTokensCommandTest.java | 69 ++++++++++++++ .../UpdateAllocationTokensCommandTest.java | 95 +++++++++++++++++++ 5 files changed, 195 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/google/registry/tools/GenerateAllocationTokensCommand.java b/core/src/main/java/google/registry/tools/GenerateAllocationTokensCommand.java index 16137fddc..d1d9cc909 100644 --- a/core/src/main/java/google/registry/tools/GenerateAllocationTokensCommand.java +++ b/core/src/main/java/google/registry/tools/GenerateAllocationTokensCommand.java @@ -17,6 +17,7 @@ package google.registry.tools; import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.collect.ImmutableSet.toImmutableSet; import static com.google.common.collect.Sets.difference; +import static google.registry.model.billing.BillingEvent.RenewalPriceBehavior.DEFAULT; import static google.registry.model.domain.token.AllocationToken.TokenType.SINGLE_USE; import static google.registry.model.domain.token.AllocationToken.TokenType.UNLIMITED_USE; import static google.registry.persistence.transaction.TransactionManagerFactory.tm; @@ -37,6 +38,7 @@ import com.google.common.collect.ImmutableSortedMap; import com.google.common.collect.Iterables; import com.google.common.collect.Streams; import com.google.common.io.Files; +import google.registry.model.billing.BillingEvent.RenewalPriceBehavior; import google.registry.model.domain.token.AllocationToken; import google.registry.model.domain.token.AllocationToken.TokenStatus; import google.registry.model.domain.token.AllocationToken.TokenType; @@ -141,6 +143,16 @@ class GenerateAllocationTokensCommand implements CommandWithRemoteApi { + " form