From ca60ca159f0f08f887ecc9f972081e93466c9286 Mon Sep 17 00:00:00 2001 From: sarahcaseybot Date: Thu, 27 Oct 2022 13:08:15 -0400 Subject: [PATCH] Add DEFAULT_PROMO token type (#1832) * Add DEFAULT_PROMO token type * Fix test error message check --- .../registry/model/domain/token/AllocationToken.java | 10 ++++++---- .../tools/GenerateAllocationTokensCommandTest.java | 3 ++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/core/src/main/java/google/registry/model/domain/token/AllocationToken.java b/core/src/main/java/google/registry/model/domain/token/AllocationToken.java index 73552a121..dc9c41e85 100644 --- a/core/src/main/java/google/registry/model/domain/token/AllocationToken.java +++ b/core/src/main/java/google/registry/model/domain/token/AllocationToken.java @@ -109,13 +109,15 @@ public class AllocationToken extends BackupGroupRoot implements Buildable { ANCHOR_TENANT } - /** - * Single-use tokens are invalid after use. Infinite-use tokens, predictably, are not. Package - * tokens are used in package promotions. - */ + /** Type of the token that indicates how and where it should be used. */ public enum TokenType { + /** Token saved on a TLD to use if no other token is passed from the client */ + DEFAULT_PROMO, + /** Token used for package pricing */ PACKAGE, + /** Invalid after use */ SINGLE_USE, + /** Do not expire after use */ UNLIMITED_USE, } diff --git a/core/src/test/java/google/registry/tools/GenerateAllocationTokensCommandTest.java b/core/src/test/java/google/registry/tools/GenerateAllocationTokensCommandTest.java index 3f351a2b3..759069422 100644 --- a/core/src/test/java/google/registry/tools/GenerateAllocationTokensCommandTest.java +++ b/core/src/test/java/google/registry/tools/GenerateAllocationTokensCommandTest.java @@ -403,7 +403,8 @@ class GenerateAllocationTokensCommandTest extends CommandTestCase