From ae17b0fc6b43f232e2fe2e8f2f062c8116b26bab Mon Sep 17 00:00:00 2001 From: Ben McIlwain Date: Thu, 23 Jan 2020 14:48:36 -0500 Subject: [PATCH] Change reserved messages for domains w/ required allocation token (#455) * Change reserved messages for domains w/ required allocation token In domain check reasons for unavailable domains, we were previously saying that domains were "Reserved" regardless of whether the domain was fully blocked or reserved for an anchor tenant or other specific use (e.g. the .new Limited Release Program). This commit changes the message for the latter situations to be "Allocation token required", so that registrars have a hint that domain will show as available if the correct allocation token is supplied to the domain check command using the allocation token extension. --- .../model/registry/label/ReservationType.java | 4 ++-- .../registry/flows/CheckApiActionTest.java | 19 +++++++++++++++++-- .../flows/domain/DomainCheckFlowTest.java | 12 ++++++------ 3 files changed, 25 insertions(+), 10 deletions(-) diff --git a/core/src/main/java/google/registry/model/registry/label/ReservationType.java b/core/src/main/java/google/registry/model/registry/label/ReservationType.java index 9fe15d4f6..d61e57682 100644 --- a/core/src/main/java/google/registry/model/registry/label/ReservationType.java +++ b/core/src/main/java/google/registry/model/registry/label/ReservationType.java @@ -38,10 +38,10 @@ public enum ReservationType { ALLOWED_IN_SUNRISE("Reserved", 0), /** The domain can only be registered by providing a specific token. */ - RESERVED_FOR_SPECIFIC_USE("Reserved", 1), + RESERVED_FOR_SPECIFIC_USE("Allocation token required", 1), /** The domain is for an anchor tenant and can only be registered using a specific token. */ - RESERVED_FOR_ANCHOR_TENANT("Reserved", 2), + RESERVED_FOR_ANCHOR_TENANT("Allocation token required", 2), /** * The domain can only be registered during sunrise for defensive purposes, and will never diff --git a/core/src/test/java/google/registry/flows/CheckApiActionTest.java b/core/src/test/java/google/registry/flows/CheckApiActionTest.java index e9e98cf40..464fdff72 100644 --- a/core/src/test/java/google/registry/flows/CheckApiActionTest.java +++ b/core/src/test/java/google/registry/flows/CheckApiActionTest.java @@ -72,7 +72,10 @@ public class CheckApiActionTest { .asBuilder() .setReservedLists( persistReservedList( - "example-reserved", "foo,FULLY_BLOCKED", "gold,RESERVED_FOR_SPECIFIC_USE")) + "example-reserved", + "foo,FULLY_BLOCKED", + "gold,RESERVED_FOR_SPECIFIC_USE", + "platinum,FULLY_BLOCKED")) .build()); } @@ -258,7 +261,7 @@ public class CheckApiActionTest { @Test public void testSuccess_reserved_premium() { - assertThat(getCheckResponse("gold.example")) + assertThat(getCheckResponse("platinum.example")) .containsExactly( "tier", "premium", "status", "success", @@ -268,6 +271,18 @@ public class CheckApiActionTest { verifySuccessMetric(PREMIUM, RESERVED); } + @Test + public void testSuccess_reservedForSpecificUse_premium() { + assertThat(getCheckResponse("gold.example")) + .containsExactly( + "tier", "premium", + "status", "success", + "available", false, + "reason", "Allocation token required"); + + verifySuccessMetric(PREMIUM, RESERVED); + } + private void verifySuccessMetric(Tier tier, Availability availability) { verify(checkApiMetrics).incrementCheckApiRequest(metricCaptor.capture()); CheckApiMetric metric = metricCaptor.getValue(); diff --git a/core/src/test/java/google/registry/flows/domain/DomainCheckFlowTest.java b/core/src/test/java/google/registry/flows/domain/DomainCheckFlowTest.java index 15df3d38d..adf857ec1 100644 --- a/core/src/test/java/google/registry/flows/domain/DomainCheckFlowTest.java +++ b/core/src/test/java/google/registry/flows/domain/DomainCheckFlowTest.java @@ -141,7 +141,7 @@ public class DomainCheckFlowTest extends ResourceCheckFlowTestCase